summaryrefslogtreecommitdiffstats
path: root/LayoutTests
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-08-24 07:50:47 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-08-24 07:50:47 -0700
commitc570a147a94b126d4172c30914f53dea17b4c8f5 (patch)
tree99c11741887d21f65d67c5bbdab58b7ba2a5d4d5 /LayoutTests
parentc952714bc6809a5ad081baaf9fcc04107b92ea3f (diff)
parent6c65f16005b91786c2b7c0791b9ea1dd684d57f4 (diff)
downloadexternal_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.zip
external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.tar.gz
external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.tar.bz2
Merge changes I2e7e2317,Ie6ccde3a,I3e89f231,Id06ff339,I268dfe7d,Icaf70d9f,Ie234f1a0,Iff5c7aaa,I69b75bf0,Ifbf384f4
* changes: Merge WebKit at r65615 : Update WebKit revision number Merge WebKit at r65615 : Ignore http/tests/appcache/origin-quota.html Merge WebKit at r65615 : Android-specific results for Geolocation tests. Merge WebKit at r65615 : Fix GraphicsContext and ImageBuffer. Merge WebKit at r65615 : processingUserGesture() is now static. Merge WebKit at r65615 : UTF8String() becomes utf8(). Merge WebKit at r65615 : Fix include paths for string headers. Merge WebKit at r65615 : Fix Makefiles. Merge WebKit at r65615 : Fix conflicts. Merge WebKit at r65615 : Initial merge by git.
Diffstat (limited to 'LayoutTests')
-rw-r--r--LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash-expected.txt1
-rw-r--r--LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests-expected.txt11
-rw-r--r--LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests-expected.txt13
-rw-r--r--LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/disconnected-frame-already-expected.txt10
-rw-r--r--LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/disconnected-frame-expected.txt12
-rw-r--r--LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied-expected.txt16
-rw-r--r--LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/disconnected-frame.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt16
-rw-r--r--LayoutTests/fast/dom/Geolocation/no-page-cache.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/cached-page-1.html11
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/cached-page-2.html8
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner1.html8
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner2.html8
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-inner.html8
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js14
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed-for-multiple-requests.js51
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied-for-multiple-requests.js55
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js35
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-permission-denied.js45
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame.js31
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js24
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js2
-rw-r--r--LayoutTests/platform/android/fast/dom/Geolocation/disconnected-frame-expected.txt11
-rw-r--r--LayoutTests/platform/android/fast/dom/Geolocation/disconnected-frame-permission-denied-expected.txt15
-rw-r--r--LayoutTests/platform/android/test_expectations.txt1
30 files changed, 496 insertions, 1 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash-expected.txt b/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash-expected.txt
new file mode 100644
index 0000000..f2e7f90
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash-expected.txt
@@ -0,0 +1 @@
+TEST COMPLETE
diff --git a/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash.html b/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash.html
new file mode 100644
index 0000000..bf492ec
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash.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/clear-watch-invalid-id-crash.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests-expected.txt b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests-expected.txt
new file mode 100644
index 0000000..137f495
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests-expected.txt
@@ -0,0 +1,11 @@
+Tests that when multiple requests are waiting for permission, 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 Success callback invoked
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html
new file mode 100644
index 0000000..421a026
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-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/delayed-permission-allowed-for-multiple-requests.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests-expected.txt b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests-expected.txt
new file mode 100644
index 0000000..8ede03c
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests-expected.txt
@@ -0,0 +1,13 @@
+Tests that when multiple requests are waiting for permission, 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 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-for-multiple-requests.html b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests.html
new file mode 100644
index 0000000..2143094
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-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/delayed-permission-denied-for-multiple-requests.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/disconnected-frame-already-expected.txt b/LayoutTests/fast/dom/Geolocation/disconnected-frame-already-expected.txt
new file mode 100644
index 0000000..12699cc
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/disconnected-frame-already-expected.txt
@@ -0,0 +1,10 @@
+Tests that when a request is made on a Geolocation object after its frame has been disconnected, no callbacks are made and no crash occurs.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Method called on Geolocation object with disconnected Frame.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html b/LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html
new file mode 100644
index 0000000..6c7a7e9
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/disconnected-frame-already.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/disconnected-frame-already.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/disconnected-frame-expected.txt b/LayoutTests/fast/dom/Geolocation/disconnected-frame-expected.txt
new file mode 100644
index 0000000..33c17d3
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/disconnected-frame-expected.txt
@@ -0,0 +1,12 @@
+frame "<!--framePath //<!--frame0-->-->" - has 1 onunload handler(s)
+Tests that when a request is made on a Geolocation object and its Frame is disconnected before a callback is made, the error callback is invoked with the correct error message.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS error.code is 2
+PASS error.message is "Geolocation cannot be used in frameless documents"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied-expected.txt b/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied-expected.txt
new file mode 100644
index 0000000..74c0521
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied-expected.txt
@@ -0,0 +1,16 @@
+frame "<!--framePath //<!--frame0-->-->" - has 1 onunload handler(s)
+Tests that when a request is made on a Geolocation object, permission is denied and its Frame is disconnected before a callback is made, the error callback is invoked with PERMISSION_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 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/disconnected-frame-permission-denied.html b/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied.html
new file mode 100644
index 0000000..d9b51c1
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/disconnected-frame-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/disconnected-frame-permission-denied.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/disconnected-frame.html b/LayoutTests/fast/dom/Geolocation/disconnected-frame.html
new file mode 100644
index 0000000..b91eade
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/disconnected-frame.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/disconnected-frame.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt b/LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt
new file mode 100644
index 0000000..66cbe1b
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt
@@ -0,0 +1,16 @@
+Tests that pages that use Geolocation are not put in the page cache.
+
+Currently, Geolocation does not work with the page cache so pages that use Geolocation are explicitly prevented from entering the cache. This test checks for accidental enabling of the page Cache for Geolocation. See https://bugs.webkit.org/show_bug.cgi?id=43956 for details.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Main page opening resources/cached-page-1.html
+resources/cached-page-1.html fired, count = 1
+resources/cached-page-1.html about to navigate to resources/cached-page-2.html
+resources/cached-page-2.html about to go back to resources/cached-page-1.html
+resources/cached-page-1.html fired, count = 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/no-page-cache.html b/LayoutTests/fast/dom/Geolocation/no-page-cache.html
new file mode 100644
index 0000000..36975b4
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/no-page-cache.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/no-page-cache.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/cached-page-1.html b/LayoutTests/fast/dom/Geolocation/resources/cached-page-1.html
new file mode 100644
index 0000000..f7ec397
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/cached-page-1.html
@@ -0,0 +1,11 @@
+<script>
+function loadNext() {
+ var geolocation = navigator.geolocation;
+ if (window.opener.reportPageOneOnload() == 1) {
+ window.opener.debug('resources/cached-page-1.html about to navigate to resources/cached-page-2.html')
+ // Location changes need to happen outside the onload handler to generate history entries.
+ setTimeout(function() {location.href = 'cached-page-2.html';}, 0);
+ }
+}
+</script>
+<body onload="loadNext()"></body>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/cached-page-2.html b/LayoutTests/fast/dom/Geolocation/resources/cached-page-2.html
new file mode 100644
index 0000000..5478f9c
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/cached-page-2.html
@@ -0,0 +1,8 @@
+<script>
+function init() {
+ window.opener.pageTwoLoaded = true;
+ window.opener.debug('resources/cached-page-2.html about to go back to resources/cached-page-1.html');
+ history.back();
+}
+</script>
+<body onload="init()"></body>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner1.html b/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner1.html
new file mode 100644
index 0000000..2cb7e80
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner1.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ </head>
+ <body onload="window.parent.onFirstIframeLoaded()">
+ <p>This frame should be replaced before the test ends</p>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner2.html b/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner2.html
new file mode 100644
index 0000000..fb48795
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner2.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ </head>
+ <body onload="window.parent.onSecondIframeLoaded()">
+ <p>This frame should be visible when the test completes</p>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-inner.html b/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-inner.html
new file mode 100644
index 0000000..4819351
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-inner.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ </head>
+ <body onload="window.parent.onIframeLoaded()", onunload="window.parent.onIframeUnloaded();">
+ <p>This frame should be replaced before the test ends</p>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js b/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js
new file mode 100644
index 0000000..6176da0
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js
@@ -0,0 +1,14 @@
+description("Tests for a crash when clearWatch() is called with a zero ID.<br><br>We call clearWatch() with a request in progress then navigate the page. This accesses the watchers map during cleanup and triggers the crash. This page should not be visible when the test completes.");
+
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+} else
+ debug('This test can not be run without the LayoutTestController');
+
+navigator.geolocation.watchPosition(function() {});
+navigator.geolocation.clearWatch(0);
+location = "data:text/html,TEST COMPLETE<script>layoutTestController.notifyDone();</script>";
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed-for-multiple-requests.js b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed-for-multiple-requests.js
new file mode 100644
index 0000000..8b02a82
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed-for-multiple-requests.js
@@ -0,0 +1,51 @@
+description("Tests that when multiple requests are waiting for permission, 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);
+}
+
+var watchCallbackInvoked = false;
+var oneShotCallbackInvoked = false;
+
+navigator.geolocation.watchPosition(function() {
+ if (permissionSet) {
+ testPassed('Success callback invoked');
+ watchCallbackInvoked = true;
+ maybeFinishTest();
+ return;
+ }
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+}, function(err) {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
+
+navigator.geolocation.getCurrentPosition(function() {
+ if (permissionSet) {
+ testPassed('Success callback invoked');
+ oneShotCallbackInvoked = true;
+ maybeFinishTest();
+ return;
+ }
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+}, function(err) {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
+
+window.setTimeout(allowPermission, 100);
+
+function maybeFinishTest() {
+ if (watchCallbackInvoked && oneShotCallbackInvoked)
+ finishJSTest();
+}
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied-for-multiple-requests.js b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied-for-multiple-requests.js
new file mode 100644
index 0000000..f230091
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied-for-multiple-requests.js
@@ -0,0 +1,55 @@
+description("Tests that when multiple requests are waiting for permission, 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 watchCallbackInvoked = false;
+var oneShotCallbackInvoked = false;
+var error;
+
+navigator.geolocation.watchPosition(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"');
+ watchCallbackInvoked = true;
+ maybeFinishTest();
+ return;
+ }
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
+
+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"');
+ oneShotCallbackInvoked = true;
+ maybeFinishTest();
+ return;
+ }
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
+window.setTimeout(denyPermission, 100);
+
+function maybeFinishTest() {
+ if (watchCallbackInvoked && oneShotCallbackInvoked)
+ finishJSTest();
+}
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js b/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js
new file mode 100644
index 0000000..b217641
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js
@@ -0,0 +1,35 @@
+description("Tests that when a request is made on a Geolocation object after its frame has been disconnected, no callbacks are made and no crash occurs.");
+
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+}
+
+function onFirstIframeLoaded() {
+ iframeGeolocation = iframe.contentWindow.navigator.geolocation;
+ iframe.src = 'resources/disconnected-frame-already-inner2.html';
+}
+
+var error;
+function onSecondIframeLoaded() {
+ iframeGeolocation.getCurrentPosition(function () {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+ }, function(e) {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+ });
+ setTimeout(finishTest, 1000);
+}
+
+function finishTest() {
+ debug('Method called on Geolocation object with disconnected Frame.');
+ finishJSTest();
+}
+
+var iframe = document.createElement('iframe');
+iframe.src = 'resources/disconnected-frame-already-inner1.html';
+document.body.appendChild(iframe);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-permission-denied.js b/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-permission-denied.js
new file mode 100644
index 0000000..a3f9eca
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-permission-denied.js
@@ -0,0 +1,45 @@
+description("Tests that when a request is made on a Geolocation object, permission is denied and its Frame is disconnected before a callback is made, the error callback is invoked with PERMISSION_DENIED.");
+
+// Prime the Geolocation instance by denying permission. This makes sure that we execute the
+// same code path for both preemptive and non-preemtive permissions policies.
+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;
+function onIframeLoaded() {
+ iframeGeolocation = iframe.contentWindow.navigator.geolocation;
+ iframeGeolocation.getCurrentPosition(function() {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+ }, function(e) {
+ error = e;
+ shouldBe('error.code', 'error.PERMISSION_DENIED');
+ shouldBe('error.message', '"User denied Geolocation"');
+ debug('');
+ iframe.src = 'data:text/html,This frame should be visible when the test completes';
+ });
+}
+
+function onIframeUnloaded() {
+ // Make another request, with permission already denied.
+ iframeGeolocation.getCurrentPosition(function () {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+ }, function(e) {
+ error = e;
+ shouldBe('error.code', 'error.PERMISSION_DENIED');
+ shouldBe('error.message', '"User denied Geolocation"');
+ debug('');
+ finishJSTest();
+ });
+}
+
+var iframe = document.createElement('iframe');
+iframe.src = 'resources/disconnected-frame-inner.html';
+document.body.appendChild(iframe);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame.js b/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame.js
new file mode 100644
index 0000000..50d377a
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame.js
@@ -0,0 +1,31 @@
+description("Tests that when a request is made on a Geolocation object and its Frame is disconnected before a callback is made, the error callback is invoked with the correct error message.");
+
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+}
+
+function onIframeLoaded() {
+ iframeGeolocation = iframe.contentWindow.navigator.geolocation;
+ iframe.src = 'data:text/html,This frame should be visible when the test completes';
+}
+
+var error;
+function onIframeUnloaded() {
+ iframeGeolocation.getCurrentPosition(function () {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+ }, function(e) {
+ error = e;
+ shouldBe('error.code', '2');
+ shouldBe('error.message', '"Geolocation cannot be used in frameless documents"');
+ finishJSTest();
+ });
+}
+
+var iframe = document.createElement('iframe');
+iframe.src = 'resources/disconnected-frame-inner.html';
+document.body.appendChild(iframe);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js b/LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js
new file mode 100644
index 0000000..76afbce
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js
@@ -0,0 +1,24 @@
+description("Tests that pages that use Geolocation are not put in the page cache.<br><br>Currently, Geolocation does not work with the page cache so pages that use Geolocation are explicitly prevented from entering the cache. This test checks for accidental enabling of the page Cache for Geolocation. See https://bugs.webkit.org/show_bug.cgi?id=43956 for details.");
+
+if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+ layoutTestController.setCanOpenWindows();
+ layoutTestController.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+} else
+ debug('This test can not be run without the LayoutTestController');
+
+var pageOneOnloadCount = 0;
+function reportPageOneOnload() {
+ ++pageOneOnloadCount;
+ debug('resources/cached-page-1.html fired, count = ' + pageOneOnloadCount);
+ if (pageOneOnloadCount == 2) {
+ finishJSTest();
+ }
+ return pageOneOnloadCount;
+}
+
+debug("Main page opening resources/cached-page-1.html");
+window.open("resources/cached-page-1.html");
+
+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 4f789f6..8109bd0 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js
@@ -3,7 +3,7 @@ description("Tests that no timers will trigger for navigator.geolocation object
if (window.layoutTestController) layoutTestController.setGeolocationPermission(true);
document.body.onload = function() {
- location = "data:text/html,You should have seen one unload alert appear.<script>window.setTimeout('if (window.layoutTestController) layoutTestController.notifyDone();', 100);</" + "script>";
+ location = "data:text/html,You should have seen one unload alert appear.<script>window.setTimeout('if (window.layoutTestController) layoutTestController.notifyDone();', 100);</script>";
}
document.body.onunload = function() {
diff --git a/LayoutTests/platform/android/fast/dom/Geolocation/disconnected-frame-expected.txt b/LayoutTests/platform/android/fast/dom/Geolocation/disconnected-frame-expected.txt
new file mode 100644
index 0000000..ae10f02
--- /dev/null
+++ b/LayoutTests/platform/android/fast/dom/Geolocation/disconnected-frame-expected.txt
@@ -0,0 +1,11 @@
+Tests that when a request is made on a Geolocation object and its Frame is disconnected before a callback is made, the error callback is invoked with the correct error message.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS error.code is 2
+PASS error.message is "Geolocation cannot be used in frameless documents"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/android/fast/dom/Geolocation/disconnected-frame-permission-denied-expected.txt b/LayoutTests/platform/android/fast/dom/Geolocation/disconnected-frame-permission-denied-expected.txt
new file mode 100644
index 0000000..18abab4
--- /dev/null
+++ b/LayoutTests/platform/android/fast/dom/Geolocation/disconnected-frame-permission-denied-expected.txt
@@ -0,0 +1,15 @@
+Tests that when a request is made on a Geolocation object, permission is denied and its Frame is disconnected before a callback is made, the error callback is invoked with PERMISSION_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 error.code is error.PERMISSION_DENIED
+PASS error.message is "User denied Geolocation"
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/android/test_expectations.txt b/LayoutTests/platform/android/test_expectations.txt
index b3757f5..c05f0e7 100644
--- a/LayoutTests/platform/android/test_expectations.txt
+++ b/LayoutTests/platform/android/test_expectations.txt
@@ -49,6 +49,7 @@ http/tests/appcache/empty-manifest.html IGNORE_RESULT // flaky
http/tests/appcache/fallback.html IGNORE_RESULT // http://b/issue?id=2713004
http/tests/appcache/foreign-iframe-main.html IGNORE_RESULT // flaky - skips states
http/tests/appcache/manifest-with-empty-file.html IGNORE_RESULT // flaky
+http/tests/appcache/origin-quota.html IGNORE_RESULT // requires clearAllApplicationCaches(), see http://b/issue?id=2944196
storage/database-lock-after-reload.html IGNORE_RESULT // Succeeds but DumpRenderTree does not read result correctly
storage/hash-change-with-xhr.html IGNORE_RESULT // Succeeds but DumpRenderTree does not read result correctly
storage/open-database-creation-callback-isolated-world.html IGNORE_RESULT // Requires layoutTestController.evaluateScriptInIsolatedWorld()