summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js')
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js b/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js
index 9cea5ba..cce57ce 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js
@@ -1,15 +1,18 @@
description("Tests that when Geolocation permission has been denied prior to a call to a Geolocation method, the error callback is invoked with code PERMISSION_DENIED, when the Geolocation service encounters an error.");
// 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('');
@@ -19,19 +22,19 @@ navigator.geolocation.getCurrentPosition(function(p) {
function continueTest()
{
// Make another request, with permission already denied.
- window.layoutTestController.setMockGeolocationError(0, 'test');
+ if (window.layoutTestController)
+ layoutTestController.setMockGeolocationError(0, 'test');
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"');
finishJSTest();
});
}
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;