diff options
Diffstat (limited to 'LayoutTests/fast/dom/Geolocation/script-tests/success.js')
-rw-r--r-- | LayoutTests/fast/dom/Geolocation/script-tests/success.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/success.js b/LayoutTests/fast/dom/Geolocation/script-tests/success.js index acb6b8d..0baf19a 100644 --- a/LayoutTests/fast/dom/Geolocation/script-tests/success.js +++ b/LayoutTests/fast/dom/Geolocation/script-tests/success.js @@ -4,14 +4,17 @@ var mockLatitude = 51.478; var mockLongitude = -0.166; var mockAccuracy = 100; -window.layoutTestController.setGeolocationPermission(true); -window.layoutTestController.setMockGeolocationPosition(mockLatitude, - mockLongitude, - mockAccuracy); +if (window.layoutTestController) { + layoutTestController.setGeolocationPermission(true); + layoutTestController.setMockGeolocationPosition(mockLatitude, + mockLongitude, + mockAccuracy); +} else + debug('This test can not be run without the LayoutTestController'); var position; navigator.geolocation.getCurrentPosition(function(p) { - position = p + position = p; shouldBe('position.coords.latitude', 'mockLatitude'); shouldBe('position.coords.longitude', 'mockLongitude'); shouldBe('position.coords.accuracy', 'mockAccuracy'); @@ -20,7 +23,6 @@ navigator.geolocation.getCurrentPosition(function(p) { testFailed('Error callback invoked unexpectedly'); finishJSTest(); }); -window.layoutTestController.waitUntilDone(); window.jsTestIsAsync = true; window.successfullyParsed = true; |