Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: LayoutTests/netinfo/basic-operation.html

Issue 1308943005: [NetInfo] Add Blink support for connection.change, connection.downlinkMax, and wimax (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698