Bug 1941046 - Part 4: Send a callback request for impression and clicks of MARS Top...
[gecko.git] / dom / network / tests / test_network_basics.html
blobe657af916d03defeb048ee2afcdb74ab23842168
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test for Network 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 ok('connection' in navigator, "navigator.connection should exist");
19 ok(navigator.connection, "navigator.connection returns an object");
21 ok(navigator.connection instanceof EventTarget,
22 "navigator.connection is a EventTarget object");
24 ok('type' in navigator.connection,
25 "type should be a Connection attribute");
26 is(navigator.connection.type, "none",
27 "By default connection.type equals to none");
29 SimpleTest.finish();
32 SimpleTest.waitForExplicitFinish();
33 SpecialPowers.pushPrefEnv({'set': [["dom.netinfo.enabled", true]]}, test);
35 </script>
36 </pre>
37 </body>
38 </html>