summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js')
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js b/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js
index 244deda..9cdb40e 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js
@@ -2,8 +2,11 @@ description("Tests that when Geolocation permission is denied, watches are stopp
// Configure the mock Geolocation service to report a position to cause permission
// to be requested, then deny it.
-window.layoutTestController.setGeolocationPermission(false);
-window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0);
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(false);
+ layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0);
+} else
+ debug('This test can not be run without the LayoutTestController');
var error;
var errorCallbackInvoked = false;
@@ -17,17 +20,17 @@ navigator.geolocation.watchPosition(function(p) {
}
errorCallbackInvoked = true;
- error = e
+ error = e;
shouldBe('error.code', 'error.PERMISSION_DENIED');
shouldBe('error.message', '"User denied Geolocation"');
// Update the mock Geolocation service to report a new position, then
// yield to allow a chance for the success callback to be invoked.
- window.layoutTestController.setMockGeolocationPosition(55.478, -0.166, 100);
+ if (window.layoutTestController)
+ layoutTestController.setMockGeolocationPosition(55.478, -0.166, 100);
window.setTimeout(finishJSTest, 0);
});
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;