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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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