Sat, 03 Jan 2015 20:18:00 +0100
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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | |
michael@0 | 7 | /** |
michael@0 | 8 | * File Name: regress-6359.js |
michael@0 | 9 | * Reference: ** replace with bugzilla URL or document reference ** |
michael@0 | 10 | * Description: ** replace with description of test ** |
michael@0 | 11 | * Author: ** replace with your e-mail address ** |
michael@0 | 12 | */ |
michael@0 | 13 | |
michael@0 | 14 | var SECTION = "js1_2"; // provide a document reference (ie, ECMA section) |
michael@0 | 15 | var VERSION = "ECMA_2"; // Version of JavaScript or ECMA |
michael@0 | 16 | var TITLE = "Regression test for bugzilla # 6359"; // Provide ECMA section title or a description |
michael@0 | 17 | var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=6359"; // Provide URL to bugsplat or bugzilla report |
michael@0 | 18 | |
michael@0 | 19 | startTest(); // leave this alone |
michael@0 | 20 | |
michael@0 | 21 | /* |
michael@0 | 22 | * Calls to AddTestCase here. AddTestCase is a function that is defined |
michael@0 | 23 | * in shell.js and takes three arguments: |
michael@0 | 24 | * - a string representation of what is being tested |
michael@0 | 25 | * - the expected result |
michael@0 | 26 | * - the actual result |
michael@0 | 27 | * |
michael@0 | 28 | * For example, a test might look like this: |
michael@0 | 29 | * |
michael@0 | 30 | * var zip = /[\d]{5}$/; |
michael@0 | 31 | * |
michael@0 | 32 | * AddTestCase( |
michael@0 | 33 | * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)", // description of the test |
michael@0 | 34 | * "02134", // expected result |
michael@0 | 35 | * "PO Box 12345 Boston, MA 02134".match(zip) ); // actual result |
michael@0 | 36 | * |
michael@0 | 37 | */ |
michael@0 | 38 | |
michael@0 | 39 | AddTestCase( '/(a*)b\1+/.exec("baaac").length', |
michael@0 | 40 | 2, |
michael@0 | 41 | /(a*)b\1+/.exec("baaac").length ); |
michael@0 | 42 | |
michael@0 | 43 | AddTestCase( '/(a*)b\1+/.exec("baaac")[0]', |
michael@0 | 44 | "b", |
michael@0 | 45 | /(a*)b\1+/.exec("baaac")[0]); |
michael@0 | 46 | |
michael@0 | 47 | AddTestCase( '/(a*)b\1+/.exec("baaac")[1]', |
michael@0 | 48 | "", |
michael@0 | 49 | /(a*)b\1+/.exec("baaac")[1]); |
michael@0 | 50 | |
michael@0 | 51 | |
michael@0 | 52 | test(); // leave this alone. this executes the test cases and |
michael@0 | 53 | // displays results. |