OLD | NEW |
(Empty) | |
| 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 the basic operation of NetInfo.'); |
| 9 |
| 10 shouldBe('typeof window.internals.observeGC', '"function"', |
| 11 'this test requires window.internals'); |
| 12 |
| 13 shouldBeDefined("navigator.connection"); |
| 14 shouldBeDefined("navigator.connection.type"); |
| 15 |
| 16 connection.addEventListener('typechange', function(e) { |
| 17 shouldBe("typeof connection.type", '"string"'); |
| 18 if (connection.type != newConnectionType) |
| 19 testFailed("The connection type did not change."); |
| 20 finishJSTest(); |
| 21 }); |
| 22 |
| 23 internals.setNetworkConnectionInfo(newConnectionType); |
| 24 |
| 25 </script> |
| 26 </body> |
| 27 </html> |
OLD | NEW |