summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/touch-events/create-touch-touchlist.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/touch-events/create-touch-touchlist.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/touch-events/create-touch-touchlist.html')
-rw-r--r--testing/web-platform/tests/touch-events/create-touch-touchlist.html50
1 files changed, 50 insertions, 0 deletions
diff --git a/testing/web-platform/tests/touch-events/create-touch-touchlist.html b/testing/web-platform/tests/touch-events/create-touch-touchlist.html
new file mode 100644
index 000000000..abd0f4835
--- /dev/null
+++ b/testing/web-platform/tests/touch-events/create-touch-touchlist.html
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>document.createTouch and document.createTouchList Tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="touch-support.js"></script>
+<body>
+<div id="target0"></div>
+<script>
+test(function() {
+ var testTarget = document.getElementById('target0');
+ var touch1 = document.createTouch(window, testTarget, 42, 15, 20, 35, 40);
+ assert_equals(touch1.target, testTarget, "touch.target is target0");
+ assert_equals(touch1.identifier, 42, "touch.identifier is requested value");
+ assert_equals(touch1.pageX, 15, "touch.pageX is requested value");
+ assert_equals(touch1.pageY, 20, "touch.pageY is requested value");
+ assert_equals(touch1.screenX, 35, "touch.screenX is requested value");
+ assert_equals(touch1.screenY, 40, "touch.screenY is requested value");
+}, "document.createTouch exists and creates a Touch object with requested properties");
+
+test(function() {
+ var touchList = document.createTouchList();
+ assert_equals(touchList.length, 0, "touchList.length is 0");
+ check_TouchList_object(touchList);
+}, "document.createTouchList exists and correctly creates a TouchList from zero Touch objects");
+
+test(function() {
+ var testTarget = document.getElementById('target0');
+ var touch1 = document.createTouch(window, testTarget, 42, 15, 20, 35, 40);
+ var touchList = document.createTouchList(touch1);
+ assert_equals(touchList.length, 1, "touchList.length is 1");
+ assert_equals(touchList.item(0), touch1, "touchList.item(0) is touch1");
+ check_TouchList_object(touchList);
+}, "document.createTouchList exists and correctly creates a TouchList from a single Touch");
+
+test(function() {
+ var testTarget = document.getElementById('target0');
+ var touch1 = document.createTouch(window, testTarget, 42, 15, 20, 35, 40);
+ var touch2 = document.createTouch(window, target0, 44, 25, 30, 45, 50);
+ var touchList = document.createTouchList(touch1, touch2);
+ assert_equals(touchList.length, 2, "touchList.length is 2");
+ assert_equals(touchList.item(0), touch1, "touchList.item(0) is touch1");
+ assert_equals(touchList.item(1), touch2, "touchList.item(1) is touch2");
+ check_TouchList_object(touchList);
+}, "document.createTouchList exists and correctly creates a TouchList from two Touch objects");
+</script>
+</head>
+</body>
+</html>