Backed out changeset f594e6f00208 (bug 1940883) for causing crashes in bug 1941164.
[gecko.git] / dom / network / tests / test_network_basics_worker.html
blob5763ee361b92378bad46fd65f864964bab198880
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test for Network in workers API</title>
5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
7 </head>
8 <body>
9 <p id="display"></p>
10 <div id="content" style="display: none">
11 </div>
12 <pre id="test">
13 <script type="application/javascript">
15 /** Test for Network Information API **/
16 function test() {
17 let w = new Worker('worker_network_basics.js');
18 w.onmessage = function(e) {
19 if (e.data.type == 'status') {
20 ok(e.data.status, e.data.msg);
21 } else if (e.data.type == 'finish') {
22 SimpleTest.finish();
23 } else {
24 ok(false, "Unknown message type");
29 SimpleTest.waitForExplicitFinish();
30 SpecialPowers.pushPrefEnv({'set': [["dom.netinfo.enabled", true]]}, test);
32 </script>
33 </pre>
34 </body>
35 </html>