|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 * http://creativecommons.org/publicdomain/zero/1.0/ |
|
3 */ |
|
4 |
|
5 // This verifies that the AddonManager refuses to load in child processes. |
|
6 |
|
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 } |