blob: 3809b807f3c4222d4b04dab983163c20a033466a [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 the basic operation of NetInfo.');
shouldBe('typeof window.internals.observeGC', '"function"',
'this test requires window.internals');
shouldBeDefined("navigator.connection");
shouldBeDefined("navigator.connection.type");
connection.addEventListener('typechange', function(e) {
shouldBe("typeof connection.type", '"string"');
shouldBe('connection.type', 'newConnectionType');
finishJSTest();
});
internals.setNetworkConnectionInfo(newConnectionType);
</script>
</body>
</html>