summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/events
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-23 13:31:11 -0700
committerSteve Block <steveblock@google.com>2010-04-23 13:31:11 -0700
commit14764ef27a27de8f3bae5ef277415ef59b8959ff (patch)
tree503016f702cee3b1ed0be37b07c9656206b4003d /LayoutTests/fast/events
parent0eec6dc8b27223eddc5f02396f82d4ae887fae02 (diff)
downloadexternal_webkit-14764ef27a27de8f3bae5ef277415ef59b8959ff.zip
external_webkit-14764ef27a27de8f3bae5ef277415ef59b8959ff.tar.gz
external_webkit-14764ef27a27de8f3bae5ef277415ef59b8959ff.tar.bz2
Add touch event LayoutTests to Android tree (at current WebKit revision, 54731).
These tests should all pass. Current failures will be added to the DumpRenderTree ignore list. Change-Id: Id9a273154e2e70ea6fdea6e39797708e2f5132ed
Diffstat (limited to 'LayoutTests/fast/events')
-rw-r--r--LayoutTests/fast/events/touch/basic-touch-events-expected.txt148
-rw-r--r--LayoutTests/fast/events/touch/basic-touch-events.html13
-rw-r--r--LayoutTests/fast/events/touch/create-touch-event-expected.txt6
-rw-r--r--LayoutTests/fast/events/touch/create-touch-event.html13
-rw-r--r--LayoutTests/fast/events/touch/resources/touch-inside-iframe2.html8
-rw-r--r--LayoutTests/fast/events/touch/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/fast/events/touch/script-tests/basic-touch-events.js154
-rw-r--r--LayoutTests/fast/events/touch/script-tests/create-touch-event.js17
-rw-r--r--LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js32
-rw-r--r--LayoutTests/fast/events/touch/send-oncancel-event-expected.txt13
-rw-r--r--LayoutTests/fast/events/touch/send-oncancel-event.html13
-rw-r--r--LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll-expected.txt27
-rw-r--r--LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll.html129
-rw-r--r--LayoutTests/fast/events/touch/touch-inside-iframe-expected.txt12
-rw-r--r--LayoutTests/fast/events/touch/touch-inside-iframe.html42
15 files changed, 640 insertions, 0 deletions
diff --git a/LayoutTests/fast/events/touch/basic-touch-events-expected.txt b/LayoutTests/fast/events/touch/basic-touch-events-expected.txt
new file mode 100644
index 0000000..7ae4527
--- /dev/null
+++ b/LayoutTests/fast/events/touch/basic-touch-events-expected.txt
@@ -0,0 +1,148 @@
+This tests basic touch event support.
+single touch sequence
+PASS lastEvent.type is "touchstart"
+PASS lastEvent.touches.length is 1
+PASS lastEvent.changedTouches.length is 1
+PASS lastEvent.targetTouches.length is 1
+PASS lastEvent.shiftKey is false
+PASS lastEvent.touches[0].target.id is "touchtarget"
+PASS lastEvent.touches[0].pageX is 10
+PASS lastEvent.touches[0].pageY is 10
+PASS lastEvent.touches[0].clientX is 10
+PASS lastEvent.touches[0].clientY is 10
+PASS lastEvent.touches[0].identifier is 0
+PASS lastEvent.changedTouches[0].pageX is 10
+PASS lastEvent.changedTouches[0].pageY is 10
+PASS lastEvent.changedTouches[0].clientX is 10
+PASS lastEvent.changedTouches[0].clientY is 10
+PASS lastEvent.changedTouches[0].identifier is 0
+PASS lastEvent.targetTouches[0].pageX is 10
+PASS lastEvent.targetTouches[0].pageY is 10
+PASS lastEvent.targetTouches[0].clientX is 10
+PASS lastEvent.targetTouches[0].clientY is 10
+PASS lastEvent.targetTouches[0].identifier is 0
+PASS lastEvent.type is "touchmove"
+PASS lastEvent.touches.length is 1
+PASS lastEvent.changedTouches.length is 1
+PASS lastEvent.targetTouches.length is 1
+PASS lastEvent.touches[0].pageX is 20
+PASS lastEvent.touches[0].pageY is 15
+PASS lastEvent.touches[0].clientX is 20
+PASS lastEvent.touches[0].clientY is 15
+PASS lastEvent.touches[0].identifier is 0
+PASS lastEvent.shiftKey is true
+PASS lastEvent.altKey is true
+PASS lastEvent.ctrlKey is false
+PASS lastEvent.metaKey is false
+PASS lastEvent.type is "touchend"
+PASS lastEvent.touches.length is 0
+PASS lastEvent.changedTouches.length is 1
+PASS lastEvent.targetTouches.length is 0
+PASS lastEvent.changedTouches[0].pageX is 20
+PASS lastEvent.changedTouches[0].pageY is 15
+PASS lastEvent.changedTouches[0].clientX is 20
+PASS lastEvent.changedTouches[0].clientY is 15
+PASS lastEvent.changedTouches[0].identifier is 0
+PASS lastEvent.shiftKey is false
+PASS lastEvent.altKey is false
+multi touch sequence
+Two touchpoints pressed
+PASS lastEvent.type is "touchstart"
+PASS lastEvent.touches.length is 2
+PASS lastEvent.changedTouches.length is 2
+PASS lastEvent.targetTouches.length is 2
+PASS lastEvent.touches[0].pageX is 10
+PASS lastEvent.touches[0].pageY is 10
+PASS lastEvent.touches[0].clientX is 10
+PASS lastEvent.touches[0].clientY is 10
+PASS lastEvent.touches[0].identifier is 0
+PASS lastEvent.touches[1].pageX is 20
+PASS lastEvent.touches[1].pageY is 30
+PASS lastEvent.touches[1].clientX is 20
+PASS lastEvent.touches[1].clientY is 30
+PASS lastEvent.touches[1].identifier is 1
+PASS lastEvent.changedTouches[0].pageX is 10
+PASS lastEvent.changedTouches[0].pageY is 10
+PASS lastEvent.changedTouches[0].clientX is 10
+PASS lastEvent.changedTouches[0].clientY is 10
+PASS lastEvent.changedTouches[0].identifier is 0
+PASS lastEvent.changedTouches[1].pageX is 20
+PASS lastEvent.changedTouches[1].pageY is 30
+PASS lastEvent.changedTouches[1].clientX is 20
+PASS lastEvent.changedTouches[1].clientY is 30
+PASS lastEvent.changedTouches[1].identifier is 1
+PASS lastEvent.targetTouches[0].pageX is 10
+PASS lastEvent.targetTouches[0].pageY is 10
+PASS lastEvent.targetTouches[0].clientX is 10
+PASS lastEvent.targetTouches[0].clientY is 10
+PASS lastEvent.targetTouches[0].identifier is 0
+PASS lastEvent.targetTouches[1].pageX is 20
+PASS lastEvent.targetTouches[1].pageY is 30
+PASS lastEvent.targetTouches[1].clientX is 20
+PASS lastEvent.targetTouches[1].clientY is 30
+PASS lastEvent.targetTouches[1].identifier is 1
+First touchpoint moved
+PASS lastEvent.type is "touchmove"
+PASS lastEvent.touches.length is 2
+PASS lastEvent.changedTouches.length is 1
+PASS lastEvent.targetTouches.length is 2
+PASS lastEvent.touches[0].pageX is 15
+PASS lastEvent.touches[0].pageY is 15
+PASS lastEvent.touches[0].clientX is 15
+PASS lastEvent.touches[0].clientY is 15
+PASS lastEvent.touches[0].identifier is 0
+PASS lastEvent.changedTouches[0].pageX is 15
+PASS lastEvent.changedTouches[0].pageY is 15
+PASS lastEvent.changedTouches[0].clientX is 15
+PASS lastEvent.changedTouches[0].clientY is 15
+PASS lastEvent.changedTouches[0].identifier is 0
+PASS lastEvent.touches[1].pageX is 20
+PASS lastEvent.touches[1].pageY is 30
+PASS lastEvent.touches[1].clientX is 20
+PASS lastEvent.touches[1].clientY is 30
+PASS lastEvent.touches[1].identifier is 1
+First touchpoint is released
+PASS lastEvent.type is "touchend"
+PASS lastEvent.touches.length is 1
+PASS lastEvent.changedTouches.length is 1
+PASS lastEvent.targetTouches.length is 1
+PASS lastEvent.touches[0].pageX is 20
+PASS lastEvent.touches[0].pageY is 30
+PASS lastEvent.touches[0].clientX is 20
+PASS lastEvent.touches[0].clientY is 30
+PASS lastEvent.touches[0].identifier is 1
+PASS lastEvent.changedTouches[0].pageX is 15
+PASS lastEvent.changedTouches[0].pageY is 15
+PASS lastEvent.changedTouches[0].clientX is 15
+PASS lastEvent.changedTouches[0].clientY is 15
+PASS lastEvent.changedTouches[0].identifier is 0
+PASS lastEvent.targetTouches[0].pageX is 20
+PASS lastEvent.targetTouches[0].pageY is 30
+PASS lastEvent.targetTouches[0].clientX is 20
+PASS lastEvent.targetTouches[0].clientY is 30
+PASS lastEvent.targetTouches[0].identifier is 1
+Last remaining touchpoint is released
+PASS lastEvent.type is "touchend"
+PASS lastEvent.touches.length is 0
+PASS lastEvent.changedTouches.length is 1
+PASS lastEvent.targetTouches.length is 0
+PASS lastEvent.changedTouches[0].pageX is 20
+PASS lastEvent.changedTouches[0].pageY is 30
+PASS lastEvent.changedTouches[0].clientX is 20
+PASS lastEvent.changedTouches[0].clientY is 30
+PASS lastEvent.changedTouches[0].identifier is 1
+verify touch targets
+PASS lastEvent.type is "touchstart"
+PASS lastEvent.touches.length is 1
+PASS lastEvent.changedTouches.length is 1
+PASS lastEvent.targetTouches.length is 1
+PASS lastEvent.targetTouches[0].target.tagName is "DIV"
+PASS lastEvent.type is "touchmove"
+PASS lastEvent.touches.length is 1
+PASS lastEvent.changedTouches.length is 1
+PASS lastEvent.targetTouches.length is 0
+PASS lastEvent.touches[0].target.tagName is "HTML"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch/basic-touch-events.html b/LayoutTests/fast/events/touch/basic-touch-events.html
new file mode 100644
index 0000000..c50c6fc
--- /dev/null
+++ b/LayoutTests/fast/events/touch/basic-touch-events.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/basic-touch-events.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/touch/create-touch-event-expected.txt b/LayoutTests/fast/events/touch/create-touch-event-expected.txt
new file mode 100644
index 0000000..8dddc5c
--- /dev/null
+++ b/LayoutTests/fast/events/touch/create-touch-event-expected.txt
@@ -0,0 +1,6 @@
+This tests whether the DOM can create TouchEvents.
+PASS event is non-null.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch/create-touch-event.html b/LayoutTests/fast/events/touch/create-touch-event.html
new file mode 100644
index 0000000..ace4459
--- /dev/null
+++ b/LayoutTests/fast/events/touch/create-touch-event.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/create-touch-event.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/touch/resources/touch-inside-iframe2.html b/LayoutTests/fast/events/touch/resources/touch-inside-iframe2.html
new file mode 100644
index 0000000..34bc461
--- /dev/null
+++ b/LayoutTests/fast/events/touch/resources/touch-inside-iframe2.html
@@ -0,0 +1,8 @@
+<html>
+<body onload="parent.runTest()">
+<div id='mydiv' style='width:100px;height:100px;position:absolute;top:0px; left:0px; background-color:blue;'></div>
+<script type='text/javascript'>
+document.getElementById('mydiv').addEventListener('touchstart', function() { parent.testComplete(event); }, false);
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/touch/script-tests/TEMPLATE.html b/LayoutTests/fast/events/touch/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..1951c43
--- /dev/null
+++ b/LayoutTests/fast/events/touch/script-tests/TEMPLATE.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="YOUR_JS_FILE_HERE"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/touch/script-tests/basic-touch-events.js b/LayoutTests/fast/events/touch/script-tests/basic-touch-events.js
new file mode 100644
index 0000000..6766abc
--- /dev/null
+++ b/LayoutTests/fast/events/touch/script-tests/basic-touch-events.js
@@ -0,0 +1,154 @@
+description = "This tests basic touch event support.";
+
+var div = document.createElement("div");
+div.id = "touchtarget";
+div.style.width = "100px";
+div.style.height = "100px";
+div.style.backgroundColor = "blue";
+
+var lastEvent = null;
+
+function appendEventLog() {
+ if (window.eventSender) {
+ lastEvent = event;
+ } else {
+ debug(event.type);
+ }
+}
+
+div.addEventListener("touchstart", appendEventLog, false);
+div.addEventListener("touchmove", appendEventLog, false);
+div.addEventListener("touchend", appendEventLog, false);
+document.body.insertBefore(div, document.body.firstChild);
+
+function verifyTouchEvent(type, totalTouchCount, changedTouchCount, targetTouchCount)
+{
+ shouldBeEqualToString("lastEvent.type", type);
+ shouldBe("lastEvent.touches.length", totalTouchCount.toString());
+ shouldBe("lastEvent.changedTouches.length", changedTouchCount.toString());
+ shouldBe("lastEvent.targetTouches.length", targetTouchCount.toString());
+}
+
+function verifyTouchPoint(list, point, x, y, id)
+{
+ shouldBe("lastEvent." + list + "[" + point + "].pageX", x.toString());
+ shouldBe("lastEvent." + list + "[" + point + "].pageY", y.toString());
+ shouldBe("lastEvent." + list + "[" + point + "].clientX", x.toString());
+ shouldBe("lastEvent." + list + "[" + point + "].clientY", y.toString());
+ shouldBe("lastEvent." + list + "[" + point + "].identifier", id.toString());
+}
+
+function singleTouchSequence()
+{
+ debug("single touch sequence");
+
+ eventSender.addTouchPoint(10, 10);
+ eventSender.touchStart();
+
+ verifyTouchEvent("touchstart", 1, 1, 1);
+ shouldBe("lastEvent.shiftKey", "false");
+ shouldBeEqualToString("lastEvent.touches[0].target.id", "touchtarget");
+ verifyTouchPoint("touches", 0, 10, 10, 0);
+ verifyTouchPoint("changedTouches", 0, 10, 10, 0);
+ verifyTouchPoint("targetTouches", 0, 10, 10, 0);
+
+ eventSender.updateTouchPoint(0, 20, 15);
+ eventSender.setTouchModifier("shift", true);
+ eventSender.setTouchModifier("alt", true);
+ eventSender.touchMove();
+
+ verifyTouchEvent("touchmove", 1, 1, 1);
+ verifyTouchPoint("touches", 0, 20, 15, 0);
+ shouldBe("lastEvent.shiftKey", "true");
+ shouldBe("lastEvent.altKey", "true");
+ shouldBe("lastEvent.ctrlKey", "false");
+ shouldBe("lastEvent.metaKey", "false");
+
+ eventSender.setTouchModifier("shift", false);
+ eventSender.setTouchModifier("alt", false);
+
+ eventSender.releaseTouchPoint(0);
+ eventSender.touchEnd();
+
+ verifyTouchEvent("touchend", 0, 1, 0);
+ verifyTouchPoint("changedTouches", 0, 20, 15, 0);
+ shouldBe("lastEvent.shiftKey", "false");
+ shouldBe("lastEvent.altKey", "false");
+}
+
+function multiTouchSequence()
+{
+ debug("multi touch sequence");
+
+ debug("Two touchpoints pressed");
+ eventSender.addTouchPoint(10, 10);
+ eventSender.addTouchPoint(20, 30);
+ eventSender.touchStart();
+ verifyTouchEvent("touchstart", 2, 2, 2);
+ verifyTouchPoint("touches", 0, 10, 10, 0);
+ verifyTouchPoint("touches", 1, 20, 30, 1);
+ verifyTouchPoint("changedTouches", 0, 10, 10, 0);
+ verifyTouchPoint("changedTouches", 1, 20, 30, 1);
+ verifyTouchPoint("targetTouches", 0, 10, 10, 0);
+ verifyTouchPoint("targetTouches", 1, 20, 30, 1);
+
+ debug("First touchpoint moved");
+ eventSender.updateTouchPoint(0, 15, 15);
+ eventSender.touchMove();
+ verifyTouchEvent("touchmove", 2, 1, 2);
+ verifyTouchPoint("touches", 0, 15, 15, 0);
+ verifyTouchPoint("changedTouches", 0, 15, 15, 0);
+ verifyTouchPoint("touches", 1, 20, 30, 1);
+
+ debug("First touchpoint is released");
+ eventSender.releaseTouchPoint(0);
+ eventSender.touchEnd();
+ verifyTouchEvent("touchend", 1, 1, 1);
+ verifyTouchPoint("touches", 0, 20, 30, 1);
+ verifyTouchPoint("changedTouches", 0, 15, 15, 0);
+ verifyTouchPoint("targetTouches", 0, 20, 30, 1);
+
+ debug("Last remaining touchpoint is released");
+ eventSender.releaseTouchPoint(0);
+ eventSender.touchEnd();
+ verifyTouchEvent("touchend", 0, 1, 0);
+ verifyTouchPoint("changedTouches", 0, 20, 30, 1);
+}
+
+function touchTargets()
+{
+ debug("verify touch targets");
+
+ eventSender.addTouchPoint(10, 10);
+ eventSender.touchStart();
+
+ verifyTouchEvent("touchstart", 1, 1, 1);
+ shouldBeEqualToString("lastEvent.targetTouches[0].target.tagName", "DIV");
+
+ eventSender.updateTouchPoint(0, 1000, 1000);
+ eventSender.touchMove();
+
+ verifyTouchEvent("touchmove", 1, 1, 0);
+ shouldBeEqualToString("lastEvent.touches[0].target.tagName", "HTML");
+}
+
+if (window.eventSender) {
+ debug(description);
+
+ lastEvent = null;
+ eventSender.clearTouchPoints();
+ singleTouchSequence();
+
+ lastEvent = null;
+ eventSender.clearTouchPoints();
+ multiTouchSequence();
+
+ lastEvent = null;
+ eventSender.clearTouchPoints();
+ touchTargets();
+
+} else {
+ debug("This test requires DumpRenderTree. Tap on the blue rect to log.")
+}
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/events/touch/script-tests/create-touch-event.js b/LayoutTests/fast/events/touch/script-tests/create-touch-event.js
new file mode 100644
index 0000000..78295d6
--- /dev/null
+++ b/LayoutTests/fast/events/touch/script-tests/create-touch-event.js
@@ -0,0 +1,17 @@
+description = "This tests whether the DOM can create TouchEvents.";
+
+debug(description);
+
+var event = null;
+
+try
+{
+ event = document.createEvent("TouchEvent");
+ shouldBeNonNull("event");
+}
+catch (e)
+{
+ testFailed("An exception was thrown: " + e.message);
+}
+
+successfullyParsed = true;
diff --git a/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js b/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js
new file mode 100644
index 0000000..c83daa4
--- /dev/null
+++ b/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js
@@ -0,0 +1,32 @@
+description("Tests that the cancel touch event is sent correctly.");
+
+var touchX = 25;
+var touchY = 25;
+
+var cancelEvent = null;
+
+function touchcancelHandler() {
+ shouldBeEqualToString("event.type", "touchcancel");
+ cancelEvent = event.changedTouches[0];
+ shouldBeNonNull("cancelEvent");
+ shouldBe("cancelEvent.pageX", touchX.toString());
+ shouldBe("cancelEvent.pageY", touchY.toString());
+ if (window.layoutTestController) {
+ layoutTestController.notifyDone();
+ isSuccessfullyParsed();
+ }
+}
+
+if (window.layoutTestController)
+ window.layoutTestController.waitUntilDone();
+
+if (window.eventSender) {
+ document.addEventListener("touchcancel", touchcancelHandler, false);
+ eventSender.addTouchPoint(touchX, touchY);
+ eventSender.touchStart();
+ eventSender.cancelTouchPoint(0);
+ eventSender.touchCancel();
+} else
+ debug("This test requires DumpRenderTree.");
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/events/touch/send-oncancel-event-expected.txt b/LayoutTests/fast/events/touch/send-oncancel-event-expected.txt
new file mode 100644
index 0000000..75b4cb2
--- /dev/null
+++ b/LayoutTests/fast/events/touch/send-oncancel-event-expected.txt
@@ -0,0 +1,13 @@
+Tests that the cancel touch event is sent correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS event.type is "touchcancel"
+PASS cancelEvent is non-null.
+PASS cancelEvent.pageX is 25
+PASS cancelEvent.pageY is 25
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch/send-oncancel-event.html b/LayoutTests/fast/events/touch/send-oncancel-event.html
new file mode 100644
index 0000000..5665c0c
--- /dev/null
+++ b/LayoutTests/fast/events/touch/send-oncancel-event.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/send-oncancel-event.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll-expected.txt b/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll-expected.txt
new file mode 100644
index 0000000..83823f4
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll-expected.txt
@@ -0,0 +1,27 @@
+Base
+PASS event.touches[0].clientX is 100
+PASS event.touches[0].clientY is 100
+PASS event.touches[0].pageX is 100
+PASS event.touches[0].pageY is 100
+
+Just zoomed
+PASS event.touches[0].clientX is 83
+PASS event.touches[0].clientY is 83
+PASS event.touches[0].pageX is 83
+PASS event.touches[0].pageY is 83
+
+Just scrolled
+PASS event.touches[0].clientX is 100
+PASS event.touches[0].clientY is 100
+PASS event.touches[0].pageX is 150
+PASS event.touches[0].pageY is 150
+
+Zoomed and scrolled
+PASS event.touches[0].clientX is 84
+PASS event.touches[0].clientY is 84
+PASS event.touches[0].pageX is 133
+PASS event.touches[0].pageY is 133
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll.html b/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll.html
new file mode 100644
index 0000000..00cd162
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll.html
@@ -0,0 +1,129 @@
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+<style>
+ #pusher {
+ width: 1000px;
+ height: 1000px;
+ outline: 1px solid black;
+ }
+</style>
+<div id="console"></div>
+<div id="testArea">
+ <div id="pusher">This box is here to create scrollbars.</div>
+</div>
+<script src="../../js/resources/js-test-post-function.js"></script>
+<script>
+ var event;
+
+ function sendTouchStart(x, y)
+ {
+ if (window.eventSender) {
+ eventSender.clearTouchPoints();
+ eventSender.addTouchPoint(x, y);
+ eventSender.touchStart();
+ }
+ }
+
+ function zoomPageIn()
+ {
+ if (window.eventSender) {
+ eventSender.zoomPageIn();
+ }
+ }
+
+ function zoomPageOut()
+ {
+ if (window.eventSender) {
+ eventSender.zoomPageOut();
+ }
+ }
+
+ function scrollPage(x, y)
+ {
+ window.scrollTo(x, y);
+ }
+
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ // Default.
+ function base(e)
+ {
+ event = e;
+ debug("Base");
+ shouldBe("event.touches[0].clientX", "100");
+ shouldBe("event.touches[0].clientY", "100");
+ shouldBe("event.touches[0].pageX", "100");
+ shouldBe("event.touches[0].pageY", "100");
+ }
+
+ window.addEventListener("touchstart", base, false);
+
+ sendTouchStart(100, 100);
+ window.removeEventListener("touchstart", base, false);
+
+ // Just zoomed.
+ function justZoomed(e)
+ {
+ event = e;
+ debug("\nJust zoomed");
+ shouldBe("event.touches[0].clientX", "83");
+ shouldBe("event.touches[0].clientY", "83");
+ shouldBe("event.touches[0].pageX", "83");
+ shouldBe("event.touches[0].pageY", "83");
+ }
+ window.addEventListener("touchstart", justZoomed, false);
+ zoomPageIn();
+ sendTouchStart(100, 100);
+ zoomPageOut();
+ window.removeEventListener("touchstart", justZoomed, false);
+
+ // Just scrolled.
+ function justScrolled(e)
+ {
+ event = e;
+ debug("\nJust scrolled");
+ shouldBe("event.touches[0].clientX", "100");
+ shouldBe("event.touches[0].clientY", "100");
+ shouldBe("event.touches[0].pageX", "150");
+ shouldBe("event.touches[0].pageY", "150");
+ }
+ window.addEventListener("touchstart", justScrolled, false);
+ scrollPage(50, 50);
+ sendTouchStart(100, 100);
+ scrollPage(0, 0);
+ window.removeEventListener("touchstart", justScrolled, false);
+
+ // Zoomed and scrolled.
+ function zoomedAndScrolled(e)
+ {
+ event = e;
+ debug("\nZoomed and scrolled");
+ shouldBe("event.touches[0].clientX", "84");
+ shouldBe("event.touches[0].clientY", "84");
+ shouldBe("event.touches[0].pageX", "133");
+ shouldBe("event.touches[0].pageY", "133");
+ }
+ window.addEventListener("touchstart", zoomedAndScrolled, false);
+ zoomPageIn();
+ scrollPage(50, 50);
+ sendTouchStart(100, 100);
+ zoomPageOut();
+ scrollPage(0, 0);
+ window.removeEventListener("touchstart", zoomedAndScrolled, false);
+
+ if (window.eventSender) {
+ eventSender.touchEnd();
+ eventSender.clearTouchPoints();
+ }
+
+ if (window.layoutTestController) {
+ var area = document.getElementById('testArea');
+ area.parentNode.removeChild(area);
+ successfullyParsed = true;
+ isSuccessfullyParsed();
+ layoutTestController.notifyDone();
+ }
+</script>
diff --git a/LayoutTests/fast/events/touch/touch-inside-iframe-expected.txt b/LayoutTests/fast/events/touch/touch-inside-iframe-expected.txt
new file mode 100644
index 0000000..17b655e
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-inside-iframe-expected.txt
@@ -0,0 +1,12 @@
+
+Test iframes receive touches correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS touch.pageX is 50
+PASS touch.pageY is 50
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch/touch-inside-iframe.html b/LayoutTests/fast/events/touch/touch-inside-iframe.html
new file mode 100644
index 0000000..b9162c3
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-inside-iframe.html
@@ -0,0 +1,42 @@
+<html>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="../../js/resources/js-test-post-function.js"></script>
+<body>
+<iframe style="position:absolute; top:100px; left:100px;" src="./resources/touch-inside-iframe2.html"></iframe>
+<p id="description"></p>
+<div id="console"></div>
+<script type="text/javascript">
+description('Test iframes receive touches correctly.');
+
+var touch = null;
+
+function testComplete(event)
+{
+ touch = event.touches[0];
+ shouldBe("touch.pageX", "50");
+ shouldBe("touch.pageY", "50");
+ isSuccessfullyParsed();
+ layoutTestController.notifyDone();
+}
+
+function runTest() {
+ if (window.eventSender) {
+ // Touch the center of the div in the iframe.
+ // 100px is offset to iframe in main frame,
+ // 2px for the iframe border, 50px to get to centre of the div.
+ eventSender.addTouchPoint(152, 152);
+ eventSender.touchStart();
+ } else {
+ debug('This test requires DRT.');
+ }
+}
+
+if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+}
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>