summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/Geolocation/script-tests/error.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/dom/Geolocation/script-tests/error.js')
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/error.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/error.js b/LayoutTests/fast/dom/Geolocation/script-tests/error.js
index 4c818ca..6c9570e 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/error.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/error.js
@@ -1,16 +1,20 @@
description("Tests Geolocation error callback using the mock service.");
-var mockCode = 0;
+var mockCode = 2;
var mockMessage = "debug";
-window.layoutTestController.setMockGeolocationError(mockCode, mockMessage);
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationError(mockCode, mockMessage);
+} 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', 'mockCode');
shouldBe('error.message', 'mockMessage');
shouldBe('error.UNKNOWN_ERROR', 'undefined');
@@ -19,7 +23,6 @@ navigator.geolocation.getCurrentPosition(function(p) {
shouldBe('error.TIMEOUT', '3');
finishJSTest();
});
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;