summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/helper_bug1414336.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /gfx/layers/apz/test/mochitest/helper_bug1414336.html
parentInitial commit. (diff)
downloadfirefox-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 'gfx/layers/apz/test/mochitest/helper_bug1414336.html')
-rw-r--r--gfx/layers/apz/test/mochitest/helper_bug1414336.html97
1 files changed, 97 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/helper_bug1414336.html b/gfx/layers/apz/test/mochitest/helper_bug1414336.html
new file mode 100644
index 0000000000..6fc6481bba
--- /dev/null
+++ b/gfx/layers/apz/test/mochitest/helper_bug1414336.html
@@ -0,0 +1,97 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1414336
+-->
+<head>
+ <meta charset="utf-8">
+ <title>Test for Bug 1414336</title>
+ <script src="/tests/SimpleTest/EventUtils.js"></script>
+ <script type="text/javascript" src="apz_test_native_event_utils.js"></script>
+ <script type="text/javascript" src="apz_test_utils.js"></script>
+ <script src="/tests/SimpleTest/paint_listener.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+ <style>
+ #target0 {
+ width: 200px;
+ height: 400px;
+ touch-action: auto;
+ }
+ </style>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1414336">Mozilla Bug 1414336</a>
+<p id="display"></p>
+<div id="target0">
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+ <p>Test bug1414336</p>
+</div>
+<script type="text/javascript">
+/** Test for Bug 1414336 **/
+waitUntilApzStable().then(async () => {
+ let target0 = window.document.getElementById("target0");
+ let target0_events = ["pointerdown", "pointermove"];
+
+ target0_events.forEach((elem, index, arr) => {
+ target0.addEventListener(elem, (event) => {
+ is(event.type, target0_events[0], "receive " + event.type + " on target0");
+ target0_events.shift();
+ }, { once: true });
+ });
+
+ target0.addEventListener("pointercancel", (event) => {
+ ok(false, "Shouldn't receive pointercancel when content prevents default on touchstart");
+ // Wait until the event is done processing before we end the subtest,
+ // otherwise on Android the pointer events pref is flipped back to false
+ // and debug builds will assert.
+ setTimeout(subtestDone, 0);
+ }, { once: true });
+
+ target0.addEventListener("touchstart", (event) => {
+ event.preventDefault();
+ }, { once: true });
+
+ target0.addEventListener("pointerup", (event) => {
+ ok(!target0_events.length, " should receive " + target0_events + " on target0");
+ // Wait until the event is done processing before we end the subtest,
+ // otherwise on Android the pointer events pref is flipped back to false
+ // and debug builds will assert.
+ setTimeout(subtestDone, 0);
+ }, { once: true });
+
+ await synthesizeNativeTouchDrag(target0, 2, 2, 0, 80);
+});
+
+</script>
+</body>
+</html>