Index: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/success.js |
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/success.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/success.js |
index 8035f8d5ac708413348070ab5e58de9f990b7520..145172b99989c2e61284612e736b0eea3cca5bfc 100644 |
--- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/success.js |
+++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/success.js |
@@ -4,26 +4,27 @@ var mockLatitude = 51.478; |
var mockLongitude = -0.166; |
var mockAccuracy = 100; |
-if (!window.testRunner || !window.internals) |
- debug('This test can not run without testRunner or internals'); |
- |
-internals.setGeolocationClientMock(document); |
-internals.setGeolocationPermission(document, true); |
-internals.setGeolocationPosition(document, |
- mockLatitude, |
- mockLongitude, |
- mockAccuracy); |
+if (!window.testRunner || !window.mojo) |
+ debug('This test can not run without testRunner or mojo'); |
var position; |
-navigator.geolocation.getCurrentPosition(function(p) { |
- position = p; |
- shouldBe('position.coords.latitude', 'mockLatitude'); |
- shouldBe('position.coords.longitude', 'mockLongitude'); |
- shouldBe('position.coords.accuracy', 'mockAccuracy'); |
- finishJSTest(); |
-}, function(e) { |
- testFailed('Error callback invoked unexpectedly'); |
- finishJSTest(); |
+ |
+geolocationServiceMock.then(mock => { |
+ mock.setGeolocationPermission(true); |
+ mock.setGeolocationPosition(mockLatitude, |
+ mockLongitude, |
+ mockAccuracy); |
+ |
+ navigator.geolocation.getCurrentPosition(function(p) { |
+ position = p; |
+ shouldBe('position.coords.latitude', 'mockLatitude'); |
+ shouldBe('position.coords.longitude', 'mockLongitude'); |
+ shouldBe('position.coords.accuracy', 'mockAccuracy'); |
+ finishJSTest(); |
+ }, function(e) { |
+ testFailed('Error callback invoked unexpectedly'); |
+ finishJSTest(); |
+ }); |
}); |
window.jsTestIsAsync = true; |