eventSource_invalid_scheme_worker_shutdown.html (1143B)
1 <html class="reftest-wait"> 2 <head> 3 <script type="text/javascript"> 4 const workerURL = "1614339-worker.js"; 5 6 const Cc = SpecialPowers.Cc; 7 const Ci = SpecialPowers.Ci; 8 const wdm = Cc["@mozilla.org/dom/workers/workerdebuggermanager;1"] 9 .getService(Ci.nsIWorkerDebuggerManager); 10 11 function waitForUnregister() { 12 return new Promise(function(resolve) { 13 wdm.addListener({ 14 onUnregister(dbg) { 15 if (dbg.url !== workerURL) { 16 return; 17 } 18 wdm.removeListener(this); 19 resolve(); 20 }, 21 }); 22 }); 23 } 24 25 function boom() { 26 const worker = new Worker(workerURL); 27 waitForUnregister().then(function() { 28 document.documentElement.classList.remove("reftest-wait"); 29 }); 30 worker.postMessage("Start"); 31 } 32 </script> 33 </head> 34 <body onload="boom();"></body> 35 </html>