blob: e3353586c4f33faa99ac2db8b019772d4aaec777 [file] [log] [blame]
<!DOCTYPE html>
<head>
<script src="../resources/js-test.js"></script>
<script src="resources/netinfo_common.js"></script>
</head>
<body>
<script>
description('Tests that all connection types of NetInfo are supported.');
if (!window.internals)
log("This test requires window.internals");
var types = [
'cellular',
'bluetooth',
'ethernet',
'wifi',
'other',
'none',
'unknown'
];
var count = 0;
connection.addEventListener('typechange', function(e) {
shouldBe('connection.type', 'types[count]');
if (++count === types.length)
finishJSTest();
});
for(var i = 0; i < types.length; i++)
internals.setNetworkConnectionInfo(types[i]);
</script>
</body>
</html>