toolkit/mozapps/extensions/test/xpcshell/test_childprocess.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 /* Any copyright is dedicated to the Public Domain.
     2  * http://creativecommons.org/publicdomain/zero/1.0/
     3  */
     5 // This verifies that the AddonManager refuses to load in child processes.
     7 function run_test() {
     8   // Already loaded the module by head_addons.js. Need to unload this again, so
     9   // that overriding the app-info and re-importing the module works.
    10   Components.utils.unload("resource://gre/modules/AddonManager.jsm");
    11   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
    12   gAppInfo.processType = AM_Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
    13   try {
    14     Components.utils.import("resource://gre/modules/AddonManager.jsm");
    15     do_throw("AddonManager should have refused to load");
    16   }
    17   catch (ex) {
    18     do_print(ex.message);
    19     do_check_true(!!ex.message);
    20   }
    21 }

mercurial