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 testSharedInWorker() {
6 // Loading into shared global isn't allowed in worker.
8 let worker = new ChromeWorker("resource://test/import_shared_in_worker.js");
9 let { promise, resolve } = Promise.withResolvers();
10 worker.onmessage = event => {
13 worker.postMessage("");
15 const result = await promise;
17 Assert.equal(result.caught1, true);
18 Assert.equal(result.caught2, true);
19 Assert.equal(result.caught3, true);