chrome/test/unit/test_bug292789.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 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     4  */
     6 const MANIFESTS = [
     7   do_get_file("data/test_bug292789.manifest")
     8 ];
    10 registerManifests(MANIFESTS);
    12 var gIOS;
    13 var gCR;
    15 function check_accessibility(spec, desired)
    16 {
    17   var uri = gIOS.newURI(spec, null, null);
    18   var actual = gCR.allowContentToAccess(uri);
    19   do_check_eq(desired, actual);
    20 }
    22 function run_test()
    23 {
    24   gIOS = Cc["@mozilla.org/network/io-service;1"].
    25     getService(Ci.nsIIOService);
    26   gCR = Cc["@mozilla.org/chrome/chrome-registry;1"].
    27     getService(Ci.nsIXULChromeRegistry);
    28   gCR.checkForNewChrome();
    30   check_accessibility("chrome://test1/content/", false);
    31   check_accessibility("chrome://test1/content/foo.js", false);
    32   check_accessibility("chrome://test2/content/", true);
    33   check_accessibility("chrome://test2/content/foo.js", true);
    34   check_accessibility("chrome://test3/content/", false);
    35   check_accessibility("chrome://test3/content/foo.js", false);
    36   check_accessibility("chrome://test4/content/", true);
    37 }

mercurial