diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /gfx/layers/apz/test/mochitest/helper_bug1414336.html | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
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.html | 97 |
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..636328b7e4 --- /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> |