diff options
Diffstat (limited to 'LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-clear-watch.js')
-rw-r--r-- | LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-clear-watch.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-clear-watch.js b/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-clear-watch.js index 410f042..8e8b4cc 100644 --- a/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-clear-watch.js +++ b/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-clear-watch.js @@ -1,15 +1,18 @@ description("Tests that when Geolocation permission has been denied prior to a call to watchPosition, and the watch is cleared in the error callback, there is no crash. This a regression test for https://bugs.webkit.org/show_bug.cgi?id=32111."); // Prime the Geolocation instance by denying permission. -window.layoutTestController.setGeolocationPermission(false); -window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); +if (window.layoutTestController) { + layoutTestController.setGeolocationPermission(false); + layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); +} else + debug('This test can not be run without the LayoutTestController'); var error; navigator.geolocation.getCurrentPosition(function(p) { testFailed('Success callback invoked unexpectedly'); finishJSTest(); }, function(e) { - error = e + error = e; shouldBe('error.code', 'error.PERMISSION_DENIED'); shouldBe('error.message', '"User denied Geolocation"'); debug(''); @@ -23,7 +26,7 @@ function continueTest() testFailed('Success callback invoked unexpectedly'); finishJSTest(); }, function(e) { - error = e + error = e; shouldBe('error.code', 'error.PERMISSION_DENIED'); shouldBe('error.message', '"User denied Geolocation"'); navigator.geolocation.clearWatch(watchId); @@ -31,7 +34,5 @@ function continueTest() }); } -window.layoutTestController.waitUntilDone(); - window.jsTestIsAsync = true; window.successfullyParsed = true; |