From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../extensions/test/xpcshell/test_childprocess.js | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 toolkit/mozapps/extensions/test/xpcshell/test_childprocess.js (limited to 'toolkit/mozapps/extensions/test/xpcshell/test_childprocess.js') diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_childprocess.js b/toolkit/mozapps/extensions/test/xpcshell/test_childprocess.js new file mode 100644 index 0000000000..d7661d52ad --- /dev/null +++ b/toolkit/mozapps/extensions/test/xpcshell/test_childprocess.js @@ -0,0 +1,25 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +// This verifies that the AddonManager refuses to load in child processes. + +// NOTE: This test does NOT load head_addons.js, because that would indirectly +// load AddonManager.sys.mjs. In this test, we want to be the first to load the +// AddonManager module to verify that it cannot be loaded in child processes. + +const { updateAppInfo } = ChromeUtils.importESModule( + "resource://testing-common/AppInfo.sys.mjs" +); + +function run_test() { + updateAppInfo(); + Services.appinfo.processType = Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT; + try { + ChromeUtils.importESModule("resource://gre/modules/AddonManager.sys.mjs"); + do_throw("AddonManager should have refused to load"); + } catch (ex) { + info(ex.message); + Assert.ok(!!ex.message); + } +} -- cgit v1.2.3