summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-08-11 14:44:44 +0100
committerBen Murdoch <benm@google.com>2010-08-12 19:15:41 +0100
commitdd8bb3de4f353a81954234999f1fea748aee2ea9 (patch)
tree729b52bf09294f0d6c67cd5ea80aee1b727b7bd8 /LayoutTests/fast
parentf3d41ba51d86bf719c7a65ab5297aea3c17e2d98 (diff)
downloadexternal_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.zip
external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.tar.gz
external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.tar.bz2
Merge WebKit at r65072 : Initial merge by git.
Change-Id: Ibcf418498376b2660aacb7f8d46ea7085ef91585
Diffstat (limited to 'LayoutTests/fast')
-rw-r--r--LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-expected.txt10
-rw-r--r--LayoutTests/fast/dom/Geolocation/delayed-permission-allowed.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/delayed-permission-denied-expected.txt11
-rw-r--r--LayoutTests/fast/dom/Geolocation/delayed-permission-denied.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed.js27
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied.js30
-rw-r--r--LayoutTests/fast/js/resources/js-test-pre.js2
7 files changed, 105 insertions, 1 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-expected.txt b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-expected.txt
new file mode 100644
index 0000000..bfe4f75
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-expected.txt
@@ -0,0 +1,10 @@
+Tests that when a position is available, no callbacks are invoked until permission is allowed.
+
+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/delayed-permission-allowed.html b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed.html
new file mode 100644
index 0000000..cacdd85
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed.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/delayed-permission-allowed.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-expected.txt b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-expected.txt
new file mode 100644
index 0000000..292e2ee
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-expected.txt
@@ -0,0 +1,11 @@
+Tests that when a position is available, no callbacks are invoked until permission is denied.
+
+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 successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-denied.html b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied.html
new file mode 100644
index 0000000..0faec6e
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/delayed-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/delayed-permission-denied.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed.js b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed.js
new file mode 100644
index 0000000..f4242ca
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed.js
@@ -0,0 +1,27 @@
+description("Tests that when a position is available, no callbacks are invoked until permission is allowed.");
+
+if (window.layoutTestController)
+ window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+
+function allowPermission() {
+ permissionSet = true;
+ if (window.layoutTestController)
+ layoutTestController.setGeolocationPermission(true);
+}
+
+navigator.geolocation.getCurrentPosition(function() {
+ if (permissionSet) {
+ testPassed('Success callback invoked');
+ finishJSTest();
+ return;
+ }
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+}, function() {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
+window.setTimeout(allowPermission, 100);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied.js b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied.js
new file mode 100644
index 0000000..aebd302
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied.js
@@ -0,0 +1,30 @@
+description("Tests that when a position is available, no callbacks are invoked until permission is denied.");
+
+if (window.layoutTestController)
+ window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+
+function denyPermission() {
+ permissionSet = true;
+ if (window.layoutTestController)
+ layoutTestController.setGeolocationPermission(false);
+}
+
+var error;
+navigator.geolocation.getCurrentPosition(function() {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+}, function(e) {
+ if (permissionSet) {
+ error = e;
+ shouldBe('error.code', 'error.PERMISSION_DENIED');
+ shouldBe('error.message', '"User denied Geolocation"');
+ finishJSTest();
+ return;
+ }
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
+window.setTimeout(denyPermission, 100);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/js/resources/js-test-pre.js b/LayoutTests/fast/js/resources/js-test-pre.js
index 93c3cb6..aaab749 100644
--- a/LayoutTests/fast/js/resources/js-test-pre.js
+++ b/LayoutTests/fast/js/resources/js-test-pre.js
@@ -23,7 +23,7 @@ function debug(msg)
function escapeHTML(text)
{
- return text.replace(/&/g, "&amp;").replace(/</g, "&lt;");
+ return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\0/g, "\\0");
}
function testPassed(msg)