| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../resources/js-test.js"></script> |
| <script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script> |
| <script src="file:///gen/device/geolocation/public/interfaces/geolocation.mojom.js"></script> |
| <script src="file:///gen/third_party/WebKit/public/platform/modules/permissions/permission.mojom.js"></script> |
| <script src="resources/geolocation-mock.js"></script> |
| </head> |
| <body> |
| <script> |
| |
| description("Tests that navigator.geolocation.watchPosition returns unique results within its script execution context."); |
| |
| var watchID1; |
| var watchID2; |
| var watchID3; |
| |
| geolocationMock.setGeolocationPosition(51.478, -0.166, 100.0); |
| |
| watchID1 = navigator.geolocation.watchPosition(function() { }); |
| watchID2 = navigator.geolocation.watchPosition(function() { }); |
| watchID3 = navigator.geolocation.watchPosition(function() { }); |
| |
| shouldBeTrue("watchID1 > 0"); |
| shouldBeTrue("watchID2 > 0"); |
| shouldBeTrue("watchID3 > 0"); |
| shouldBeTrue("watchID1 !== watchID2"); |
| shouldBeTrue("watchID1 !== watchID3"); |
| shouldBeTrue("watchID2 !== watchID3"); |
| finishJSTest(); |
| |
| window.jsTestIsAsync = true; |
| </script> |
| </body> |
| </html> |