Index: LayoutTests/netinfo/basic-operation.html |
diff --git a/LayoutTests/netinfo/basic-operation.html b/LayoutTests/netinfo/basic-operation.html |
index 3809b807f3c4222d4b04dab983163c20a033466a..037e9cbeef0cd28e348fefbab592ee478b6a85bc 100644 |
--- a/LayoutTests/netinfo/basic-operation.html |
+++ b/LayoutTests/netinfo/basic-operation.html |
@@ -12,14 +12,26 @@ shouldBe('typeof window.internals.observeGC', '"function"', |
shouldBeDefined("navigator.connection"); |
shouldBeDefined("navigator.connection.type"); |
+shouldBeDefined("navigator.connection.downlinkMax"); |
-connection.addEventListener('typechange', function(e) { |
+var typeChangeListener = function(e) { |
shouldBe("typeof connection.type", '"string"'); |
- shouldBe('connection.type', 'newConnectionType'); |
+ shouldBe('connection.type', 'initialType'); |
+ shouldBe('connection.downlinkMax', 'initialDownlinkMax'); |
finishJSTest(); |
-}); |
+} |
+ |
+var changeListener = function(e) { |
+ shouldBe("typeof connection.type", '"string"'); |
+ shouldBe('connection.type', 'newConnectionType'); |
+ shouldBe('connection.downlinkMax', 'newDownlinkMax'); |
+ connection.removeEventListener('change', changeListener); |
+ connection.addEventListener('typechange', typeChangeListener); |
+ internals.setNetworkConnectionInfo(initialType, initialDownlinkMax); |
+} |
-internals.setNetworkConnectionInfo(newConnectionType); |
+connection.addEventListener('change', changeListener); |
+internals.setNetworkConnectionInfo(newConnectionType, newDownlinkMax); |
</script> |
</body> |