1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/network/tests/test_network_basics.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<head> 1.7 + <title>Test for Network API</title> 1.8 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.9 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.10 +</head> 1.11 +<body> 1.12 +<p id="display"></p> 1.13 +<div id="content" style="display: none"> 1.14 +</div> 1.15 +<pre id="test"> 1.16 +<script type="application/javascript"> 1.17 + 1.18 +/** Test for Network Information API **/ 1.19 +function test() { 1.20 + ok('connection' in navigator, "navigator.connection should exist"); 1.21 + 1.22 + ok(navigator.connection, "navigator.connection returns an object"); 1.23 + 1.24 + ok(navigator.connection instanceof EventTarget, 1.25 + "navigator.connection is a EventTarget object"); 1.26 + 1.27 + ok('type' in navigator.connection, 1.28 + "type should be a Connection attribute"); 1.29 + is(navigator.connection.type, "none", 1.30 + "By default connection.type equals to none"); 1.31 + 1.32 + SimpleTest.finish(); 1.33 +} 1.34 + 1.35 +SimpleTest.waitForExplicitFinish(); 1.36 +SpecialPowers.pushPrefEnv({'set': [["dom.netinfo.enabled", true]]}, test); 1.37 + 1.38 +</script> 1.39 +</pre> 1.40 +</body> 1.41 +</html>