summaryrefslogtreecommitdiffstats
path: root/dom/ipc/tests/JSProcessActor/browser_uri_combination.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /dom/ipc/tests/JSProcessActor/browser_uri_combination.js
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
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.js81
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");
+ }
+});