Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/error-clear-watch.html

Issue 1948033003: Convert most geolocation layout tests to use a JS mock implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-disconnect
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698