summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/helper_doubletap_zoom_nothing.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /gfx/layers/apz/test/mochitest/helper_doubletap_zoom_nothing.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/layers/apz/test/mochitest/helper_doubletap_zoom_nothing.html')
-rw-r--r--gfx/layers/apz/test/mochitest/helper_doubletap_zoom_nothing.html46
1 files changed, 46 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/helper_doubletap_zoom_nothing.html b/gfx/layers/apz/test/mochitest/helper_doubletap_zoom_nothing.html
new file mode 100644
index 0000000000..12005b3552
--- /dev/null
+++ b/gfx/layers/apz/test/mochitest/helper_doubletap_zoom_nothing.html
@@ -0,0 +1,46 @@
+<!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 zooms in</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>
+
+async function test() {
+ let useTouchpad = (location.search == "?touchpad");
+
+ let resolution = await getResolution();
+ let initial_resolution = resolution;
+ ok(resolution > 0,
+ "The initial_resolution is " + resolution + ", which is some sane value");
+
+ // Check that double-tapping once zooms in
+ await doubleTapOn(document.getElementById("thebody"), 20, 20, useTouchpad);
+ let prev_resolution = resolution;
+ resolution = await getResolution();
+ ok(resolution > prev_resolution, "The first double-tap has increased the resolution to " + resolution);
+
+ // Check that double-tapping again on the same spot zooms out
+ await doubleTapOn(document.getElementById("thebody"), 20, 20, useTouchpad);
+ prev_resolution = resolution;
+ resolution = await getResolution();
+ ok(resolution < prev_resolution, "The second double-tap has decreased the resolution to " + resolution);
+ ok(resolution == initial_resolution, "The second double-tap has decreased the resolution to the start 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>