Backed out changeset 06f41c22f3a6 (bug 1888460) for causing linux xpcshell failures...
[gecko.git] / dom / workers / test / test_importScripts_2.html
blobf40b9a64ed9fd2c82317e7164110996f1110e22a
1 <head>
2 <title>Test for Worker importScripts</title>
3 <script src="/tests/SimpleTest/SimpleTest.js"></script>
4 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
5 </head>
6 <body>
7 <script id="worker" type="javascript/worker">
8 onmessage = async function(msg) {
9 try {
10 self.importScripts("N:", "");
11 } catch (ex) {
12 postMessage("done");
16 </script>
17 <script>
18 SimpleTest.waitForExplicitFinish();
19 document.addEventListener("DOMContentLoaded", async () => {
20 const blob = new Blob([document.querySelector('#worker').textContent],
21 {type: "text/javascript"});
22 const worker = new Worker(window.URL.createObjectURL(blob));
23 worker.postMessage([], []);
24 worker.onmessage = function(e) {
25 if (e.data == "done") {
26 ok(true);
27 SimpleTest.finish();
30 });
31 </script>
32 </pre>
33 </body>
34 </html>