toolkit/mozapps/extensions/test/xpcshell/test_childprocess.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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