summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-06-15 19:36:43 +0100
committerBen Murdoch <benm@google.com>2010-06-16 14:52:28 +0100
commit545e470e52f0ac6a3a072bf559c796b42c6066b6 (patch)
treec0c14763654d84d37577dde512c3d3b4699a9e86 /LayoutTests/fast
parent719298a66237d38ea5c05f1547123ad8aacbc237 (diff)
downloadexternal_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.zip
external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.gz
external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.bz2
Merge webkit.org at r61121: Initial merge by git.
Change-Id: Icd6db395c62285be384d137164d95d7466c98760
Diffstat (limited to 'LayoutTests/fast')
-rw-r--r--LayoutTests/fast/dom/Geolocation/argument-types-expected.txt2
-rw-r--r--LayoutTests/fast/dom/Geolocation/callback-exception-expected.txt2
-rw-r--r--LayoutTests/fast/dom/Geolocation/callback-to-deleted-context-expected.txt11
-rw-r--r--LayoutTests/fast/dom/Geolocation/callback-to-deleted-context.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/callback-to-remote-context-expected.txt10
-rw-r--r--LayoutTests/fast/dom/Geolocation/callback-to-remote-context.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/callback-to-remote-context2-expected.txt10
-rw-r--r--LayoutTests/fast/dom/Geolocation/callback-to-remote-context2.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/multiple-requests-expected.txt17
-rw-r--r--LayoutTests/fast/dom/Geolocation/multiple-requests.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/reentrant-permission-denied-expected.txt13
-rw-r--r--LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/callback-to-deleted-context-inner1.html28
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/callback-to-deleted-context-inner2.html7
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/callback-to-remote-context-inner.html16
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/argument-types.js4
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/callback-exception.js15
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/callback-to-deleted-context.js20
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context.js19
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context2.js21
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/error.js11
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/maximum-age.js17
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/multiple-requests.js47
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js2
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-clear-watch.js13
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js15
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-success.js12
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js13
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/permission-denied.js10
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/position-string.js14
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/reentrant-error.js13
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/reentrant-permission-denied.js41
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/reentrant-success.js19
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/success.js14
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/timeout-clear-watch.js6
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js6
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/timeout.js12
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/watch.js19
38 files changed, 450 insertions, 94 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/argument-types-expected.txt b/LayoutTests/fast/dom/Geolocation/argument-types-expected.txt
index 0c80a85..23ea685 100644
--- a/LayoutTests/fast/dom/Geolocation/argument-types-expected.txt
+++ b/LayoutTests/fast/dom/Geolocation/argument-types-expected.txt
@@ -9,7 +9,6 @@ PASS navigator.geolocation.getCurrentPosition(null) threw exception Error: TYPE_
PASS navigator.geolocation.getCurrentPosition({}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.geolocation.getCurrentPosition(objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.geolocation.getCurrentPosition(emptyFunction) did not throw exception.
-PASS navigator.geolocation.getCurrentPosition(Math.abs) did not throw exception.
PASS navigator.geolocation.getCurrentPosition(true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.geolocation.getCurrentPosition(42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.geolocation.getCurrentPosition(Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
@@ -20,7 +19,6 @@ PASS navigator.geolocation.getCurrentPosition(emptyFunction, null) did not throw
PASS navigator.geolocation.getCurrentPosition(emptyFunction, {}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.geolocation.getCurrentPosition(emptyFunction, emptyFunction) did not throw exception.
-PASS navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs) did not throw exception.
PASS navigator.geolocation.getCurrentPosition(emptyFunction, true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.geolocation.getCurrentPosition(emptyFunction, 42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS navigator.geolocation.getCurrentPosition(emptyFunction, Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
diff --git a/LayoutTests/fast/dom/Geolocation/callback-exception-expected.txt b/LayoutTests/fast/dom/Geolocation/callback-exception-expected.txt
index 17ab503..ecf5084 100644
--- a/LayoutTests/fast/dom/Geolocation/callback-exception-expected.txt
+++ b/LayoutTests/fast/dom/Geolocation/callback-exception-expected.txt
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 22: Error: Exception in success callback
+CONSOLE MESSAGE: line 25: Error: Exception in success callback
Tests that when an exception is thrown in the success callback, the error callback is not invoked. Note that this test throws an exception which is not caught.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context-expected.txt b/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context-expected.txt
new file mode 100644
index 0000000..1b0a1b1
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context-expected.txt
@@ -0,0 +1,11 @@
+frame "<!--framePath //<!--frame0-->-->" - has 1 onunload handler(s)
+Tests that when a Geolocation request is made from a remote frame, and that frame's script context goes away before the Geolocation callback is made, the callback is not made. If the callback is attempted, a crash will occur.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS No callbacks invoked
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context.html b/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context.html
new file mode 100644
index 0000000..b9df281
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/callback-to-deleted-context.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/callback-to-remote-context-expected.txt b/LayoutTests/fast/dom/Geolocation/callback-to-remote-context-expected.txt
new file mode 100644
index 0000000..1660ca6
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/callback-to-remote-context-expected.txt
@@ -0,0 +1,10 @@
+Tests that when a Geolocation request is made from a remote frame, callbacks are made as usual.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Success callback invoked
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/callback-to-remote-context.html b/LayoutTests/fast/dom/Geolocation/callback-to-remote-context.html
new file mode 100644
index 0000000..131fca3
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/callback-to-remote-context.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/callback-to-remote-context.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/callback-to-remote-context2-expected.txt b/LayoutTests/fast/dom/Geolocation/callback-to-remote-context2-expected.txt
new file mode 100644
index 0000000..55d5b08
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/callback-to-remote-context2-expected.txt
@@ -0,0 +1,10 @@
+Tests that when a Geolocation request is made from a remote frame, and the JavaScript call chain starts from that remote frame, callbacks are made as usual.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Success callback invoked
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/callback-to-remote-context2.html b/LayoutTests/fast/dom/Geolocation/callback-to-remote-context2.html
new file mode 100644
index 0000000..f17f2e2
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/callback-to-remote-context2.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/callback-to-remote-context2.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/multiple-requests-expected.txt b/LayoutTests/fast/dom/Geolocation/multiple-requests-expected.txt
new file mode 100644
index 0000000..6ed5dc4
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/multiple-requests-expected.txt
@@ -0,0 +1,17 @@
+Tests that Geolocation correctly handles multiple concurrent requests.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS oneShotCallbackInvoked is false
+PASS position.coords.latitude is mockLatitude
+PASS position.coords.longitude is mockLongitude
+PASS position.coords.accuracy is mockAccuracy
+PASS watchCallbackInvoked is false
+PASS position.coords.latitude is mockLatitude
+PASS position.coords.longitude is mockLongitude
+PASS position.coords.accuracy is mockAccuracy
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/multiple-requests.html b/LayoutTests/fast/dom/Geolocation/multiple-requests.html
new file mode 100644
index 0000000..fc47617
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/multiple-requests.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/multiple-requests.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied-expected.txt b/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied-expected.txt
new file mode 100644
index 0000000..8bf9590
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied-expected.txt
@@ -0,0 +1,13 @@
+Tests that reentrant calls to Geolocation methods from the error callback due to a PERMISSION_DENIED error are OK.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS error.code is error.PERMISSION_DENIED
+PASS error.message is "User denied Geolocation"
+PASS error.code is error.PERMISSION_DENIED
+PASS error.message is "User denied Geolocation"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html b/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html
new file mode 100644
index 0000000..1b7a968
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/reentrant-permission-denied.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/callback-to-deleted-context-inner1.html b/LayoutTests/fast/dom/Geolocation/resources/callback-to-deleted-context-inner1.html
new file mode 100644
index 0000000..a5ca5e0
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/callback-to-deleted-context-inner1.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <script>
+ function makeGeolocationRequest() {
+ if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+ }
+
+ // Make request from remote frame, this frame will be gone by the time the Geolocation
+ // object attempts to invoke the callback.
+ window.parent.navigator.geolocation.getCurrentPosition(function() {
+ alert('Success callback invoked unexpectedly');
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }, function() {
+ alert('Error callback invoked unexpectedly');
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ });
+ }
+ </script>
+ </head>
+ <body onload="window.parent.onFirstIframeLoaded()", onunload="makeGeolocationRequest()">
+ <p>This frame should be replaced before the test ends</p>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/callback-to-deleted-context-inner2.html b/LayoutTests/fast/dom/Geolocation/resources/callback-to-deleted-context-inner2.html
new file mode 100644
index 0000000..05d14af
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/callback-to-deleted-context-inner2.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ </head>
+ <body onload="window.parent.onSecondIframeLoaded()">
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/callback-to-remote-context-inner.html b/LayoutTests/fast/dom/Geolocation/resources/callback-to-remote-context-inner.html
new file mode 100644
index 0000000..0547943
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/callback-to-remote-context-inner.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <script>
+ function init() {
+ if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+ }
+ window.parent.onIframeReady()
+ }
+ </script>
+ </head>
+ <body onload="init()">
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/argument-types.js b/LayoutTests/fast/dom/Geolocation/script-tests/argument-types.js
index 2b559d8..01c77f5 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/argument-types.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/argument-types.js
@@ -40,7 +40,7 @@ test('navigator.geolocation.getCurrentPosition(null)', true);
test('navigator.geolocation.getCurrentPosition({})', true);
test('navigator.geolocation.getCurrentPosition(objectThrowingException)', true);
test('navigator.geolocation.getCurrentPosition(emptyFunction)', false);
-test('navigator.geolocation.getCurrentPosition(Math.abs)', false);
+//test('navigator.geolocation.getCurrentPosition(Math.abs)', false);
test('navigator.geolocation.getCurrentPosition(true)', true);
test('navigator.geolocation.getCurrentPosition(42)', true);
test('navigator.geolocation.getCurrentPosition(Infinity)', true);
@@ -52,7 +52,7 @@ test('navigator.geolocation.getCurrentPosition(emptyFunction, null)', false);
test('navigator.geolocation.getCurrentPosition(emptyFunction, {})', true);
test('navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException)', true);
test('navigator.geolocation.getCurrentPosition(emptyFunction, emptyFunction)', false);
-test('navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs)', false);
+//test('navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs)', false);
test('navigator.geolocation.getCurrentPosition(emptyFunction, true)', true);
test('navigator.geolocation.getCurrentPosition(emptyFunction, 42)', true);
test('navigator.geolocation.getCurrentPosition(emptyFunction, Infinity)', true);
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/callback-exception.js b/LayoutTests/fast/dom/Geolocation/script-tests/callback-exception.js
index 7a86648..3a092b1 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/callback-exception.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/callback-exception.js
@@ -4,14 +4,17 @@ var mockLatitude = 51.478;
var mockLongitude = -0.166;
var mockAccuracy = 100;
-window.layoutTestController.setGeolocationPermission(true);
-window.layoutTestController.setMockGeolocationPosition(mockLatitude,
- mockLongitude,
- mockAccuracy);
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(mockLatitude,
+ mockLongitude,
+ mockAccuracy);
+} else
+ debug('This test can not be run without the LayoutTestController');
var position;
navigator.geolocation.getCurrentPosition(function(p) {
- position = p
+ position = p;
shouldBe('position.coords.latitude', 'mockLatitude');
shouldBe('position.coords.longitude', 'mockLongitude');
shouldBe('position.coords.accuracy', 'mockAccuracy');
@@ -25,7 +28,5 @@ navigator.geolocation.getCurrentPosition(function(p) {
finishJSTest();
});
-window.layoutTestController.waitUntilDone();
-
window.jsTestIsAsync = true;
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-deleted-context.js b/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-deleted-context.js
new file mode 100644
index 0000000..6494995
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-deleted-context.js
@@ -0,0 +1,20 @@
+description("Tests that when a Geolocation request is made from a remote frame, and that frame's script context goes away before the Geolocation callback is made, the callback is not made. If the callback is attempted, a crash will occur.");
+
+function onFirstIframeLoaded() {
+ iframe.src = 'resources/callback-to-deleted-context-inner2.html';
+}
+
+function onSecondIframeLoaded() {
+ // Wait for the callbacks to be invoked
+ window.setTimeout(function() {
+ testPassed('No callbacks invoked');
+ finishJSTest();
+ }, 100);
+}
+
+var iframe = document.createElement('iframe');
+iframe.src = 'resources/callback-to-deleted-context-inner1.html';
+document.body.appendChild(iframe);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context.js b/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context.js
new file mode 100644
index 0000000..70acab7
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context.js
@@ -0,0 +1,19 @@
+description("Tests that when a Geolocation request is made from a remote frame, callbacks are made as usual.");
+
+function onIframeReady() {
+ // Make request from remote frame
+ iframe.contentWindow.navigator.geolocation.getCurrentPosition(function() {
+ testPassed('Success callback invoked');
+ finishJSTest();
+ }, function() {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+ });
+}
+
+var iframe = document.createElement('iframe');
+iframe.src = 'resources/callback-to-remote-context-inner.html';
+document.body.appendChild(iframe);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context2.js b/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context2.js
new file mode 100644
index 0000000..115b4ed
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context2.js
@@ -0,0 +1,21 @@
+description("Tests that when a Geolocation request is made from a remote frame, and the JavaScript call chain starts from that remote frame, callbacks are made as usual.");
+
+function onIframeReady() {
+ // Make request from remote frame, with call chain starting here
+ window.setTimeout(function() {
+ iframe.contentWindow.navigator.geolocation.getCurrentPosition(function() {
+ testPassed('Success callback invoked');
+ finishJSTest();
+ }, function() {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+ });
+ }, 0);
+}
+
+var iframe = document.createElement('iframe');
+iframe.src = 'resources/callback-to-remote-context-inner.html';
+document.body.appendChild(iframe);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
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;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/maximum-age.js b/LayoutTests/fast/dom/Geolocation/script-tests/maximum-age.js
index 207fb64..f3d8f5f 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/maximum-age.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/maximum-age.js
@@ -4,7 +4,7 @@ var mockLatitude = 51.478;
var mockLongitude = -0.166;
var mockAccuracy = 100.0;
-var mockCode = 1;
+var mockCode = 2;
var mockMessage = 'test';
var position;
@@ -25,8 +25,11 @@ function checkError(e) {
shouldBe('error.message', 'mockMessage');
}
-window.layoutTestController.setGeolocationPermission(true);
-window.layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);
+} else
+ debug('This test can not be run without the LayoutTestController');
// Initialize the cached Position
navigator.geolocation.getCurrentPosition(function(p) {
@@ -39,7 +42,8 @@ navigator.geolocation.getCurrentPosition(function(p) {
function testZeroMaximumAge() {
// Update the position provided by the mock service.
- window.layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy);
+ if (window.layoutTestController)
+ layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy);
// The default maximumAge is zero, so we expect the updated position from the service.
navigator.geolocation.getCurrentPosition(function(p) {
checkPosition(p);
@@ -52,7 +56,8 @@ function testZeroMaximumAge() {
function testNonZeroMaximumAge() {
// Update the mock service to report an error.
- window.layoutTestController.setMockGeolocationError(mockCode, mockMessage);
+ if (window.layoutTestController)
+ layoutTestController.setMockGeolocationError(mockCode, mockMessage);
// The maximumAge is non-zero, so we expect the cached position, not the error from the service.
navigator.geolocation.getCurrentPosition(function(p) {
checkPosition(p);
@@ -74,7 +79,5 @@ function testZeroMaximumAgeError() {
});
}
-window.layoutTestController.waitUntilDone();
-
window.jsTestIsAsync = true;
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/multiple-requests.js b/LayoutTests/fast/dom/Geolocation/script-tests/multiple-requests.js
new file mode 100644
index 0000000..4115a97
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/multiple-requests.js
@@ -0,0 +1,47 @@
+description("Tests that Geolocation correctly handles multiple concurrent requests.");
+
+var mockLatitude = 51.478;
+var mockLongitude = -0.166;
+var mockAccuracy = 100;
+
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(mockLatitude,
+ mockLongitude,
+ mockAccuracy);
+} else
+ debug('This test can not be run without the LayoutTestController');
+
+var watchCallbackInvoked = false;
+var oneShotCallbackInvoked = false;
+
+navigator.geolocation.watchPosition(function(p) {
+ shouldBeFalse('watchCallbackInvoked');
+ watchCallbackInvoked = true;
+ maybeFinishTest(p);
+}, function() {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
+
+navigator.geolocation.getCurrentPosition(function(p) {
+ shouldBeFalse('oneShotCallbackInvoked');
+ oneShotCallbackInvoked = true;
+ maybeFinishTest(p);
+}, function() {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
+
+var position;
+function maybeFinishTest(p) {
+ position = p;
+ shouldBe('position.coords.latitude', 'mockLatitude');
+ shouldBe('position.coords.longitude', 'mockLongitude');
+ shouldBe('position.coords.accuracy', 'mockAccuracy');
+ if (watchCallbackInvoked && oneShotCallbackInvoked)
+ finishJSTest();
+}
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js b/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js
index 278e027..4f789f6 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js
@@ -17,5 +17,3 @@ document.body.onunload = function() {
window.jsTestIsAsync = true;
window.successfullyParsed = true;
-
-if (window.layoutTestController) layoutTestController.waitUntilDone();
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;
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;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-success.js b/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-success.js
index fdc74e6..4a25367 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-success.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-success.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 has a good position.");
// 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,13 +26,12 @@ 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"');
finishJSTest();
});
}
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;
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;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied.js b/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied.js
index aafcaf1..e7114d3 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied.js
@@ -1,19 +1,21 @@
description("Tests Geolocation when permission is denied, using the mock service.");
-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.0);
+} 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"');
finishJSTest();
});
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/position-string.js b/LayoutTests/fast/dom/Geolocation/script-tests/position-string.js
index d4931ee..0984f7d 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/position-string.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/position-string.js
@@ -4,15 +4,18 @@ var mockLatitude = 51.478;
var mockLongitude = -0.166;
var mockAccuracy = 100.0;
-window.layoutTestController.setGeolocationPermission(true);
-window.layoutTestController.setMockGeolocationPosition(mockLatitude,
- mockLongitude,
- mockAccuracy);
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(mockLatitude,
+ mockLongitude,
+ mockAccuracy);
+} else
+ debug('This test can not be run without the LayoutTestController');
var position;
navigator.geolocation.getCurrentPosition(function(p) {
// shouldBe can't use local variables yet.
- position = p
+ position = p;
shouldBe('position.coords.latitude', 'mockLatitude');
shouldBe('position.coords.longitude', 'mockLongitude');
shouldBe('position.coords.accuracy', 'mockAccuracy');
@@ -23,7 +26,6 @@ navigator.geolocation.getCurrentPosition(function(p) {
testFailed('Error callback invoked unexpectedly');
finishJSTest();
});
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-error.js b/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-error.js
index e3361de..d28a66a 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-error.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-error.js
@@ -1,9 +1,13 @@
description("Tests that reentrant calls to Geolocation methods from the error callback are OK.");
-var mockCode = 0;
+var mockCode = 2;
var mockMessage = 'test';
-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;
var errorCallbackInvoked = false;
@@ -25,10 +29,10 @@ navigator.geolocation.getCurrentPosition(function(p) {
});
function continueTest() {
- mockCode += 1;
mockMessage += ' repeat';
- window.layoutTestController.setMockGeolocationError(mockCode, mockMessage);
+ if (window.layoutTestController)
+ layoutTestController.setMockGeolocationError(mockCode, mockMessage);
navigator.geolocation.getCurrentPosition(function(p) {
testFailed('Success callback invoked unexpectedly');
@@ -40,7 +44,6 @@ function continueTest() {
finishJSTest();
});
}
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-permission-denied.js b/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-permission-denied.js
new file mode 100644
index 0000000..744bc9e
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-permission-denied.js
@@ -0,0 +1,41 @@
+description("Tests that reentrant calls to Geolocation methods from the error callback due to a PERMISSION_DENIED error are OK.");
+
+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;
+function checkPermissionError(e) {
+ error = e;
+ shouldBe('error.code', 'error.PERMISSION_DENIED');
+ shouldBe('error.message', '"User denied Geolocation"');
+}
+
+var errorCallbackInvoked = false;
+navigator.geolocation.getCurrentPosition(function(p) {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+}, function(e) {
+ if (errorCallbackInvoked) {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+ }
+ errorCallbackInvoked = true;
+ checkPermissionError(e);
+ continueTest();
+});
+
+function continueTest() {
+ navigator.geolocation.getCurrentPosition(function(p) {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+ }, function(e) {
+ checkPermissionError(e);
+ finishJSTest();
+ });
+}
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-success.js b/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-success.js
index 4b83ea7..f7b3c78 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-success.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-success.js
@@ -4,10 +4,13 @@ var mockLatitude = 51.478;
var mockLongitude = -0.166;
var mockAccuracy = 100.0;
-window.layoutTestController.setGeolocationPermission(true);
-window.layoutTestController.setMockGeolocationPosition(mockLatitude,
- mockLongitude,
- mockAccuracy);
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(mockLatitude,
+ mockLongitude,
+ mockAccuracy);
+} else
+ debug('This test can not be run without the LayoutTestController');
var position;
var successCallbackInvoked = false;
@@ -30,9 +33,10 @@ navigator.geolocation.getCurrentPosition(function(p) {
});
function continueTest() {
- window.layoutTestController.setMockGeolocationPosition(++mockLatitude,
- ++mockLongitude,
- ++mockAccuracy);
+ if (window.layoutTestController)
+ layoutTestController.setMockGeolocationPosition(++mockLatitude,
+ ++mockLongitude,
+ ++mockAccuracy);
navigator.geolocation.getCurrentPosition(function(p) {
position = p;
@@ -45,7 +49,6 @@ function continueTest() {
finishJSTest();
});
}
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/success.js b/LayoutTests/fast/dom/Geolocation/script-tests/success.js
index acb6b8d..0baf19a 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/success.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/success.js
@@ -4,14 +4,17 @@ var mockLatitude = 51.478;
var mockLongitude = -0.166;
var mockAccuracy = 100;
-window.layoutTestController.setGeolocationPermission(true);
-window.layoutTestController.setMockGeolocationPosition(mockLatitude,
- mockLongitude,
- mockAccuracy);
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(mockLatitude,
+ mockLongitude,
+ mockAccuracy);
+} else
+ debug('This test can not be run without the LayoutTestController');
var position;
navigator.geolocation.getCurrentPosition(function(p) {
- position = p
+ position = p;
shouldBe('position.coords.latitude', 'mockLatitude');
shouldBe('position.coords.longitude', 'mockLongitude');
shouldBe('position.coords.accuracy', 'mockAccuracy');
@@ -20,7 +23,6 @@ navigator.geolocation.getCurrentPosition(function(p) {
testFailed('Error callback invoked unexpectedly');
finishJSTest();
});
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/timeout-clear-watch.js b/LayoutTests/fast/dom/Geolocation/script-tests/timeout-clear-watch.js
index 63e0569..fe26735 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/timeout-clear-watch.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/timeout-clear-watch.js
@@ -1,13 +1,14 @@
description("Tests that when a watch times out and is cleared from the error callback, there is no crash. This a regression test for https://bugs.webkit.org/show_bug.cgi?id=32111.");
-window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0);
+if (window.layoutTestController)
+ layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0);
var error;
var watchId = navigator.geolocation.watchPosition(function() {
testFailed('Success callback invoked unexpectedly');
finishJSTest();
}, function(e) {
- error = e
+ error = e;
shouldBe('error.code', 'error.TIMEOUT');
shouldBe('error.message', '"Timeout expired"');
navigator.geolocation.clearWatch(watchId);
@@ -16,7 +17,6 @@ var watchId = navigator.geolocation.watchPosition(function() {
timeout: 0
});
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js b/LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js
index 9867084..03076bc 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js
@@ -1,20 +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);
+if (window.layoutTestController)
+ 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
+ error = e;
shouldBe('error.code', 'error.TIMEOUT');
shouldBe('error.message', '"Timeout expired"');
finishJSTest();
}, {
timeout: 0
});
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/timeout.js b/LayoutTests/fast/dom/Geolocation/script-tests/timeout.js
index 49cab29..0a027d9 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/timeout.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/timeout.js
@@ -4,10 +4,13 @@ var mockLatitude = 51.478;
var mockLongitude = -0.166;
var mockAccuracy = 100.0;
-window.layoutTestController.setGeolocationPermission(true);
-window.layoutTestController.setMockGeolocationPosition(mockLatitude,
- mockLongitude,
- mockAccuracy);
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(mockLatitude,
+ mockLongitude,
+ mockAccuracy);
+} else
+ debug('This test can not be run without the LayoutTestController');
var position;
navigator.geolocation.getCurrentPosition(function(p) {
@@ -22,7 +25,6 @@ navigator.geolocation.getCurrentPosition(function(p) {
}, {
timeout: 1000
});
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/watch.js b/LayoutTests/fast/dom/Geolocation/script-tests/watch.js
index 8249f2e..9b356bb 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/watch.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/watch.js
@@ -4,7 +4,7 @@ var mockLatitude = 51.478;
var mockLongitude = -0.166;
var mockAccuracy = 100.0;
-var mockCode = 1;
+var mockCode = 2;
var mockMessage = 'test';
var position;
@@ -25,19 +25,24 @@ function checkError(e) {
debug('');
}
-window.layoutTestController.setGeolocationPermission(true);
-window.layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);
+} else
+ debug('This test can not be run without the LayoutTestController');
var state = 0;
navigator.geolocation.watchPosition(function(p) {
switch (state++) {
case 0:
checkPosition(p);
- window.layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy);
+ if (window.layoutTestController)
+ layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy);
break;
case 1:
checkPosition(p);
- window.layoutTestController.setMockGeolocationError(mockCode, mockMessage);
+ if (window.layoutTestController)
+ layoutTestController.setMockGeolocationError(mockCode, mockMessage);
break;
case 3:
checkPosition(p);
@@ -51,14 +56,14 @@ navigator.geolocation.watchPosition(function(p) {
switch (state++) {
case 2:
checkError(e);
- window.layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy);
+ if (window.layoutTestController)
+ layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy);
break;
default:
testFailed('Error callback invoked unexpectedly');
finishJSTest();
}
});
-window.layoutTestController.waitUntilDone();
window.jsTestIsAsync = true;
window.successfullyParsed = true;