| 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.setNetworkStateNotifierTestOnly(true); |
| 12 internals.setNetworkConnectionInfo(initialType, initialDownlinkMax); | 12 internals.setNetworkConnectionInfo(initialType, initialDownlinkMax); |
| 13 |
| 14 // Reset the state of the singleton network state notifier. |
| 15 window.addEventListener('beforeunload', function() { |
| 16 internals.setNetworkStateNotifierTestOnly(false); |
| 17 }, false); |
| 13 } | 18 } |
| 14 | 19 |
| OLD | NEW |