js/src/tests/js1_2/regress/regress-7703.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/. */
     8 /**
     9  *  File Name:          regress-7703.js
    10  *  Reference:          "http://bugzilla.mozilla.org/show_bug.cgi?id=7703";
    11  *  Description:        See the text of the bugnumber above
    12  */
    14 var SECTION = "js1_2";       // provide a document reference (ie, ECMA section)
    15 var VERSION = "JS1_2"; // Version of JavaScript or ECMA
    16 var TITLE   = "Regression test for bugzilla # 7703";       // Provide ECMA section title or a description
    17 var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=7703";     // Provide URL to bugsplat or bugzilla report
    19 startTest();               // leave this alone
    21 /*
    22  * Calls to AddTestCase here. AddTestCase is a function that is defined
    23  * in shell.js and takes three arguments:
    24  * - a string representation of what is being tested
    25  * - the expected result
    26  * - the actual result
    27  *
    28  * For example, a test might look like this:
    29  *
    30  * var zip = /[\d]{5}$/;
    31  *
    32  * AddTestCase(
    33  * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)",   // description of the test
    34  *  "02134",                                                           // expected result
    35  *  "PO Box 12345 Boston, MA 02134".match(zip) );                      // actual result
    36  *
    37  */
    39 types = [];
    40 function inspect(object) {
    41   for (prop in object) {
    42     var x = object[prop];
    43     types[types.length] = (typeof x);
    44   }
    45 }
    47 var o = {a: 1, b: 2};
    48 inspect(o);
    50 AddTestCase( "inspect(o),length",   2,       types.length );
    51 AddTestCase( "inspect(o)[0]",      "number", types[0] );
    52 AddTestCase( "inspect(o)[1]",      "number", types[1] );
    54 types_2 = [];
    56 function inspect_again(object) {
    57   for (prop in object) {
    58     types_2[types_2.length] = (typeof object[prop]);
    59   }
    60 }
    62 inspect_again(o);
    63 AddTestCase( "inspect_again(o),length",   2,       types.length );
    64 AddTestCase( "inspect_again(o)[0]",      "number", types[0] );
    65 AddTestCase( "inspect_again(o)[1]",      "number", types[1] );
    68 test();       // leave this alone.  this executes the test cases and
    69 // displays results.

mercurial