js/src/tests/ecma/Date/15.9.4.2-1.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 /**
     8  *  File Name:
     9  *  Reference:          http://bugzilla.mozilla.org/show_bug.cgi?id=4088
    10  *  Description:        Date parsing gets 12:30 AM wrong.
    11  *  New behavior:
    12  *  js> d = new Date('1/1/1999 13:30 AM')
    13  * Invalid Date
    14  * js> d = new Date('1/1/1999 13:30 PM')
    15  * Invalid Date
    16  * js> d = new Date('1/1/1999 12:30 AM')
    17  * Fri Jan 01 00:30:00 GMT-0800 (PST) 1999
    18  * js> d = new Date('1/1/1999 12:30 PM')
    19  * Fri Jan 01 12:30:00 GMT-0800 (PST) 1999
    20  *  Author:             christine@netscape.com
    21  */
    23 var SECTION = "15.9.4.2-1";       // provide a document reference (ie, ECMA section)
    24 var VERSION = "ECMA"; // Version of JavaScript or ECMA
    25 var TITLE   = "Regression Test for Date.parse";       // Provide ECMA section title or a description
    26 var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=4088";     // Provide URL to bugsplat or bugzilla report
    28 startTest();               // leave this alone
    30 AddTestCase( "new Date('1/1/1999 12:30 AM').toString()",
    31 	     new Date(1999,0,1,0,30).toString(),
    32 	     new Date('1/1/1999 12:30 AM').toString() );
    34 AddTestCase( "new Date('1/1/1999 12:30 PM').toString()",
    35 	     new Date( 1999,0,1,12,30 ).toString(),
    36 	     new Date('1/1/1999 12:30 PM').toString() );
    38 AddTestCase( "new Date('1/1/1999 13:30 AM')",
    39 	     "Invalid Date",
    40 	     new Date('1/1/1999 13:30 AM').toString() );
    43 AddTestCase( "new Date('1/1/1999 13:30 PM')",
    44 	     "Invalid Date",
    45 	     new Date('1/1/1999 13:30 PM').toString() );
    47 test();       // leave this alone.  this executes the test cases and
    48 // displays results.

mercurial