Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / js / xpconnect / tests / mochitest / test_finalizationRegistryInWorker.html
blob8393781ce1e18151c7391a510084408582f5d563
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>Test FinalizationRegistry works in workers</title>
6 <script src="/tests/SimpleTest/SimpleTest.js"></script>
7 <script type="application/javascript">
8 function go() {
9 SimpleTest.waitForExplicitFinish();
11 let worker = new Worker('finalizationRegistry_worker.js');
13 worker.onevent = (event) => {
14 console.log(event.message);
15 throw event.error;
18 worker.onmessage = (event) => {
19 switch (event.data) {
20 case 'started':
21 worker.postMessage('checkResults');
22 break;
24 case 'passed':
25 ok(true, "Tests passed");
26 SimpleTest.finish();
27 break;
29 default:
30 console.log(event.data);
31 break;
35 worker.postMessage('startTest');
37 </script>
38 </head>
39 <body onload="go()"></body>
40 </html>