diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /gfx/layers/apz/test/mochitest/helper_bug1285070.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/layers/apz/test/mochitest/helper_bug1285070.html')
-rw-r--r-- | gfx/layers/apz/test/mochitest/helper_bug1285070.html | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/helper_bug1285070.html b/gfx/layers/apz/test/mochitest/helper_bug1285070.html new file mode 100644 index 0000000000..0df3a77f4a --- /dev/null +++ b/gfx/layers/apz/test/mochitest/helper_bug1285070.html @@ -0,0 +1,44 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width; initial-scale=1.0"> + <title>Test pointer events are dispatched once for touch tap</title> + <script src="/tests/SimpleTest/paint_listener.js"></script> + <script type="application/javascript" src="apz_test_utils.js"></script> + <script type="application/javascript" src="apz_test_native_event_utils.js"></script> + <script type="application/javascript"> + async function test() { + let eventsList = ["pointerover", "pointerenter", "pointerdown", + "pointerup", "pointerleave", "pointerout", + "mousedown", "mouseup", + "touchstart", "touchend", "click"]; + let eventsCount = {}; + + eventsList.forEach((eventName) => { + eventsCount[eventName] = 0; + document.getElementById("div1").addEventListener(eventName, (event) => { + ++eventsCount[event.type]; + ok(true, "Received event " + event.type); + }); + }); + + document.addEventListener("click", (event) => { + is(event.target, document.getElementById("div1"), "Clicked on div (at " + event.clientX + "," + event.clientY + ")"); + for (var key in eventsCount) { + is(eventsCount[key], 1, "Event " + key + " should be generated once"); + } + subtestDone(); + }); + + await synthesizeNativeTap(document.getElementById("div1"), 100, 100); + } + + waitUntilApzStable().then(test); + + </script> +</head> +<body> + <div id="div1" style="width: 200px; height: 200px; background: black"></div> +</body> +</html> |