Improve test cases for network information APIs
[WebKit-https.git] / LayoutTests / networkinformation / script-tests / basic-all-types-of-events.js
1 description('Tests the basic operation of all NetworkInfo events.');
2
3 var bandwidth = 10;
4 var metered = false;
5
6 var connection = navigator.webkitConnection;
7
8 function checkNetworkInformation() {
9     shouldBe("typeof connection.bandwidth", '"number"');
10     shouldBe("typeof connection.metered", '"boolean"');
11 }
12
13 connection.addEventListener('webkitnetworkinfochange', function() {
14     debug('webkitnetworkinfochange event is raised');
15     checkNetworkInformation();
16     finishJSTest();
17 });
18
19 internals.setNetworkInformation(document, 'webkitnetworkinfochange', bandwidth, metered);
20 window.jsTestIsAsync = true;