| OLD | NEW |
| 1 window.jsTestIsAsync = true; | 1 window.jsTestIsAsync = true; |
| 2 | 2 |
| 3 var connection = navigator.connection; | 3 var connection = navigator.connection; |
| 4 var initialType = "bluetooth"; | 4 var initialType = "bluetooth"; |
| 5 var initialDownlinkMax = 1.0; | 5 var initialDownlinkMax = 1.0; |
| 6 var newConnectionType = "ethernet"; | 6 var newConnectionType = "ethernet"; |
| 7 var newDownlinkMax = 2.0; | 7 var newDownlinkMax = 2.0; |
| 8 var initialEffectiveType = "3g"; |
| 9 var initialRtt = 25.0; |
| 10 var initialDownlink = 10.0; |
| 11 var newEffectiveType = "4g"; |
| 12 var newRtt = 50.0; |
| 13 var newDownlink = 30.0; |
| 8 | 14 |
| 9 // Suppress connection messages information from the host. | 15 // Suppress connection messages information from the host. |
| 10 if (window.internals) { | 16 if (window.internals) { |
| 11 internals.setNetworkConnectionInfoOverride(true, initialType, initialDownlin
kMax); | 17 internals.setNetworkConnectionInfoOverride(true, initialType, initialDownlin
kMax); |
| 18 internals.setNetworkQualityInfoOverride(initialEffectiveType, initialRtt, in
itialDownlink); |
| 12 | 19 |
| 13 // Reset the state of the singleton network state notifier. | 20 // Reset the state of the singleton network state notifier. |
| 14 window.addEventListener('beforeunload', function() { | 21 window.addEventListener('beforeunload', function() { |
| 15 internals.clearNetworkConnectionInfoOverride(); | 22 internals.clearNetworkConnectionInfoOverride(); |
| 16 }, false); | 23 }, false); |
| 17 } | 24 } |
| 18 | 25 |
| 19 function isTypeOnline(type) { | 26 function isTypeOnline(type) { |
| 20 return type != 'none'; | 27 return type != 'none'; |
| 21 } | 28 } |
| OLD | NEW |