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_doubletap_zoom_nothing_listener.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.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_doubletap_zoom_nothing_listener.html')
-rw-r--r-- | gfx/layers/apz/test/mochitest/helper_doubletap_zoom_nothing_listener.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/helper_doubletap_zoom_nothing_listener.html b/gfx/layers/apz/test/mochitest/helper_doubletap_zoom_nothing_listener.html new file mode 100644 index 0000000000..82805fe321 --- /dev/null +++ b/gfx/layers/apz/test/mochitest/helper_doubletap_zoom_nothing_listener.html @@ -0,0 +1,47 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=2100"/> + <title>Check that double tapping when zoomed out and there is nothing to zoom to does not zoom in if this is a non-passive wheel listener</title> + <script src="apz_test_native_event_utils.js"></script> + <script src="apz_test_utils.js"></script> + <script src="/tests/SimpleTest/paint_listener.js"></script> + <script> + +function aListener() { + info("aListener called"); + preventDefault(); +} + +async function test() { + let useTouchpad = (location.search == "?touchpad"); + + let resolution = await getResolution(); + ok(resolution > 0, + "The initial_resolution is " + resolution + ", which is some sane value"); + + document.getElementById("thebody").addEventListener('wheel', aListener, {passive: false}); + await promiseApzFlushedRepaints(); + + // Check that double-tapping does not zoom in + info("sending first double tap"); + await doubleTapOn(document.getElementById("thebody"), 20, 20, useTouchpad); + let prev_resolution = resolution; + resolution = await getResolution(); + ok(resolution == prev_resolution, "The first double-tap did not change the resolution: " + resolution); +} + +waitUntilApzStable() +.then(test) +.then(subtestDone, subtestFailed); + + </script> +<style> + body, html {margin: 0; width: 100%; height: 100%;} +</style> +</head> +<body id="thebody"> + +</body> +</html> |