diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/ipc/tests/JSProcessActor/browser_uri_combination.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/ipc/tests/JSProcessActor/browser_uri_combination.js')
-rw-r--r-- | dom/ipc/tests/JSProcessActor/browser_uri_combination.js | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/dom/ipc/tests/JSProcessActor/browser_uri_combination.js b/dom/ipc/tests/JSProcessActor/browser_uri_combination.js new file mode 100644 index 0000000000..33394cf54a --- /dev/null +++ b/dom/ipc/tests/JSProcessActor/browser_uri_combination.js @@ -0,0 +1,81 @@ +add_task(function specify_both() { + // Specifying both should throw. + + SimpleTest.doesThrow(() => { + ChromeUtils.registerProcessActor("TestProcessActor", { + parent: { + moduleURI: "resource://testing-common/TestProcessActorParent.jsm", + }, + child: { + moduleURI: "resource://testing-common/TestProcessActorChild.jsm", + esModuleURI: "resource://testing-common/TestProcessActorChild.sys.mjs", + }, + }); + }, "Should throw if both moduleURI and esModuleURI are specified."); + + SimpleTest.doesThrow(() => { + ChromeUtils.registerProcessActor("TestProcessActor", { + parent: { + esModuleURI: "resource://testing-common/TestProcessActorParent.sys.mjs", + }, + child: { + moduleURI: "resource://testing-common/TestProcessActorChild.jsm", + esModuleURI: "resource://testing-common/TestProcessActorChild.sys.mjs", + }, + }); + }, "Should throw if both moduleURI and esModuleURI are specified."); + + SimpleTest.doesThrow(() => { + ChromeUtils.registerProcessActor("TestProcessActor", { + parent: { + moduleURI: "resource://testing-common/TestProcessActorParent.jsm", + esModuleURI: "resource://testing-common/TestProcessActorParent.sys.mjs", + }, + child: { + moduleURI: "resource://testing-common/TestProcessActorChild.jsm", + }, + }); + }, "Should throw if both moduleURI and esModuleURI are specified."); + + SimpleTest.doesThrow(() => { + ChromeUtils.registerProcessActor("TestProcessActor", { + parent: { + moduleURI: "resource://testing-common/TestProcessActorParent.jsm", + esModuleURI: "resource://testing-common/TestProcessActorParent.sys.mjs", + }, + child: { + esModuleURI: "resource://testing-common/TestProcessActorChild.sys.mjs", + }, + }); + }, "Should throw if both moduleURI and esModuleURI are specified."); +}); + +add_task(function specify_mixed() { + // Mixing JSM and ESM should work. + + try { + ChromeUtils.registerProcessActor("TestProcessActor", { + parent: { + moduleURI: "resource://testing-common/TestProcessActorParent.jsm", + }, + child: { + esModuleURI: "resource://testing-common/TestProcessActorChild.sys.mjs", + }, + }); + } finally { + ChromeUtils.unregisterProcessActor("TestProcessActor"); + } + + try { + ChromeUtils.registerProcessActor("TestProcessActor", { + parent: { + esModuleURI: "resource://testing-common/TestProcessActorParent.sys.mjs", + }, + child: { + moduleURI: "resource://testing-common/TestProcessActorChild.jsm", + }, + }); + } finally { + ChromeUtils.unregisterProcessActor("TestProcessActor"); + } +}); |