| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 <script src="../../../resources/mojo-helpers.js"></script> |
| 6 <script src="resources/geolocation-mock.js"></script> |
| 5 </head> | 7 </head> |
| 6 <body> | 8 <body> |
| 7 <script> | 9 <script> |
| 8 description("This tests removing the watcher from a position callback does not c
auses assertions."); | 10 description("This tests removing the watcher from a position callback does not c
auses assertions."); |
| 9 | 11 |
| 10 var mockLatitude = 51.478; | 12 var mockLatitude = 51.478; |
| 11 var mockLongitude = -0.166; | 13 var mockLongitude = -0.166; |
| 12 var mockAccuracy = 100; | 14 var mockAccuracy = 100; |
| 13 | 15 |
| 14 if (!window.testRunner || !window.internals) | 16 if (!window.testRunner || !window.mojo) |
| 15 debug('This test can not run without testRunner or internals'); | 17 debug('This test can not run without testRunner or mojo'); |
| 16 | 18 |
| 17 internals.setGeolocationPermission(document, true); | 19 geolocationServiceMock.then(mock => { |
| 18 internals.setGeolocationPosition(document, | 20 mock.setGeolocationPermission(true); |
| 19 mockLatitude, | 21 mock.setGeolocationPosition(mockLatitude, |
| 20 mockLongitude, | 22 mockLongitude, |
| 21 mockAccuracy); | 23 mockAccuracy); |
| 22 | 24 |
| 23 var watchId = navigator.geolocation.watchPosition(function() { | 25 var watchId = navigator.geolocation.watchPosition(function() { |
| 24 navigator.geolocation.clearWatch(watchId); | 26 navigator.geolocation.clearWatch(watchId); |
| 25 finishJSTest(); | 27 finishJSTest(); |
| 26 }, function(e) { | 28 }, function(e) { |
| 27 navigator.geolocation.clearWatch(watchId); | 29 navigator.geolocation.clearWatch(watchId); |
| 28 finishJSTest(); | 30 finishJSTest(); |
| 31 }); |
| 29 }); | 32 }); |
| 30 | 33 |
| 31 | |
| 32 window.jsTestIsAsync = true; | 34 window.jsTestIsAsync = true; |
| 33 </script> | 35 </script> |
| 34 </body> | 36 </body> |
| 35 </html> | 37 </html> |
| OLD | NEW |