summaryrefslogtreecommitdiffstats
path: root/LayoutTests
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-10-17 16:33:00 +0100
committerBen Murdoch <benm@google.com>2010-10-17 17:20:39 +0100
commit5013a3fb99f9ca1c7be4319cdebc7cddcaa56d7c (patch)
tree8639bb88ada9e441b06d65d4676e473662d32521 /LayoutTests
parentf6b396da7ac510af40b99ef1f2b0d9063cb8577c (diff)
downloadexternal_webkit-5013a3fb99f9ca1c7be4319cdebc7cddcaa56d7c.zip
external_webkit-5013a3fb99f9ca1c7be4319cdebc7cddcaa56d7c.tar.gz
external_webkit-5013a3fb99f9ca1c7be4319cdebc7cddcaa56d7c.tar.bz2
DO NOT MERGE Implement the document.createTouch, createTouchList APIs
Cherry pick to Gingerbread to enable HTML5 video playback on some sites that look for certain APIs to determine player compatability. Do not merge. Bug: 3101402 Change-Id: Id54f4cbac23208249922c3ef44086c8d9828d32c
Diffstat (limited to 'LayoutTests')
-rw-r--r--LayoutTests/fast/events/touch/document-create-touch-expected.txt24
-rw-r--r--LayoutTests/fast/events/touch/document-create-touch-list-expected.txt14
-rw-r--r--LayoutTests/fast/events/touch/document-create-touch-list.html19
-rw-r--r--LayoutTests/fast/events/touch/document-create-touch.html19
-rw-r--r--LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js12
-rw-r--r--LayoutTests/fast/events/touch/script-tests/document-create-touch.js31
6 files changed, 119 insertions, 0 deletions
diff --git a/LayoutTests/fast/events/touch/document-create-touch-expected.txt b/LayoutTests/fast/events/touch/document-create-touch-expected.txt
new file mode 100644
index 0000000..c1c647f
--- /dev/null
+++ b/LayoutTests/fast/events/touch/document-create-touch-expected.txt
@@ -0,0 +1,24 @@
+This tests support for the document.createTouch API.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS "createTouch" in document is true
+PASS touch is non-null.
+PASS touch.target is box
+PASS touch.identifier is 1
+PASS touch.pageX is 100
+PASS touch.pageY is 101
+PASS touch.screenX is 102
+PASS touch.screenY is 103
+PASS emptyTouch is non-null.
+PASS emptyTouch.target is null
+PASS emptyTouch.identifier is 0
+PASS emptyTouch.pageX is 0
+PASS emptyTouch.pageY is 0
+PASS emptyTouch.screenX is 0
+PASS emptyTouch.screenY is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt b/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt
new file mode 100644
index 0000000..99d578c
--- /dev/null
+++ b/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt
@@ -0,0 +1,14 @@
+This tests support for the document.createTouchList API.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS "createTouchList" in document is true
+PASS touchList is non-null.
+PASS touchList.length is 0
+PASS touchList.item(0) is null
+PASS touchList.item(1) is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch/document-create-touch-list.html b/LayoutTests/fast/events/touch/document-create-touch-list.html
new file mode 100644
index 0000000..bb81531
--- /dev/null
+++ b/LayoutTests/fast/events/touch/document-create-touch-list.html
@@ -0,0 +1,19 @@
+<!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>
+<!--
+ 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/document-create-touch-list.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/touch/document-create-touch.html b/LayoutTests/fast/events/touch/document-create-touch.html
new file mode 100644
index 0000000..ef586fb
--- /dev/null
+++ b/LayoutTests/fast/events/touch/document-create-touch.html
@@ -0,0 +1,19 @@
+<!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>
+<!--
+ 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/document-create-touch.js"></script>
+</body>
+</html>
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
new file mode 100644
index 0000000..9c87c9a
--- /dev/null
+++ b/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js
@@ -0,0 +1,12 @@
+description("This tests support for the document.createTouchList API.");
+
+shouldBeTrue('"createTouchList" in document');
+
+var touchList = document.createTouchList();
+shouldBeNonNull("touchList");
+shouldBe("touchList.length", "0");
+shouldBeNull("touchList.item(0)");
+shouldBeNull("touchList.item(1)");
+
+successfullyParsed = true;
+isSuccessfullyParsed();
diff --git a/LayoutTests/fast/events/touch/script-tests/document-create-touch.js b/LayoutTests/fast/events/touch/script-tests/document-create-touch.js
new file mode 100644
index 0000000..dd383ac
--- /dev/null
+++ b/LayoutTests/fast/events/touch/script-tests/document-create-touch.js
@@ -0,0 +1,31 @@
+description("This tests support for the document.createTouch API.");
+
+shouldBeTrue('"createTouch" in document');
+
+var box = document.createElement("div");
+box.id = "box";
+box.style.width = "100px";
+box.style.height = "100px";
+document.body.appendChild(box);
+
+var target = document.getElementById("box");
+var touch = document.createTouch(window, target, 1, 100, 101, 102, 103);
+shouldBeNonNull("touch");
+shouldBe("touch.target", "box");
+shouldBe("touch.identifier", "1");
+shouldBe("touch.pageX", "100");
+shouldBe("touch.pageY", "101");
+shouldBe("touch.screenX", "102");
+shouldBe("touch.screenY", "103");
+
+var emptyTouch = document.createTouch();
+shouldBeNonNull("emptyTouch");
+shouldBeNull("emptyTouch.target");
+shouldBe("emptyTouch.identifier", "0");
+shouldBe("emptyTouch.pageX", "0");
+shouldBe("emptyTouch.pageY", "0");
+shouldBe("emptyTouch.screenX", "0");
+shouldBe("emptyTouch.screenY", "0");
+
+successfullyParsed = true;
+isSuccessfullyParsed();