summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js')
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js b/LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js
new file mode 100644
index 0000000..9867084
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js
@@ -0,0 +1,20 @@
+description("Tests that when timeout is zero (and maximumAge is too), the error callback is called immediately with code TIMEOUT.");
+
+layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0);
+
+var error;
+navigator.geolocation.getCurrentPosition(function(p) {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+}, function(e) {
+ error = e
+ shouldBe('error.code', 'error.TIMEOUT');
+ shouldBe('error.message', '"Timeout expired"');
+ finishJSTest();
+}, {
+ timeout: 0
+});
+window.layoutTestController.waitUntilDone();
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;