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 --- .../xpcshell/data/TestWorkerWatcherParent.sys.mjs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 toolkit/components/extensions/test/xpcshell/data/TestWorkerWatcherParent.sys.mjs (limited to 'toolkit/components/extensions/test/xpcshell/data/TestWorkerWatcherParent.sys.mjs') diff --git a/toolkit/components/extensions/test/xpcshell/data/TestWorkerWatcherParent.sys.mjs b/toolkit/components/extensions/test/xpcshell/data/TestWorkerWatcherParent.sys.mjs new file mode 100644 index 0000000000..a9d919f1ed --- /dev/null +++ b/toolkit/components/extensions/test/xpcshell/data/TestWorkerWatcherParent.sys.mjs @@ -0,0 +1,20 @@ +export class TestWorkerWatcherParent extends JSProcessActorParent { + constructor() { + super(); + // This is set by the test helper that does use these process actors. + this.eventEmitter = null; + } + + receiveMessage(msg) { + switch (msg.name) { + case "Test:WorkerSpawned": + this.eventEmitter?.emit("worker-spawned", msg.data); + break; + case "Test:WorkerTerminated": + this.eventEmitter?.emit("worker-terminated", msg.data); + break; + default: + throw new Error(`Unexpected message received: ${msg.name}`); + } + } +} -- cgit v1.2.3