| 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> | 5 <script src="../resources/mojo-helpers.js"></script> |
| 6 <script src="resources/geolocation-mock.js"></script> | 6 <script src="resources/geolocation-mock.js"></script> |
| 7 </head> | 7 </head> |
| 8 <body> | 8 <body> |
| 9 <script> | 9 <script> |
| 10 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."); |
| 11 | 11 |
| 12 var mockLatitude = 51.478; | 12 var mockLatitude = 51.478; |
| 13 var mockLongitude = -0.166; | 13 var mockLongitude = -0.166; |
| 14 var mockAccuracy = 100; | 14 var mockAccuracy = 100; |
| 15 | 15 |
| 16 geolocationServiceMock.then(mock => { | 16 geolocationServiceMock.then(mock => { |
| 17 mock.setGeolocationPermission(true); | 17 mock.setGeolocationPermission(true); |
| 18 mock.setGeolocationPosition(mockLatitude, | 18 mock.setGeolocationPosition(mockLatitude, |
| 19 mockLongitude, | 19 mockLongitude, |
| 20 mockAccuracy); | 20 mockAccuracy); |
| 21 | 21 |
| 22 var watchId = navigator.geolocation.watchPosition(function() { | 22 var watchId = navigator.geolocation.watchPosition(function() { |
| 23 navigator.geolocation.clearWatch(watchId); | 23 navigator.geolocation.clearWatch(watchId); |
| 24 finishJSTest(); | 24 finishJSTest(); |
| 25 }, function(e) { | 25 }, function(e) { |
| 26 navigator.geolocation.clearWatch(watchId); | 26 navigator.geolocation.clearWatch(watchId); |
| 27 finishJSTest(); | 27 finishJSTest(); |
| 28 }); | 28 }); |
| 29 }); | 29 }); |
| 30 | 30 |
| 31 window.jsTestIsAsync = true; | 31 window.jsTestIsAsync = true; |
| 32 </script> | 32 </script> |
| 33 </body> | 33 </body> |
| 34 </html> | 34 </html> |
| OLD | NEW |