| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
| 3 <title>NetInfo basic functionality</title> | 3 <title>NetInfo basic functionality</title> |
| 4 <link rel="help" href="https://wicg.github.io/netinfo/"> | 4 <link rel="help" href="https://wicg.github.io/netinfo/"> |
| 5 <script src="/resources/testharness.js"></script> | 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> | 6 <script src="/resources/testharnessreport.js"></script> |
| 7 | 7 |
| 8 <script> | 8 <script> |
| 9 test(function() { | 9 test(function() { |
| 10 assert_in_array(navigator.connection.type, ["bluetooth", "cellular", | 10 assert_in_array(navigator.connection.type, ["bluetooth", "cellular", |
| 11 "ethernet", "mixed", "none", "other", "unknown", "wifi", "wimax"], 'type
is unexpected'); | 11 "ethernet", "mixed", "none", "other", "unknown", "wifi", "wimax"], 'type
is unexpected'); |
| 12 }); | 12 }, "type attribute"); |
| 13 | 13 |
| 14 test(function() { | 14 test(function() { |
| 15 assert_greater_than_equal(navigator.connection.downlinkMax, 0); | 15 assert_greater_than_equal(navigator.connection.downlinkMax, 0); |
| 16 }); | 16 }, "downlinkMax attribute"); |
| 17 | 17 |
| 18 test(function() { | 18 test(function() { |
| 19 assert_in_array(navigator.connection.effectiveType, ["slow-2g", "2g", | 19 assert_in_array(navigator.connection.effectiveType, ["slow-2g", "2g", |
| 20 "3g", "4g"], 'effectiveType is unexpected'); | 20 "3g", "4g"], 'effectiveType is unexpected'); |
| 21 }); | 21 }, "effectiveType attribute"); |
| 22 | 22 |
| 23 test(function() { | 23 test(function() { |
| 24 assert_greater_than_equal(navigator.connection.rtt, 0); | 24 assert_greater_than_equal(navigator.connection.rtt, 0); |
| 25 assert_equals(navigator.connection.rtt % 25, 0, | 25 assert_equals(navigator.connection.rtt % 25, 0, |
| 26 'rtt must be a multiple of 25 msec'); | 26 'rtt must be a multiple of 25 msec'); |
| 27 }); | 27 }, "rtt attribute"); |
| 28 | 28 |
| 29 test(function() { | 29 test(function() { |
| 30 assert_greater_than_equal(navigator.connection.downlink, 0); | 30 assert_greater_than_equal(navigator.connection.downlink, 0); |
| 31 var downlink = navigator.connection.downlink ; | 31 var downlink = navigator.connection.downlink ; |
| 32 assert_equals(((downlink - Math.floor(downlink)) *1000) % 25, 0, | 32 assert_equals(((downlink - Math.floor(downlink)) *1000) % 25, 0, |
| 33 'downlink must be a multiple of 25 kbps'); | 33 'downlink must be a multiple of 25 kbps'); |
| 34 }); | 34 }, "downlink attribute"); |
| 35 </script> | 35 </script> |
| OLD | NEW |