Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / js / xpconnect / tests / unit / test_import_global_worker.js
blob9000358b67abb0b0aa61d4ed11d003b41a98ab2e
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 => {
11     resolve(event.data);
12   };
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);
20 });