summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-13 16:23:25 +0100
committerBen Murdoch <benm@google.com>2011-05-16 11:35:02 +0100
commit65f03d4f644ce73618e5f4f50dd694b26f55ae12 (patch)
treef478babb801e720de7bfaee23443ffe029f58731 /LayoutTests/fast
parent47de4a2fb7262c7ebdb9cd133ad2c54c187454d0 (diff)
downloadexternal_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.zip
external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.gz
external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.bz2
Merge WebKit at r75993: Initial merge by git.
Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3
Diffstat (limited to 'LayoutTests/fast')
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html19
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js41
-rw-r--r--LayoutTests/fast/dom/Geolocation/window-close-crash-expected.txt14
-rw-r--r--LayoutTests/fast/dom/Geolocation/window-close-crash.html13
-rw-r--r--LayoutTests/fast/events/touch/document-create-touch-list-expected.txt5
-rw-r--r--LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js32
6 files changed, 124 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html b/LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html
new file mode 100644
index 0000000..cfeabae
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html
@@ -0,0 +1,19 @@
+<script>
+var mockLatitude = 51.478;
+var mockLongitude = -0.166;
+var mockAccuracy = 100.0;
+
+function loadNext() {
+ var geolocation = navigator.geolocation;
+
+ if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);
+ }
+
+ navigator.geolocation.watchPosition(
+ function(p) { window.opener.gotPosition(); },
+ function(e) { window.opener.failedToCreateWatch(e); });
+}
+</script>
+<body onload="loadNext()"></body>
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js b/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js
new file mode 100644
index 0000000..b27df61
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js
@@ -0,0 +1,41 @@
+description("Tests the assertion that the GeolocationClient should not be updating<br>" +
+ "when the GeolocationController is destroyed.<br>" +
+ "See https://bugs.webkit.org/show_bug.cgi?id=52216");
+
+var otherWindow;
+
+if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+ layoutTestController.setCanOpenWindows();
+ layoutTestController.setCloseRemainingWindowsWhenComplete(true);
+} else
+ testFailed('This test can not be run without the LayoutTestController');
+
+function gotPosition(p)
+{
+ testPassed("Received Geoposition.");
+ otherWindow.close();
+ window.setTimeout(waitForWindowToClose, 0);
+}
+
+function waitForWindowToClose()
+{
+ if (!otherWindow.closed) {
+ window.setTimeout(waitForWindowToClose, 0);
+ return;
+ }
+ testPassed("Success - no crash!");
+ finishJSTest();
+}
+
+function failedToCreateWatch(e)
+{
+ testFailed("Failed to create watch: " + e);
+ finishJSTest();
+}
+
+debug("Main page opening resources/window-close-popup.html");
+otherWindow = window.open("resources/window-close-popup.html");
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/window-close-crash-expected.txt b/LayoutTests/fast/dom/Geolocation/window-close-crash-expected.txt
new file mode 100644
index 0000000..bc136e6
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/window-close-crash-expected.txt
@@ -0,0 +1,14 @@
+Tests the assertion that the GeolocationClient should not be updating
+when the GeolocationController is destroyed.
+See https://bugs.webkit.org/show_bug.cgi?id=52216
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Main page opening resources/window-close-popup.html
+PASS Received Geoposition.
+PASS Success - no crash!
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/window-close-crash.html b/LayoutTests/fast/dom/Geolocation/window-close-crash.html
new file mode 100644
index 0000000..fc23692
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/window-close-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/window-close-crash.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt b/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt
index 99d578c..c664b2a 100644
--- a/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt
+++ b/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt
@@ -8,6 +8,11 @@ PASS touchList is non-null.
PASS touchList.length is 0
PASS touchList.item(0) is null
PASS touchList.item(1) is null
+PASS ts.touches.length is 2
+PASS ts.touches[0].identifier is 12341
+PASS ts.touches[0].clientX is 60
+PASS ts.touches[1].screenY is 120
+PASS ts.ctrlKey is true
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js b/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js
index 9c87c9a..526badc 100644
--- a/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js
+++ b/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js
@@ -2,11 +2,43 @@ description("This tests support for the document.createTouchList API.");
shouldBeTrue('"createTouchList" in document');
+// Test createTouchList with no arguments.
var touchList = document.createTouchList();
shouldBeNonNull("touchList");
shouldBe("touchList.length", "0");
shouldBeNull("touchList.item(0)");
shouldBeNull("touchList.item(1)");
+// Test createTouchList with Touch objects as arguments.
+try {
+ var t = document.createTouch(window, document.body, 12341, 60, 65, 100, 105);
+ var t2 = document.createTouch(window, document.body, 12342, 50, 55, 115, 120);
+ var tl = document.createTouchList(t, t2);
+
+ var evt = document.createEvent("TouchEvent");
+ evt.initTouchEvent(tl, tl, tl, "touchstart", window, 0, 0, 0, 0, true, false, false, false);
+
+ document.body.addEventListener("touchstart", function handleTouchStart(ev) {
+ ts = ev;
+ shouldBe("ts.touches.length", "2");
+ shouldBe("ts.touches[0].identifier", "12341");
+ shouldBe("ts.touches[0].clientX", "60");
+ shouldBe("ts.touches[1].screenY", "120");
+ shouldBe("ts.ctrlKey", "true");
+ });
+
+ document.body.dispatchEvent(evt);
+} catch(e) {
+ testFailed("An exception was thrown: " + e.message);
+}
+
+// Test createTouchList with invalid arguments which throws exceptions.
+try {
+ var tl = document.createTouchList(1, 2);
+} catch(e) {
+ testFailed("An exception was thrown: " + e.message);
+}
+
successfullyParsed = true;
isSuccessfullyParsed();
+