summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/events
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-27 16:31:00 +0100
committerSteve Block <steveblock@google.com>2010-05-11 14:42:12 +0100
commitdcc8cf2e65d1aa555cce12431a16547e66b469ee (patch)
tree92a8d65cd5383bca9749f5327fb5e440563926e6 /LayoutTests/fast/events
parentccac38a6b48843126402088a309597e682f40fe6 (diff)
downloadexternal_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'LayoutTests/fast/events')
-rw-r--r--LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt8
-rw-r--r--LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt14
-rw-r--r--LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events.js2
-rw-r--r--LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js6
-rw-r--r--LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js1
-rw-r--r--LayoutTests/fast/events/touch/script-tests/touch-target.js97
-rw-r--r--LayoutTests/fast/events/touch/touch-target-expected.txt25
-rw-r--r--LayoutTests/fast/events/touch/touch-target.html14
8 files changed, 162 insertions, 5 deletions
diff --git a/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt b/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt
index 67db8dc..9f83f8f 100644
--- a/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt
+++ b/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt
@@ -9,6 +9,8 @@ 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.pageX is 0
+PASS lastEvent.pageY is 0
PASS lastEvent.touches[0].pageX is 10
PASS lastEvent.touches[0].pageY is 10
PASS lastEvent.touches[0].clientX is 10
@@ -44,6 +46,8 @@ 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.pageX is 0
+PASS lastEvent.pageY is 0
PASS lastEvent.touches[0].pageX is 15
PASS lastEvent.touches[0].pageY is 15
PASS lastEvent.touches[0].clientX is 15
@@ -64,6 +68,8 @@ 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.pageX is 0
+PASS lastEvent.pageY is 0
PASS lastEvent.touches[0].pageX is 20
PASS lastEvent.touches[0].pageY is 30
PASS lastEvent.touches[0].clientX is 20
@@ -84,6 +90,8 @@ 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.pageX is 0
+PASS lastEvent.pageY is 0
PASS lastEvent.changedTouches[0].pageX is 20
PASS lastEvent.changedTouches[0].pageY is 30
PASS lastEvent.changedTouches[0].clientX is 20
diff --git a/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt b/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt
index 634faa1..ec168cb 100644
--- a/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt
+++ b/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt
@@ -7,6 +7,8 @@ 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.pageX is 0
+PASS lastEvent.pageY is 0
PASS lastEvent.shiftKey is false
PASS lastEvent.touches[0].target.id is "touchtarget"
PASS lastEvent.touches[0].pageX is 10
@@ -28,6 +30,8 @@ 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.pageX is 0
+PASS lastEvent.pageY is 0
PASS lastEvent.touches[0].pageX is 20
PASS lastEvent.touches[0].pageY is 15
PASS lastEvent.touches[0].clientX is 20
@@ -41,6 +45,8 @@ 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.pageX is 0
+PASS lastEvent.pageY is 0
PASS lastEvent.changedTouches[0].pageX is 20
PASS lastEvent.changedTouches[0].pageY is 15
PASS lastEvent.changedTouches[0].clientX is 20
@@ -52,12 +58,16 @@ 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.pageX is 0
+PASS lastEvent.pageY is 0
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 lastEvent.targetTouches.length is 1
+PASS lastEvent.pageX is 0
+PASS lastEvent.pageY is 0
+PASS lastEvent.touches[0].target.tagName is "DIV"
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events.js b/LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events.js
index abfaf90..579c073 100644
--- a/LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events.js
+++ b/LayoutTests/fast/events/touch/script-tests/basic-multi-touch-events.js
@@ -37,6 +37,8 @@ function verifyTouchEvent(type, totalTouchCount, changedTouchCount, targetTouchC
shouldBe("lastEvent.touches.length", totalTouchCount.toString());
shouldBe("lastEvent.changedTouches.length", changedTouchCount.toString());
shouldBe("lastEvent.targetTouches.length", targetTouchCount.toString());
+ shouldBe("lastEvent.pageX", "0");
+ shouldBe("lastEvent.pageY", "0");
}
function verifyTouchPoint(list, point, x, y, id)
diff --git a/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js b/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js
index ca99d83..9975c87 100644
--- a/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js
+++ b/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js
@@ -37,6 +37,8 @@ function verifyTouchEvent(type, totalTouchCount, changedTouchCount, targetTouchC
shouldBe("lastEvent.touches.length", totalTouchCount.toString());
shouldBe("lastEvent.changedTouches.length", changedTouchCount.toString());
shouldBe("lastEvent.targetTouches.length", targetTouchCount.toString());
+ shouldBe("lastEvent.pageX", "0");
+ shouldBe("lastEvent.pageY", "0");
}
function verifyTouchPoint(list, point, x, y, id)
@@ -77,8 +79,8 @@ function verifyTouch(which) {
shouldBeEqualToString("lastEvent.targetTouches[0].target.tagName", "DIV");
break;
case 4:
- verifyTouchEvent("touchmove", 1, 1, 0);
- shouldBeEqualToString("lastEvent.touches[0].target.tagName", "HTML");
+ verifyTouchEvent("touchmove", 1, 1, 1);
+ shouldBeEqualToString("lastEvent.touches[0].target.tagName", "DIV");
break;
default: testFailed("Wrong number of touch events! (" + which + ")");
diff --git a/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js b/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js
index c83daa4..01eac2f 100644
--- a/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js
+++ b/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js
@@ -13,7 +13,6 @@ function touchcancelHandler() {
shouldBe("cancelEvent.pageY", touchY.toString());
if (window.layoutTestController) {
layoutTestController.notifyDone();
- isSuccessfullyParsed();
}
}
diff --git a/LayoutTests/fast/events/touch/script-tests/touch-target.js b/LayoutTests/fast/events/touch/script-tests/touch-target.js
new file mode 100644
index 0000000..0623811
--- /dev/null
+++ b/LayoutTests/fast/events/touch/script-tests/touch-target.js
@@ -0,0 +1,97 @@
+var div1 = document.createElement("div");
+div1.id = "targetA";
+div1.style.width = "100px";
+div1.style.height = "100px";
+div1.style.backgroundColor = "blue";
+
+var div2 = document.createElement("div");
+div2.id = "targetB";
+div2.style.width = "100px";
+div2.style.height = "100px";
+div2.style.backgroundColor = "green";
+
+var touchStartCount = 0;
+var touchMoveCount = 0;
+
+document.getElementById('targetsDiv').appendChild(div1);
+document.getElementById('targetsDiv').appendChild(document.createElement('br'));
+document.getElementById('targetsDiv').appendChild(div2);
+
+function touchStartHandler()
+{
+ shouldBeEqualToString('event.type', 'touchstart');
+ switch (touchStartCount) {
+ case 0:
+ shouldBeEqualToString('event.touches[0].target.id', div1.id);
+ shouldBeEqualToString('event.touches[1].target.id', div2.id);
+ break;
+ case 1:
+ shouldBeEqualToString('event.touches[0].target.id', div2.id);
+ shouldBeEqualToString('event.touches[1].target.id', div1.id);
+ break;
+ }
+
+ touchStartCount++;
+}
+
+function touchMoveHandler()
+{
+ shouldBeEqualToString('event.type', 'touchmove');
+ switch (touchMoveCount) {
+ case 0:
+ case 1:
+ shouldBeEqualToString('event.touches[0].target.id', div1.id);
+ shouldBeEqualToString('event.touches[1].target.id', div2.id);
+ break;
+ case 2:
+ shouldBeEqualToString('event.touches[0].target.id', div2.id);
+ shouldBeEqualToString('event.touches[1].target.id', div1.id);
+ break;
+ }
+
+ if (++touchMoveCount == 3)
+ {
+ successfullyParsed = true;
+ layoutTestController.notifyDone();
+ isSuccessfullyParsed();
+ }
+}
+
+div1.addEventListener("touchstart", touchStartHandler, false);
+div1.addEventListener("touchmove", touchMoveHandler, false);
+
+div2.addEventListener("touchstart", touchStartHandler, false);
+div2.addEventListener("touchmove", touchMoveHandler, false);
+
+description("Tests that the target of touches match the element where the event originated, not where the touch is currently occurring.");
+
+if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+}
+
+if (window.eventSender) {
+ eventSender.clearTouchPoints();
+ eventSender.addTouchPoint(50, 150);
+ eventSender.addTouchPoint(50, 250);
+ eventSender.touchStart();
+
+ eventSender.updateTouchPoint(0, 50, 250);
+ eventSender.updateTouchPoint(1, 50, 150);
+ eventSender.touchMove();
+
+ eventSender.updateTouchPoint(0, 1000, 1000);
+ eventSender.updateTouchPoint(1, 1000, 1000);
+ eventSender.touchMove();
+
+ eventSender.releaseTouchPoint(0);
+ eventSender.touchEnd();
+
+ eventSender.addTouchPoint(50,150);
+ eventSender.touchStart();
+
+ eventSender.updateTouchPoint(0, 500, 500);
+ eventSender.updateTouchPoint(1, 500, 500);
+ eventSender.touchMove();
+} else
+ debug('This test requires DRT.');
+
diff --git a/LayoutTests/fast/events/touch/touch-target-expected.txt b/LayoutTests/fast/events/touch/touch-target-expected.txt
new file mode 100644
index 0000000..60a4c37
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-target-expected.txt
@@ -0,0 +1,25 @@
+Tests that the target of touches match the element where the event originated, not where the touch is currently occurring.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+PASS event.type is "touchstart"
+PASS event.touches[0].target.id is "targetA"
+PASS event.touches[1].target.id is "targetB"
+PASS event.type is "touchmove"
+PASS event.touches[0].target.id is "targetA"
+PASS event.touches[1].target.id is "targetB"
+PASS event.type is "touchmove"
+PASS event.touches[0].target.id is "targetA"
+PASS event.touches[1].target.id is "targetB"
+PASS event.type is "touchstart"
+PASS event.touches[0].target.id is "targetB"
+PASS event.touches[1].target.id is "targetA"
+PASS event.type is "touchmove"
+PASS event.touches[0].target.id is "targetB"
+PASS event.touches[1].target.id is "targetA"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch/touch-target.html b/LayoutTests/fast/events/touch/touch-target.html
new file mode 100644
index 0000000..dfd8dab
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-target.html
@@ -0,0 +1,14 @@
+<!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>
+<script src="../../js/resources/js-test-post-function.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="targetsDiv"></div>
+<div id="console"></div>
+<script src="script-tests/touch-target.js"></script>
+</body>
+</html>