1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 add_task(async function testInWorker() {
6 const worker = new ChromeWorker("resource://test/contextual_worker.js");
7 const { promise, resolve } = Promise.withResolvers();
8 worker.onmessage = event => {
11 worker.postMessage("");
13 const result = await promise;
15 Assert.ok(result.equal1);
16 Assert.ok(result.equal2);