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