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 | 8 |
9 // Suppress connection messages information from the host. | 9 // Suppress connection messages information from the host. |
10 if (window.internals) { | 10 if (window.internals) { |
11 internals.setNetworkStateNotifierTestOnly(true); | 11 internals.setNetworkConnectionInfoOverride(true, initialType, initialDownlin
kMax); |
12 internals.setNetworkConnectionInfo(initialType, initialDownlinkMax); | |
13 | 12 |
14 // Reset the state of the singleton network state notifier. | 13 // Reset the state of the singleton network state notifier. |
15 window.addEventListener('beforeunload', function() { | 14 window.addEventListener('beforeunload', function() { |
16 internals.setNetworkStateNotifierTestOnly(false); | 15 internals.clearNetworkConnectionInfoOverride(); |
17 }, false); | 16 }, false); |
18 } | 17 } |
19 | 18 |
| 19 function isTypeOnline(type) { |
| 20 return type != 'none'; |
| 21 } |
OLD | NEW |