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

Unified Diff: LayoutTests/netinfo/connection-types.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
« no previous file with comments | « LayoutTests/netinfo/basic-operation-expected.txt ('k') | LayoutTests/netinfo/connection-types-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/netinfo/connection-types.html
diff --git a/LayoutTests/netinfo/connection-types.html b/LayoutTests/netinfo/connection-types.html
index e3353586c4f33faa99ac2db8b019772d4aaec777..896e103143576a156eb29f7268ce4ac08d2a8d09 100644
--- a/LayoutTests/netinfo/connection-types.html
+++ b/LayoutTests/netinfo/connection-types.html
@@ -11,24 +11,34 @@ if (!window.internals)
log("This test requires window.internals");
var types = [
- 'cellular',
- 'bluetooth',
- 'ethernet',
- 'wifi',
- 'other',
- 'none',
- 'unknown'
+ ['cellular', 1.0],
+ ['bluetooth', 2.0],
+ ['ethernet', 3.0],
+ ['wifi', 4.0],
+ ['wimax', 5.0],
+ ['other', 6.0],
+ ['none', 7.0],
+ ['unknown', 8.0]
];
-var count = 0;
+// ontypechange is deprecated but this test is here to
+// verify that it still works until it is removed.
connection.addEventListener('typechange', function(e) {
- shouldBe('connection.type', 'types[count]');
+ shouldBe('connection.type', 'types[count][0]');
+ shouldBe('connection.downlinkMax', 'types[count][1]');
+});
+
+var count = 0;
+connection.addEventListener('change', function(e) {
+ shouldBe('connection.type', 'types[count][0]');
+ shouldBe('connection.downlinkMax', 'types[count][1]');
+
if (++count === types.length)
finishJSTest();
});
for(var i = 0; i < types.length; i++)
- internals.setNetworkConnectionInfo(types[i]);
+ internals.setNetworkConnectionInfo(types[i][0], types[i][1]);
</script>
</body>
« no previous file with comments | « LayoutTests/netinfo/basic-operation-expected.txt ('k') | LayoutTests/netinfo/connection-types-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698