dom/network/tests/test_networkstats_disabled.html

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:f3567814fd29
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test to ensure NetworkStats is not accessible when it is disabled</title>
5 <script type="application/javascript" 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">
14
15 "use strict";
16
17 SimpleTest.waitForExplicitFinish();
18
19 // Test to ensure NetworkStats is not accessible when it is disabled
20 SpecialPowers.pushPrefEnv({'set': [["dom.mozNetworkStats.enabled", false]]}, function(){
21
22 ok('mozNetworkStats' in navigator, "navigator.mozNetworkStats should exist");
23 is(navigator.mozNetworkStats, null, "mozNetworkStats should be null when not enabled.");
24
25 SimpleTest.finish();
26 });
27
28 </script>
29 </pre>
30 </body>
31 </html>

mercurial