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

Side by Side 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 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 that all connection types of NetInfo are supported.'); 8 description('Tests that all connection types of NetInfo are supported.');
9 9
10 if (!window.internals) 10 if (!window.internals)
11 log("This test requires window.internals"); 11 log("This test requires window.internals");
12 12
13 var types = [ 13 var types = [
14 'cellular', 14 ['cellular', 1.0],
15 'bluetooth', 15 ['bluetooth', 2.0],
16 'ethernet', 16 ['ethernet', 3.0],
17 'wifi', 17 ['wifi', 4.0],
18 'other', 18 ['wimax', 5.0],
19 'none', 19 ['other', 6.0],
20 'unknown' 20 ['none', 7.0],
21 ['unknown', 8.0]
21 ]; 22 ];
22 23
24 // ontypechange is deprecated but this test is here to
25 // verify that it still works until it is removed.
26 connection.addEventListener('typechange', function(e) {
27 shouldBe('connection.type', 'types[count][0]');
28 shouldBe('connection.downlinkMax', 'types[count][1]');
29 });
30
23 var count = 0; 31 var count = 0;
24 connection.addEventListener('typechange', function(e) { 32 connection.addEventListener('change', function(e) {
25 shouldBe('connection.type', 'types[count]'); 33 shouldBe('connection.type', 'types[count][0]');
34 shouldBe('connection.downlinkMax', 'types[count][1]');
35
26 if (++count === types.length) 36 if (++count === types.length)
27 finishJSTest(); 37 finishJSTest();
28 }); 38 });
29 39
30 for(var i = 0; i < types.length; i++) 40 for(var i = 0; i < types.length; i++)
31 internals.setNetworkConnectionInfo(types[i]); 41 internals.setNetworkConnectionInfo(types[i][0], types[i][1]);
32 42
33 </script> 43 </script>
34 </body> 44 </body>
35 </html> 45 </html>
OLDNEW
« 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