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