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"/>
10 <div id=
"content" style=
"display: none">
13 <script type=
"application/javascript">
15 /** Test for Network Information API **/
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");
32 SimpleTest.waitForExplicitFinish();
33 SpecialPowers.pushPrefEnv({'set': [[
"dom.netinfo.enabled", true]]}, test);