Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <head> | |
| 3 <script src="../resources/js-test.js"></script> | |
| 4 <script src="resources/netinfo_common.js"></script> | |
| 5 </head> | |
| 6 <body> | |
| 7 <script> | |
| 8 description('Tests that all rtt and downlink is exposed correctly.'); | |
| 9 | |
| 10 if (!window.internals) | |
| 11 log("This test requires window.internals"); | |
| 12 | |
| 13 var values = [ | |
| 14 ["slow-2g", 25.0, 2.0, "slow-2g", 25.0, 2.0], | |
| 15 ["slow-2g", 40.0, 2.0, "slow-2g", 50.0, 2.0], | |
| 16 ["slow-2g", 40.0, 0.0, "slow-2g", 50.0, 0.0], | |
| 17 ["slow-2g", 40.0, 0.125, "slow-2g", 50.0, 0.125], | |
| 18 ["slow-2g", 40.0, 0.103, "slow-2g", 50.0, 0.1], | |
| 19 ["slow-2g", 40.0, 0.123, "slow-2g", 50.0, 0.125], | |
| 20 ["2g", 40.0, 0.123, "2g", 50.0, 0.125], | |
| 21 ["3g", 40.0, 0.123, "3g", 50.0, 0.125], | |
| 22 ["3g", 10.0, 0.123, "3g", 0.0, 0.125], | |
| 23 ]; | |
| 24 | |
| 25 var count = 0; | |
| 26 connection.addEventListener('change', function(e) { | |
| 27 shouldBe('connection.effectiveType', 'values[count][3]'); | |
| 28 shouldBe('connection.rtt', 'values[count][4]'); | |
| 29 shouldBe('connection.downlink', 'values[count][5]'); | |
| 30 | |
| 31 if (++count === values.length) | |
| 32 finishJSTest(); | |
| 33 }); | |
| 34 | |
| 35 for(var i = 0; i < values.length; i++) | |
| 36 internals.setNetworkQualityInfoOverride(values[i][0], values[i][1], values[i][ 2]); | |
|
foolip
2017/05/31 14:31:16
I haven't looked at the whole CL, but at least thi
| |
| 37 | |
| 38 </script> | |
| 39 </body> | |
| 40 </html> | |
| OLD | NEW |