diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /dom/ipc/tests/JSWindowActor/browser_uri_combination.js | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream/1%115.7.0.tar.xz thunderbird-upstream/1%115.7.0.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/ipc/tests/JSWindowActor/browser_uri_combination.js')
-rw-r--r-- | dom/ipc/tests/JSWindowActor/browser_uri_combination.js | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/dom/ipc/tests/JSWindowActor/browser_uri_combination.js b/dom/ipc/tests/JSWindowActor/browser_uri_combination.js new file mode 100644 index 0000000000..ce46a3e3b6 --- /dev/null +++ b/dom/ipc/tests/JSWindowActor/browser_uri_combination.js @@ -0,0 +1,81 @@ +add_task(function specify_both() { + // Specifying both should throw. + + SimpleTest.doesThrow(() => { + ChromeUtils.registerWindowActor("TestWindow", { + parent: { + moduleURI: "resource://testing-common/TestWindowParent.jsm", + }, + child: { + moduleURI: "resource://testing-common/TestWindowChild.jsm", + esModuleURI: "resource://testing-common/TestWindowChild.sys.mjs", + }, + }); + }, "Should throw if both moduleURI and esModuleURI are specified."); + + SimpleTest.doesThrow(() => { + ChromeUtils.registerWindowActor("TestWindow", { + parent: { + esModuleURI: "resource://testing-common/TestWindowParent.sys.mjs", + }, + child: { + moduleURI: "resource://testing-common/TestWindowChild.jsm", + esModuleURI: "resource://testing-common/TestWindowChild.sys.mjs", + }, + }); + }, "Should throw if both moduleURI and esModuleURI are specified."); + + SimpleTest.doesThrow(() => { + ChromeUtils.registerWindowActor("TestWindow", { + parent: { + moduleURI: "resource://testing-common/TestWindowParent.jsm", + esModuleURI: "resource://testing-common/TestWindowParent.sys.mjs", + }, + child: { + moduleURI: "resource://testing-common/TestWindowChild.jsm", + }, + }); + }, "Should throw if both moduleURI and esModuleURI are specified."); + + SimpleTest.doesThrow(() => { + ChromeUtils.registerWindowActor("TestWindow", { + parent: { + moduleURI: "resource://testing-common/TestWindowParent.jsm", + esModuleURI: "resource://testing-common/TestWindowParent.sys.mjs", + }, + child: { + esModuleURI: "resource://testing-common/TestWindowChild.sys.mjs", + }, + }); + }, "Should throw if both moduleURI and esModuleURI are specified."); +}); + +add_task(function specify_mixed() { + // Mixing JSM and ESM should work. + + try { + ChromeUtils.registerWindowActor("TestWindow", { + parent: { + moduleURI: "resource://testing-common/TestWindowParent.jsm", + }, + child: { + esModuleURI: "resource://testing-common/TestWindowChild.sys.mjs", + }, + }); + } finally { + ChromeUtils.unregisterWindowActor("TestWindow"); + } + + try { + ChromeUtils.registerWindowActor("TestWindow", { + parent: { + esModuleURI: "resource://testing-common/TestWindowParent.sys.mjs", + }, + child: { + moduleURI: "resource://testing-common/TestWindowChild.jsm", + }, + }); + } finally { + ChromeUtils.unregisterWindowActor("TestWindow"); + } +}); |