summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/events
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-05-11 18:35:50 +0100
committerBen Murdoch <benm@google.com>2010-05-14 10:23:05 +0100
commit21939df44de1705786c545cd1bf519d47250322d (patch)
treeef56c310f5c0cdc379c2abb2e212308a3281ce20 /LayoutTests/fast/events
parent4ff1d8891d520763f17675827154340c7c740f90 (diff)
downloadexternal_webkit-21939df44de1705786c545cd1bf519d47250322d.zip
external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.gz
external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.bz2
Merge Webkit at r58956: Initial merge by Git.
Change-Id: I1d9fb60ea2c3f2ddc04c17a871acdb39353be228
Diffstat (limited to 'LayoutTests/fast/events')
-rw-r--r--LayoutTests/fast/events/touch/basic-multi-touch-events.html7
-rw-r--r--LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt16
-rw-r--r--LayoutTests/fast/events/touch/basic-single-touch-events.html6
-rw-r--r--LayoutTests/fast/events/touch/create-touch-event.html2
-rw-r--r--LayoutTests/fast/events/touch/resources/create-touch-event.js (renamed from LayoutTests/fast/events/touch/script-tests/create-touch-event.js)0
-rw-r--r--LayoutTests/fast/events/touch/resources/send-touch-up.html39
-rw-r--r--LayoutTests/fast/events/touch/resources/touch-stale-node-crash.js20
-rw-r--r--LayoutTests/fast/events/touch/script-tests/TEMPLATE.html8
-rw-r--r--LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js8
-rw-r--r--LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js1
-rw-r--r--LayoutTests/fast/events/touch/script-tests/touch-target.js10
-rw-r--r--LayoutTests/fast/events/touch/send-oncancel-event.html8
-rw-r--r--LayoutTests/fast/events/touch/touch-stale-node-crash-expected.txt1
-rw-r--r--LayoutTests/fast/events/touch/touch-stale-node-crash.html14
-rw-r--r--LayoutTests/fast/events/touch/touch-target.html7
15 files changed, 127 insertions, 20 deletions
diff --git a/LayoutTests/fast/events/touch/basic-multi-touch-events.html b/LayoutTests/fast/events/touch/basic-multi-touch-events.html
index 951e169..cdf0a71 100644
--- a/LayoutTests/fast/events/touch/basic-multi-touch-events.html
+++ b/LayoutTests/fast/events/touch/basic-multi-touch-events.html
@@ -4,11 +4,16 @@
<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>
+<!--
+ Touch tests that involve the ontouchstart, ontouchmove, ontouchend or ontouchcancel callbacks
+ should be written in an asynchronous fashion so they can be run on mobile platforms like Android.
+ This template will generate an asynchronous style test by using the js-test-post-function script.
+ You will need to invoke isSuccessfullyParsed() in your test script when the test completes.
+-->
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script src="script-tests/basic-multi-touch-events.js"></script>
-
</body>
</html>
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 ec168cb..47fa08a 100644
--- a/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt
+++ b/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt
@@ -32,10 +32,10 @@ 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
-PASS lastEvent.touches[0].clientY is 15
+PASS lastEvent.touches[0].pageX is 50
+PASS lastEvent.touches[0].pageY is 50
+PASS lastEvent.touches[0].clientX is 50
+PASS lastEvent.touches[0].clientY is 50
PASS lastEvent.touches[0].identifier is 0
PASS lastEvent.shiftKey is true
PASS lastEvent.altKey is true
@@ -47,10 +47,10 @@ 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
-PASS lastEvent.changedTouches[0].clientY is 15
+PASS lastEvent.changedTouches[0].pageX is 50
+PASS lastEvent.changedTouches[0].pageY is 50
+PASS lastEvent.changedTouches[0].clientX is 50
+PASS lastEvent.changedTouches[0].clientY is 50
PASS lastEvent.changedTouches[0].identifier is 0
PASS lastEvent.shiftKey is false
PASS lastEvent.altKey is false
diff --git a/LayoutTests/fast/events/touch/basic-single-touch-events.html b/LayoutTests/fast/events/touch/basic-single-touch-events.html
index 4f870f4..cd841a1 100644
--- a/LayoutTests/fast/events/touch/basic-single-touch-events.html
+++ b/LayoutTests/fast/events/touch/basic-single-touch-events.html
@@ -4,6 +4,12 @@
<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>
+<!--
+ Touch tests that involve the ontouchstart, ontouchmove, ontouchend or ontouchcancel callbacks
+ should be written in an asynchronous fashion so they can be run on mobile platforms like Android.
+ This template will generate an asynchronous style test by using the js-test-post-function script.
+ You will need to invoke isSuccessfullyParsed() in your test script when the test completes.
+-->
</head>
<body>
<p id="description"></p>
diff --git a/LayoutTests/fast/events/touch/create-touch-event.html b/LayoutTests/fast/events/touch/create-touch-event.html
index ace4459..17aa183 100644
--- a/LayoutTests/fast/events/touch/create-touch-event.html
+++ b/LayoutTests/fast/events/touch/create-touch-event.html
@@ -7,7 +7,7 @@
<body>
<p id="description"></p>
<div id="console"></div>
-<script src="script-tests/create-touch-event.js"></script>
+<script src="resources/create-touch-event.js"></script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>
diff --git a/LayoutTests/fast/events/touch/script-tests/create-touch-event.js b/LayoutTests/fast/events/touch/resources/create-touch-event.js
index 78295d6..78295d6 100644
--- a/LayoutTests/fast/events/touch/script-tests/create-touch-event.js
+++ b/LayoutTests/fast/events/touch/resources/create-touch-event.js
diff --git a/LayoutTests/fast/events/touch/resources/send-touch-up.html b/LayoutTests/fast/events/touch/resources/send-touch-up.html
new file mode 100644
index 0000000..8b7380f
--- /dev/null
+++ b/LayoutTests/fast/events/touch/resources/send-touch-up.html
@@ -0,0 +1,39 @@
+<html>
+<head>
+<title></title>
+<script type='text/javascript'>
+function doGC()
+{
+ if (window.GCController)
+ return GCController.collect();
+
+ if (window.gc)
+ return window.gc();
+
+ for (var i = 0; i < 10000; i++)
+ var s = new String("");
+}
+
+function sendTouchUp()
+{
+ doGC();
+ // This touchend will cause a crash if the bug is present.
+ eventSender.releaseTouchPoint(0);
+ eventSender.touchEnd();
+ // This touchstart will finish the test when we don't crash.
+ eventSender.addTouchPoint(10,10);
+ eventSender.touchStart();
+}
+
+function finishTest(e)
+{
+ layoutTestController.notifyDone();
+}
+
+document.ontouchstart = finishTest;
+</script>
+</head>
+<body onload="sendTouchUp();">
+<p>If the test doesn't crash, then PASS</p>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/touch/resources/touch-stale-node-crash.js b/LayoutTests/fast/events/touch/resources/touch-stale-node-crash.js
new file mode 100644
index 0000000..c546a69
--- /dev/null
+++ b/LayoutTests/fast/events/touch/resources/touch-stale-node-crash.js
@@ -0,0 +1,20 @@
+document.ontouchstart = touchStartHandler;
+
+function touchStartHandler(e)
+{
+ var target = e.touches[0].target;
+ document.body.removeChild(target);
+ window.location = 'resources/send-touch-up.html';
+}
+
+description("If this test does not crash then you pass!");
+
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+if (window.eventSender) {
+ eventSender.clearTouchPoints();
+ eventSender.addTouchPoint(50, 150);
+ eventSender.touchStart();
+} else
+ debug('This test requires DRT.');
diff --git a/LayoutTests/fast/events/touch/script-tests/TEMPLATE.html b/LayoutTests/fast/events/touch/script-tests/TEMPLATE.html
index 1951c43..fd006b9 100644
--- a/LayoutTests/fast/events/touch/script-tests/TEMPLATE.html
+++ b/LayoutTests/fast/events/touch/script-tests/TEMPLATE.html
@@ -3,11 +3,17 @@
<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>
+<!--
+ Touch tests that involve the ontouchstart, ontouchmove, ontouchend or ontouchcancel callbacks
+ should be written in an asynchronous fashion so they can be run on mobile platforms like Android.
+ This template will generate an asynchronous style test by using the js-test-post-function script.
+ You will need to invoke isSuccessfullyParsed() in your test script when the test completes.
+-->
</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-single-touch-events.js b/LayoutTests/fast/events/touch/script-tests/basic-single-touch-events.js
index 9975c87..756f49e 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
@@ -62,7 +62,7 @@ function verifyTouch(which) {
break;
case 1:
verifyTouchEvent("touchmove", 1, 1, 1);
- verifyTouchPoint("touches", 0, 20, 15, 0);
+ verifyTouchPoint("touches", 0, 50, 50, 0);
shouldBe("lastEvent.shiftKey", "true");
shouldBe("lastEvent.altKey", "true");
shouldBe("lastEvent.ctrlKey", "false");
@@ -70,7 +70,7 @@ function verifyTouch(which) {
break;
case 2:
verifyTouchEvent("touchend", 0, 1, 0);
- verifyTouchPoint("changedTouches", 0, 20, 15, 0);
+ verifyTouchPoint("changedTouches", 0, 50, 50, 0);
shouldBe("lastEvent.shiftKey", "false");
shouldBe("lastEvent.altKey", "false");
break;
@@ -92,7 +92,7 @@ function singleTouchSequence()
eventSender.addTouchPoint(10, 10);
eventSender.touchStart();
- eventSender.updateTouchPoint(0, 20, 15);
+ eventSender.updateTouchPoint(0, 50, 50);
eventSender.setTouchModifier("shift", true);
eventSender.setTouchModifier("alt", true);
eventSender.touchMove();
@@ -106,7 +106,7 @@ function singleTouchSequence()
function touchTargets()
{
- eventSender.addTouchPoint(10, 10);
+ eventSender.addTouchPoint(20, 20);
eventSender.touchStart();
eventSender.updateTouchPoint(0, 1000, 1000);
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 01eac2f..c83daa4 100644
--- a/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js
+++ b/LayoutTests/fast/events/touch/script-tests/send-oncancel-event.js
@@ -13,6 +13,7 @@ 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
index 0623811..8e47f23 100644
--- a/LayoutTests/fast/events/touch/script-tests/touch-target.js
+++ b/LayoutTests/fast/events/touch/script-tests/touch-target.js
@@ -1,3 +1,6 @@
+var targetsDiv = document.createElement("div");
+targetsDiv.id = "targetsDiv";
+
var div1 = document.createElement("div");
div1.id = "targetA";
div1.style.width = "100px";
@@ -13,9 +16,10 @@ 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);
+document.body.insertBefore(targetsDiv, document.getElementById('console'));
+targetsDiv.appendChild(div1);
+targetsDiv.appendChild(document.createElement('br'));
+targetsDiv.appendChild(div2);
function touchStartHandler()
{
diff --git a/LayoutTests/fast/events/touch/send-oncancel-event.html b/LayoutTests/fast/events/touch/send-oncancel-event.html
index 5665c0c..0c913fb 100644
--- a/LayoutTests/fast/events/touch/send-oncancel-event.html
+++ b/LayoutTests/fast/events/touch/send-oncancel-event.html
@@ -3,11 +3,17 @@
<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>
+<!--
+ Touch tests that involve the ontouchstart, ontouchmove, ontouchend or ontouchcancel callbacks
+ should be written in an asynchronous fashion so they can be run on mobile platforms like Android.
+ This template will generate an asynchronous style test by using the js-test-post-function script.
+ You will need to invoke isSuccessfullyParsed() in your test script when the test completes.
+-->
</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-stale-node-crash-expected.txt b/LayoutTests/fast/events/touch/touch-stale-node-crash-expected.txt
new file mode 100644
index 0000000..cec9f36
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-stale-node-crash-expected.txt
@@ -0,0 +1 @@
+If the test doesn't crash, then PASS
diff --git a/LayoutTests/fast/events/touch/touch-stale-node-crash.html b/LayoutTests/fast/events/touch/touch-stale-node-crash.html
new file mode 100644
index 0000000..5e1c65a
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-stale-node-crash.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 style="background-color:red;height:100px;width:100px;"></div>
+<div id="console"></div>
+<script src="resources/touch-stale-node-crash.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/touch/touch-target.html b/LayoutTests/fast/events/touch/touch-target.html
index dfd8dab..3447e73 100644
--- a/LayoutTests/fast/events/touch/touch-target.html
+++ b/LayoutTests/fast/events/touch/touch-target.html
@@ -4,10 +4,15 @@
<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>
+<!--
+ Touch tests that involve the ontouchstart, ontouchmove, ontouchend or ontouchcancel callbacks
+ should be written in an asynchronous fashion so they can be run on mobile platforms like Android.
+ This template will generate an asynchronous style test by using the js-test-post-function script.
+ You will need to invoke isSuccessfullyParsed() in your test script when the test completes.
+-->
</head>
<body>
<p id="description"></p>
-<div id="targetsDiv"></div>
<div id="console"></div>
<script src="script-tests/touch-target.js"></script>
</body>