chrome/test/unit/test_bug292789.js

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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