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

Side by Side 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: Update test expectations 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <head> 2 <head>
3 <script src="../resources/js-test.js"></script> 3 <script src="../resources/js-test.js"></script>
4 <script src="resources/netinfo_common.js"></script> 4 <script src="resources/netinfo_common.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 description('Tests the basic operation of NetInfo.'); 8 description('Tests the basic operation of NetInfo.');
9 9
10 shouldBe('typeof window.internals.observeGC', '"function"', 10 shouldBe('typeof window.internals.observeGC', '"function"',
11 'this test requires window.internals'); 11 'this test requires window.internals');
12 12
13 shouldBeDefined("navigator.connection"); 13 shouldBeDefined("navigator.connection");
14 shouldBeDefined("navigator.connection.type"); 14 shouldBeDefined("navigator.connection.type");
15 shouldBeDefined("navigator.connection.downlinkMax");
15 16
16 connection.addEventListener('typechange', function(e) { 17 connection.addEventListener('typechange', function(e) {
17 shouldBe("typeof connection.type", '"string"'); 18 shouldBe("typeof connection.type", '"string"');
18 shouldBe('connection.type', 'newConnectionType'); 19 shouldBe('connection.type', 'newConnectionType');
20 shouldBe('connection.downlinkMax', 'newDownlinkMax');
19 finishJSTest(); 21 finishJSTest();
20 }); 22 });
21 23
22 internals.setNetworkConnectionInfo(newConnectionType); 24 connection.addEventListener('change', function(e) {
25 shouldBe("typeof connection.type", '"string"');
26 shouldBe('connection.type', 'newConnectionType');
27 shouldBe('connection.downlinkMax', 'newDownlinkMax');
28 finishJSTest();
29 });
30
31 internals.setNetworkConnectionInfo(newConnectionType, newDownlinkMax);
23 32
24 </script> 33 </script>
25 </body> 34 </body>
26 </html> 35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698