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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/resources/window-close-popup.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 <script src="../../../../resources/mojo-helpers.js"></script>
2 <script src="geolocation-mock.js"></script>
1 <script> 3 <script>
2 var mockLatitude = 51.478; 4 var mockLatitude = 51.478;
3 var mockLongitude = -0.166; 5 var mockLongitude = -0.166;
4 var mockAccuracy = 100.0; 6 var mockAccuracy = 100.0;
5 7
6 function loadNext() { 8 function loadNext() {
7 if (!window.testRunner || !window.internals) 9 if (!window.testRunner || !window.mojo)
8 debug('This test can not run without testRunner or internals'); 10 debug('This test can not run without testRunner or mojo');
9 11
10 internals.setGeolocationClientMock(document); 12 geolocationServiceMock.then(mock => {
11 internals.setGeolocationPermission(document, true); 13 mock.setGeolocationPermission(true);
12 internals.setGeolocationPosition(document, mockLatitude, mockLongitude, mock Accuracy); 14 mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);
13 15
14 navigator.geolocation.watchPosition(window.opener.gotPosition); 16 navigator.geolocation.watchPosition(window.opener.gotPosition);
17 });
15 } 18 }
16 </script> 19 </script>
17 <body onload="loadNext()"></body> 20 <body onload="loadNext()"></body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698