summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/touch-events/touch-retargeting.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/touch-retargeting.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/touch-retargeting.html')
-rw-r--r--testing/web-platform/tests/touch-events/touch-retargeting.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/testing/web-platform/tests/touch-events/touch-retargeting.html b/testing/web-platform/tests/touch-events/touch-retargeting.html
new file mode 100644
index 000000000..8d3e83f05
--- /dev/null
+++ b/testing/web-platform/tests/touch-events/touch-retargeting.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>TouchEvent Retargeting Tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="host0"></div>
+<div id="host1"></div>
+<script>
+var host0 = document.getElementById('host0');
+var root0 = host0.attachShadow({ mode: 'open' });
+var target0 = document.createElement('div');
+root0.appendChild(target0);
+
+var host1 = document.getElementById('host1');
+var root1 = host1.attachShadow({ mode: 'open' });
+var target1 = document.createElement('div');
+root1.appendChild(target1);
+
+async_test(function(t) {
+ var touch0 = new Touch({
+ identifier: 0,
+ target: target0,
+ });
+ var touch1 = new Touch({
+ identifier: 1,
+ target: target1,
+ });
+
+ var touchEvent = new TouchEvent("touchstart", {
+ touches: [touch0, touch1],
+ targetTouches: [touch1],
+ changedTouches: [touch1],
+ });
+
+ target0.addEventListener('touchstart', t.step_func_done(function(e) {
+ assert_equals(e.touches.length, 2);
+ assert_equals(e.touches[0].target, target0);
+ assert_equals(e.touches[1].target, host1);
+
+ assert_equals(e.targetTouches.length, 1);
+ assert_equals(e.targetTouches[0].target, host1);
+
+ assert_equals(e.changedTouches.length, 1);
+ assert_equals(e.changedTouches[0].target, host1);
+ }));
+
+ target0.dispatchEvent(touchEvent, { composed: true });
+}, "TouchEvent's touches, targetTouches, and changedTouches should be retargeted.");
+</script>
+</body>
+</html>