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 an error callback does not cau
ses assertions."); | 10 description("This tests removing the watcher from an error callback does not cau
ses assertions."); |
9 | 11 |
10 if (!window.testRunner || !window.internals) | 12 if (!window.testRunner || !window.mojo) |
11 debug('This test can not run without testRunner or internals'); | 13 debug('This test can not run without testRunner or mojo'); |
12 | 14 |
13 internals.setGeolocationPermission(document, true); | 15 geolocationServiceMock.then(mock => { |
14 internals.setGeolocationPositionUnavailableError(document, "debug"); | 16 mock.setGeolocationPermission(true); |
| 17 mock.setGeolocationPositionUnavailableError("debug"); |
15 | 18 |
16 var watchId = navigator.geolocation.watchPosition(function() { | 19 var watchId = navigator.geolocation.watchPosition(function() { |
17 navigator.geolocation.clearWatch(watchId); | 20 navigator.geolocation.clearWatch(watchId); |
18 finishJSTest(); | 21 finishJSTest(); |
19 }, function(e) { | 22 }, function(e) { |
20 navigator.geolocation.clearWatch(watchId); | 23 navigator.geolocation.clearWatch(watchId); |
21 finishJSTest(); | 24 finishJSTest(); |
| 25 }); |
22 }); | 26 }); |
23 | 27 |
24 | 28 |
25 window.jsTestIsAsync = true; | 29 window.jsTestIsAsync = true; |
26 </script> | 30 </script> |
27 </body> | 31 </body> |
28 </html> | 32 </html> |
OLD | NEW |