Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / netinfo / connection-types.html
1 <!DOCTYPE html>
2 <head>
3 <script src="../resources/js-test.js"></script>
4 <script src="resources/netinfo_common.js"></script>
5 </head>
6 <body>
7 <script>
8 description('Tests that all connection types of NetInfo are supported.');
9
10 if (!window.internals)
11   log("This test requires window.internals");
12
13 var types = [
14   'cellular',
15   'bluetooth',
16   'ethernet',
17   'wifi',
18   'other',
19   'none',
20   'unknown'
21 ];
22
23 var count = 0;
24 connection.addEventListener('typechange', function(e) {
25   shouldBe('connection.type', 'types[count]');
26   if (++count === types.length)
27     finishJSTest();
28 });
29
30 for(var i = 0; i < types.length; i++)
31   internals.setNetworkConnectionInfo(types[i]);
32
33 </script>
34 </body>
35 </html>