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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/mozapps/extensions/test/xpcshell/test_childprocess.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,21 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 + * http://creativecommons.org/publicdomain/zero/1.0/
     1.6 + */
     1.7 +
     1.8 +// This verifies that the AddonManager refuses to load in child processes.
     1.9 +
    1.10 +function run_test() {
    1.11 +  // Already loaded the module by head_addons.js. Need to unload this again, so
    1.12 +  // that overriding the app-info and re-importing the module works.
    1.13 +  Components.utils.unload("resource://gre/modules/AddonManager.jsm");
    1.14 +  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
    1.15 +  gAppInfo.processType = AM_Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
    1.16 +  try {
    1.17 +    Components.utils.import("resource://gre/modules/AddonManager.jsm");
    1.18 +    do_throw("AddonManager should have refused to load");
    1.19 +  }
    1.20 +  catch (ex) {
    1.21 +    do_print(ex.message);
    1.22 +    do_check_true(!!ex.message);
    1.23 +  }
    1.24 +}

mercurial