Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Geolocation / success-clear-watch.html
blob20a667c0a2f71376d48cc1853108fd444f488e5d
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("This tests removing the watcher from a position callback does not causes assertions.");
10 var mockLatitude = 51.478;
11 var mockLongitude = -0.166;
12 var mockAccuracy = 100;
14 if (!window.testRunner || !window.internals)
15 debug('This test can not run without testRunner or internals');
17 internals.setGeolocationPermission(document, true);
18 internals.setGeolocationPosition(document,
19 mockLatitude,
20 mockLongitude,
21 mockAccuracy);
23 var watchId = navigator.geolocation.watchPosition(function() {
24 navigator.geolocation.clearWatch(watchId);
25 finishJSTest();
26 }, function(e) {
27 navigator.geolocation.clearWatch(watchId);
28 finishJSTest();
29 });
32 window.jsTestIsAsync = true;
33 </script>
34 </body>
35 </html>