diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/touch-events/touch-retargeting-manual.html | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/touch-events/touch-retargeting-manual.html')
-rw-r--r-- | testing/web-platform/tests/touch-events/touch-retargeting-manual.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/testing/web-platform/tests/touch-events/touch-retargeting-manual.html b/testing/web-platform/tests/touch-events/touch-retargeting-manual.html new file mode 100644 index 0000000000..a90bb48d64 --- /dev/null +++ b/testing/web-platform/tests/touch-events/touch-retargeting-manual.html @@ -0,0 +1,36 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>TouchEvent Retargeting Tests</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> + <h1>Touch retargeting manual test</h1> + <div>This test requires touch input.</div> + <div id="host"></div> +</body> +<script> + var host = document.getElementById("host"); + var root = host.attachShadow({ mode: "open" }); + var target = document.createElement("h2"); + target.textContent = "Tap on THIS line of text"; + root.appendChild(target); + + var test_touch_retargeting = async_test("touch_retargeting"); + + on_event(host, "touchstart", e => { + test_touch_retargeting.step(() => { + assert_equals(e.touches.length, 1, "touches.length is correct"); + assert_equals(e.touches[0].target, host, "touches[0] is retargeted to host"); + + assert_equals(e.targetTouches.length, 1, "targetTouches.length is correct"); + assert_equals(e.targetTouches[0].target, host, "targetTouches[0] is retargeted to host"); + + assert_equals(e.changedTouches.length, 1, "changedTouches.length is correct"); + assert_equals(e.changedTouches[0].target, host, "changedTouches[0] is retargeted to host"); + }); + }); + on_event(host, "touchend", e => test_touch_retargeting.done()); +</script> +</html> |