diff options
Diffstat (limited to 'dom/base/crashtests/eventSource_invalid_scheme_worker_shutdown.html')
-rw-r--r-- | dom/base/crashtests/eventSource_invalid_scheme_worker_shutdown.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/dom/base/crashtests/eventSource_invalid_scheme_worker_shutdown.html b/dom/base/crashtests/eventSource_invalid_scheme_worker_shutdown.html new file mode 100644 index 0000000000..731392d83d --- /dev/null +++ b/dom/base/crashtests/eventSource_invalid_scheme_worker_shutdown.html @@ -0,0 +1,36 @@ +<html class="reftest-wait"> + <head> + <script type="text/javascript"> + const workerURL = "1614339-worker.js"; + + const Cc = SpecialPowers.Cc; + const Ci = SpecialPowers.Ci; + const wdm = Cc["@mozilla.org/dom/workers/workerdebuggermanager;1"] + .getService(Ci.nsIWorkerDebuggerManager); + + function waitForUnregister() { + return new Promise(function(resolve) { + wdm.addListener({ + onUnregister(dbg) { + if (dbg.url !== workerURL) { + return; + } + wdm.removeListener(this); + resolve(); + }, + }); + }); + } + + function boom() { + const worker = new Worker(workerURL); + waitForUnregister().then(function() { + document.documentElement.classList.remove("reftest-wait"); + }); + worker.postMessage("Start"); + } + </script> + </head> + <body onload="boom();"></body> +</html> + |