From 12c1ff39be7260336bc8afd1274081c37b22a66d Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Tue, 21 Jan 2025 13:37:17 +0000 Subject: [PATCH] Bug 1866732 - Part 1: Remove tests for loading JSMs in Actors. r=nika Differential Revision: https://phabricator.services.mozilla.com/D233362 --- dom/ipc/tests/JSProcessActor/browser.toml | 2 - .../tests/JSProcessActor/browser_sendQuery.js | 28 ++--- .../JSProcessActor/browser_uri_combination.js | 81 -------------- dom/ipc/tests/JSProcessActor/head.js | 32 ++---- dom/ipc/tests/JSWindowActor/browser.toml | 2 - .../tests/JSWindowActor/browser_sendQuery.js | 28 ++--- .../JSWindowActor/browser_uri_combination.js | 81 -------------- dom/ipc/tests/JSWindowActor/head.js | 29 ++--- toolkit/actors/TestProcessActorChild.jsm | 59 ---------- toolkit/actors/TestProcessActorParent.jsm | 41 ------- toolkit/actors/TestWindowChild.jsm | 102 ------------------ toolkit/actors/TestWindowParent.jsm | 54 ---------- toolkit/actors/moz.build | 4 - 13 files changed, 31 insertions(+), 512 deletions(-) delete mode 100644 dom/ipc/tests/JSProcessActor/browser_uri_combination.js delete mode 100644 dom/ipc/tests/JSWindowActor/browser_uri_combination.js delete mode 100644 toolkit/actors/TestProcessActorChild.jsm delete mode 100644 toolkit/actors/TestProcessActorParent.jsm delete mode 100644 toolkit/actors/TestWindowChild.jsm delete mode 100644 toolkit/actors/TestWindowParent.jsm diff --git a/dom/ipc/tests/JSProcessActor/browser.toml b/dom/ipc/tests/JSProcessActor/browser.toml index 807b54dd8153..fdbc5721f694 100644 --- a/dom/ipc/tests/JSProcessActor/browser.toml +++ b/dom/ipc/tests/JSProcessActor/browser.toml @@ -14,5 +14,3 @@ support-files = ["head.js"] ["browser_sendAsyncMessage.js"] ["browser_sendQuery.js"] - -["browser_uri_combination.js"] diff --git a/dom/ipc/tests/JSProcessActor/browser_sendQuery.js b/dom/ipc/tests/JSProcessActor/browser_sendQuery.js index 5a9767bf3ae2..29f9c0051800 100644 --- a/dom/ipc/tests/JSProcessActor/browser_sendQuery.js +++ b/dom/ipc/tests/JSProcessActor/browser_sendQuery.js @@ -2,22 +2,10 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; -const ERROR_LINE_NUMBERS = { - jsm: 31, - "sys.mjs": 28, -}; -const EXCEPTION_LINE_NUMBERS = { - jsm: ERROR_LINE_NUMBERS.jsm + 3, - "sys.mjs": ERROR_LINE_NUMBERS["sys.mjs"] + 3, -}; -const ERROR_COLUMN_NUMBERS = { - jsm: 31, - "sys.mjs": 31, -}; -const EXCEPTION_COLUMN_NUMBERS = { - jsm: 22, - "sys.mjs": 22, -}; +const ERROR_LINE_NUMBER = 28; +const EXCEPTION_LINE_NUMBER = ERROR_LINE_NUMBER + 3; +const ERROR_COLUMN_NUMBER = 31; +const EXCEPTION_COLUMN_NUMBER = 22; function maybeAsyncStack(offset, column) { if ( @@ -39,7 +27,7 @@ function maybeAsyncStack(offset, column) { } declTest("sendQuery Error", { - async test(browser, _window, fileExt) { + async test(browser, _window) { let parent = browser.browsingContext.currentWindowGlobal.domProcess; let actorParent = parent.getActor("TestProcessActor"); @@ -52,7 +40,7 @@ declTest("sendQuery Error", { is(error.name, "SyntaxError", "Error should have the correct name"); is( error.stack, - `receiveMessage@resource://testing-common/TestProcessActorChild.${fileExt}:${ERROR_LINE_NUMBERS[fileExt]}:${ERROR_COLUMN_NUMBERS[fileExt]}\n` + + `receiveMessage@resource://testing-common/TestProcessActorChild.sys.mjs:${ERROR_LINE_NUMBER}:${ERROR_COLUMN_NUMBER}\n` + asyncStack, "Error should have the correct stack" ); @@ -60,7 +48,7 @@ declTest("sendQuery Error", { }); declTest("sendQuery Exception", { - async test(browser, _window, fileExt) { + async test(browser, _window) { let parent = browser.browsingContext.currentWindowGlobal.domProcess; let actorParent = parent.getActor("TestProcessActor"); @@ -80,7 +68,7 @@ declTest("sendQuery Exception", { ); is( error.stack, - `receiveMessage@resource://testing-common/TestProcessActorChild.${fileExt}:${EXCEPTION_LINE_NUMBERS[fileExt]}:${EXCEPTION_COLUMN_NUMBERS[fileExt]}\n` + + `receiveMessage@resource://testing-common/TestProcessActorChild.sys.mjs:${EXCEPTION_LINE_NUMBER}:${EXCEPTION_COLUMN_NUMBER}\n` + asyncStack, "Error should have the correct stack" ); diff --git a/dom/ipc/tests/JSProcessActor/browser_uri_combination.js b/dom/ipc/tests/JSProcessActor/browser_uri_combination.js deleted file mode 100644 index 33394cf54a7b..000000000000 --- a/dom/ipc/tests/JSProcessActor/browser_uri_combination.js +++ /dev/null @@ -1,81 +0,0 @@ -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"); - } -}); diff --git a/dom/ipc/tests/JSProcessActor/head.js b/dom/ipc/tests/JSProcessActor/head.js index cde193ca2e9f..773c312a5a27 100644 --- a/dom/ipc/tests/JSProcessActor/head.js +++ b/dom/ipc/tests/JSProcessActor/head.js @@ -8,23 +8,12 @@ const URL = "about:blank"; const TEST_URL = "http://test2.example.org/"; let processActorOptions = { - jsm: { - parent: { - moduleURI: "resource://testing-common/TestProcessActorParent.jsm", - }, - child: { - moduleURI: "resource://testing-common/TestProcessActorChild.jsm", - observers: ["test-js-content-actor-child-observer"], - }, + parent: { + esModuleURI: "resource://testing-common/TestProcessActorParent.sys.mjs", }, - "sys.mjs": { - parent: { - esModuleURI: "resource://testing-common/TestProcessActorParent.sys.mjs", - }, - child: { - esModuleURI: "resource://testing-common/TestProcessActorChild.sys.mjs", - observers: ["test-js-content-actor-child-observer"], - }, + child: { + esModuleURI: "resource://testing-common/TestProcessActorChild.sys.mjs", + observers: ["test-js-content-actor-child-observer"], }, }; @@ -41,11 +30,6 @@ function promiseNotification(aNotification) { } function declTest(name, cfg) { - declTestWithOptions(name, cfg, "jsm"); - declTestWithOptions(name, cfg, "sys.mjs"); -} - -function declTestWithOptions(name, cfg, fileExt) { let { url = "about:blank", includeParent = false, @@ -57,8 +41,8 @@ function declTestWithOptions(name, cfg, fileExt) { // Build the actor options object which will be used to register & unregister // our process actor. let actorOptions = { - parent: Object.assign({}, processActorOptions[fileExt].parent), - child: Object.assign({}, processActorOptions[fileExt].child), + parent: Object.assign({}, processActorOptions.parent), + child: Object.assign({}, processActorOptions.child), }; actorOptions.includeParent = includeParent; if (remoteTypes !== undefined) { @@ -77,7 +61,7 @@ function declTestWithOptions(name, cfg, fileExt) { try { await BrowserTestUtils.withNewTab(url, async browser => { info("browser ready"); - await Promise.resolve(test(browser, window, fileExt)); + await Promise.resolve(test(browser, window)); }); } finally { // Unregister the actor after the test is complete. diff --git a/dom/ipc/tests/JSWindowActor/browser.toml b/dom/ipc/tests/JSWindowActor/browser.toml index 8c812193afc3..3859ebc422fd 100644 --- a/dom/ipc/tests/JSWindowActor/browser.toml +++ b/dom/ipc/tests/JSWindowActor/browser.toml @@ -31,5 +31,3 @@ support-files = [ ["browser_sendAsyncMessage.js"] ["browser_sendQuery.js"] - -["browser_uri_combination.js"] diff --git a/dom/ipc/tests/JSWindowActor/browser_sendQuery.js b/dom/ipc/tests/JSWindowActor/browser_sendQuery.js index 0d1a845949e4..02bf77400438 100644 --- a/dom/ipc/tests/JSWindowActor/browser_sendQuery.js +++ b/dom/ipc/tests/JSWindowActor/browser_sendQuery.js @@ -2,22 +2,10 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; -const ERROR_LINE_NUMBERS = { - jsm: 39, - "sys.mjs": 36, -}; -const EXCEPTION_LINE_NUMBERS = { - jsm: ERROR_LINE_NUMBERS.jsm + 3, - "sys.mjs": ERROR_LINE_NUMBERS["sys.mjs"] + 3, -}; -const ERROR_COLUMN_NUMBERS = { - jsm: 31, - "sys.mjs": 31, -}; -const EXCEPTION_COLUMN_NUMBERS = { - jsm: 22, - "sys.mjs": 22, -}; +const ERROR_LINE_NUMBER = 36; +const EXCEPTION_LINE_NUMBER = ERROR_LINE_NUMBER + 3; +const ERROR_COLUMN_NUMBER = 31; +const EXCEPTION_COLUMN_NUMBER = 22; function maybeAsyncStack(offset, column) { if ( @@ -39,7 +27,7 @@ function maybeAsyncStack(offset, column) { } declTest("sendQuery Error", { - async test(browser, _window, fileExt) { + async test(browser, _window) { let parent = browser.browsingContext.currentWindowGlobal; let actorParent = parent.getActor("TestWindow"); @@ -52,7 +40,7 @@ declTest("sendQuery Error", { is(error.name, "SyntaxError", "Error should have the correct name"); is( error.stack, - `receiveMessage@resource://testing-common/TestWindowChild.${fileExt}:${ERROR_LINE_NUMBERS[fileExt]}:${ERROR_COLUMN_NUMBERS[fileExt]}\n` + + `receiveMessage@resource://testing-common/TestWindowChild.sys.mjs:${ERROR_LINE_NUMBER}:${ERROR_COLUMN_NUMBER}\n` + asyncStack, "Error should have the correct stack" ); @@ -60,7 +48,7 @@ declTest("sendQuery Error", { }); declTest("sendQuery Exception", { - async test(browser, _window, fileExt) { + async test(browser, _window) { let parent = browser.browsingContext.currentWindowGlobal; let actorParent = parent.getActor("TestWindow"); @@ -80,7 +68,7 @@ declTest("sendQuery Exception", { ); is( error.stack, - `receiveMessage@resource://testing-common/TestWindowChild.${fileExt}:${EXCEPTION_LINE_NUMBERS[fileExt]}:${EXCEPTION_COLUMN_NUMBERS[fileExt]}\n` + + `receiveMessage@resource://testing-common/TestWindowChild.sys.mjs:${EXCEPTION_LINE_NUMBER}:${EXCEPTION_COLUMN_NUMBER}\n` + asyncStack, "Error should have the correct stack" ); diff --git a/dom/ipc/tests/JSWindowActor/browser_uri_combination.js b/dom/ipc/tests/JSWindowActor/browser_uri_combination.js deleted file mode 100644 index ce46a3e3b61a..000000000000 --- a/dom/ipc/tests/JSWindowActor/browser_uri_combination.js +++ /dev/null @@ -1,81 +0,0 @@ -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"); - } -}); diff --git a/dom/ipc/tests/JSWindowActor/head.js b/dom/ipc/tests/JSWindowActor/head.js index cfabd40aac6c..60f6bd9decd9 100644 --- a/dom/ipc/tests/JSWindowActor/head.js +++ b/dom/ipc/tests/JSWindowActor/head.js @@ -8,30 +8,15 @@ const URL = "about:blank"; const TEST_URL = "http://test2.example.org/"; let windowActorOptions = { - jsm: { - parent: { - moduleURI: "resource://testing-common/TestWindowParent.jsm", - }, - child: { - moduleURI: "resource://testing-common/TestWindowChild.jsm", - }, + parent: { + esModuleURI: "resource://testing-common/TestWindowParent.sys.mjs", }, - "sys.mjs": { - parent: { - esModuleURI: "resource://testing-common/TestWindowParent.sys.mjs", - }, - child: { - esModuleURI: "resource://testing-common/TestWindowChild.sys.mjs", - }, + child: { + esModuleURI: "resource://testing-common/TestWindowChild.sys.mjs", }, }; function declTest(name, cfg) { - declTestWithOptions(name, cfg, "jsm"); - declTestWithOptions(name, cfg, "sys.mjs"); -} - -function declTestWithOptions(name, cfg, fileExt) { let { url = "about:blank", allFrames = false, @@ -47,8 +32,8 @@ function declTestWithOptions(name, cfg, fileExt) { // Build the actor options object which will be used to register & unregister // our window actor. let actorOptions = { - parent: { ...windowActorOptions[fileExt].parent }, - child: { ...windowActorOptions[fileExt].child, events, observers }, + parent: { ...windowActorOptions.parent }, + child: { ...windowActorOptions.child, events, observers }, }; actorOptions.allFrames = allFrames; actorOptions.includeChrome = includeChrome; @@ -71,7 +56,7 @@ function declTestWithOptions(name, cfg, fileExt) { try { await BrowserTestUtils.withNewTab(url, async browser => { info("browser ready"); - await Promise.resolve(test(browser, window, fileExt)); + await Promise.resolve(test(browser, window)); }); } finally { // Unregister the actor after the test is complete. diff --git a/toolkit/actors/TestProcessActorChild.jsm b/toolkit/actors/TestProcessActorChild.jsm deleted file mode 100644 index 20b738262478..000000000000 --- a/toolkit/actors/TestProcessActorChild.jsm +++ /dev/null @@ -1,59 +0,0 @@ -/* vim: set ts=2 sw=2 sts=2 et tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -"use strict"; - -var EXPORTED_SYMBOLS = ["TestProcessActorChild"]; - -class TestProcessActorChild extends JSProcessActorChild { - constructor() { - super(); - this.sawActorCreated = false; - } - - actorCreated() { - this.sawActorCreated = true; - } - - receiveMessage(aMessage) { - switch (aMessage.name) { - case "toChild": - aMessage.data.toChild = true; - this.sendAsyncMessage("toParent", aMessage.data); - break; - case "asyncAdd": - let { a, b } = aMessage.data; - return new Promise(resolve => { - resolve({ result: a + b }); - }); - case "error": - return Promise.reject(new SyntaxError(aMessage.data.message)); - case "exception": - return Promise.reject( - Components.Exception(aMessage.data.message, aMessage.data.result) - ); - case "done": - this.done(aMessage.data); - break; - } - - return undefined; - } - - observe(subject, topic, data) { - this.lastObserved = { subject, topic, data }; - } - - show() { - return "TestProcessActorChild"; - } - - didDestroy() { - Services.obs.notifyObservers( - this, - "test-js-content-actor-diddestroy", - true - ); - } -} diff --git a/toolkit/actors/TestProcessActorParent.jsm b/toolkit/actors/TestProcessActorParent.jsm deleted file mode 100644 index dfa1fc1df0e9..000000000000 --- a/toolkit/actors/TestProcessActorParent.jsm +++ /dev/null @@ -1,41 +0,0 @@ -/* vim: set ts=2 sw=2 sts=2 et tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -"use strict"; - -var EXPORTED_SYMBOLS = ["TestProcessActorParent"]; - -class TestProcessActorParent extends JSProcessActorParent { - constructor() { - super(); - this.wrappedJSObject = this; - this.sawActorCreated = false; - } - - actorCreated() { - this.sawActorCreated = true; - } - - receiveMessage(aMessage) { - switch (aMessage.name) { - case "init": - aMessage.data.initial = true; - this.sendAsyncMessage("toChild", aMessage.data); - break; - case "toParent": - aMessage.data.toParent = true; - this.sendAsyncMessage("done", aMessage.data); - break; - case "asyncMul": - let { a, b } = aMessage.data; - return { result: a * b }; - } - - return undefined; - } - - show() { - return "TestProcessActorParent"; - } -} diff --git a/toolkit/actors/TestWindowChild.jsm b/toolkit/actors/TestWindowChild.jsm deleted file mode 100644 index 127c03fa0eb2..000000000000 --- a/toolkit/actors/TestWindowChild.jsm +++ /dev/null @@ -1,102 +0,0 @@ -/* vim: set ts=2 sw=2 sts=2 et tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -"use strict"; - -var EXPORTED_SYMBOLS = ["TestWindowChild"]; - -var docShellThunks = new Map(); - -class TestWindowChild extends JSWindowActorChild { - constructor() { - super(); - this.sawActorCreated = false; - - try { - void this.contentWindow; - } catch (e) { - this.uninitializedGetterError = e; - } - } - - actorCreated() { - this.sawActorCreated = true; - } - - receiveMessage(aMessage) { - switch (aMessage.name) { - case "toChild": - aMessage.data.toChild = true; - this.sendAsyncMessage("toParent", aMessage.data); - break; - case "asyncAdd": - let { a, b } = aMessage.data; - return new Promise(resolve => { - resolve({ result: a + b }); - }); - case "error": - return Promise.reject(new SyntaxError(aMessage.data.message)); - case "exception": - return Promise.reject( - Components.Exception(aMessage.data.message, aMessage.data.result) - ); - case "done": - this.done(aMessage.data); - break; - case "noncloneReply": - // Return a value which is non-cloneable, like a WindowProxy. - return this.contentWindow; - case "storeActor": - docShellThunks.set(this.docShell, this); - break; - case "checkActor": { - let actor = docShellThunks.get(this.docShell); - docShellThunks.delete(this.docShell); - - let contentWindow; - let error; - try { - contentWindow = actor.contentWindow; - } catch (e) { - error = e; - } - if (error) { - return { - status: "error", - errorType: error.name, - }; - } - return { - status: "success", - valueIsNull: contentWindow === null, - }; - } - } - - return undefined; - } - - handleEvent(aEvent) { - this.sendAsyncMessage("event", { type: aEvent.type }); - } - - observe(subject, topic, data) { - switch (topic) { - case "audio-playback": - this.done({ subject, topic, data }); - break; - default: - this.lastObserved = { subject, topic, data }; - break; - } - } - - show() { - return "TestWindowChild"; - } - - didDestroy() { - Services.obs.notifyObservers(this, "test-js-window-actor-diddestroy", true); - } -} diff --git a/toolkit/actors/TestWindowParent.jsm b/toolkit/actors/TestWindowParent.jsm deleted file mode 100644 index 8a504737d773..000000000000 --- a/toolkit/actors/TestWindowParent.jsm +++ /dev/null @@ -1,54 +0,0 @@ -/* vim: set ts=2 sw=2 sts=2 et tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -"use strict"; - -var EXPORTED_SYMBOLS = ["TestWindowParent"]; - -class TestWindowParent extends JSWindowActorParent { - constructor() { - super(); - this.wrappedJSObject = this; - this.sawActorCreated = false; - } - - actorCreated() { - this.sawActorCreated = true; - } - - receiveMessage(aMessage) { - switch (aMessage.name) { - case "init": - aMessage.data.initial = true; - this.sendAsyncMessage("toChild", aMessage.data); - break; - case "toParent": - aMessage.data.toParent = true; - this.sendAsyncMessage("done", aMessage.data); - break; - case "asyncMul": - let { a, b } = aMessage.data; - return { result: a * b }; - - case "event": - Services.obs.notifyObservers( - this, - "test-js-window-actor-parent-event", - aMessage.data.type - ); - break; - case "messagePort": { - const { port } = aMessage.data; - port.postMessage("Message sent from parent over a MessagePort."); - port.close(); - } - } - - return undefined; - } - - show() { - return "TestWindowParent"; - } -} diff --git a/toolkit/actors/moz.build b/toolkit/actors/moz.build index 21c2cb7dc909..9b5d83e11a23 100644 --- a/toolkit/actors/moz.build +++ b/toolkit/actors/moz.build @@ -22,13 +22,9 @@ with Files("PictureInPictureChild.sys.mjs"): SPHINX_TREES["actors"] = "docs" TESTING_JS_MODULES += [ - "TestProcessActorChild.jsm", "TestProcessActorChild.sys.mjs", - "TestProcessActorParent.jsm", "TestProcessActorParent.sys.mjs", - "TestWindowChild.jsm", "TestWindowChild.sys.mjs", - "TestWindowParent.jsm", "TestWindowParent.sys.mjs", ]