diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /dom/events/test/test_wheel_zoom_on_form_controls.html | |
parent | Initial commit. (diff) | |
download | firefox-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 'dom/events/test/test_wheel_zoom_on_form_controls.html')
-rw-r--r-- | dom/events/test/test_wheel_zoom_on_form_controls.html | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/dom/events/test/test_wheel_zoom_on_form_controls.html b/dom/events/test/test_wheel_zoom_on_form_controls.html new file mode 100644 index 0000000000..73fc13558c --- /dev/null +++ b/dom/events/test/test_wheel_zoom_on_form_controls.html @@ -0,0 +1,69 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <title>Zoom using wheel should work on form controls</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <script src="/tests/SimpleTest/EventUtils.js"></script> + <link rel="stylesheet" href="/tests/SimpleTest/test.css"/> +</head> +<body> +<p id="display"></p> +<div id="content" style="display: none"></div> +<pre id="test"></pre> +<button id="button" style="width:10px;height:10px;"></button><br> +<input id="input" style="border: 10px solid green;"><br> +<textarea id="textarea" style="border: 10px solid green;"></textarea><br> +<select id="select"><option></option></select> +<select id="list" size=4> + <option>XXXXXXXXXX</option> + <option>XXXXXXXXXX</option> + <option>XXXXXXXXXX</option> + <option>XXXXXXXXXX</option> + <option>XXXXXXXXXX</option> + <option>XXXXXXXXXX</option> +</select> +<script> + + async function testControl(id) { + var initialZoom = SpecialPowers.getFullZoom(window); + var element = document.getElementById(id); + + const zoomHasHappened = SimpleTest.promiseWaitForCondition(() => { + const zoom = SpecialPowers.getFullZoom(window); + return (zoom != initialZoom); + }, id + ": wheel event changed the zoom."); + + let event = { + deltaMode: WheelEvent.DOM_DELTA_LINE, + deltaY: 3, + ctrlKey: true + }; + synthesizeWheel(element, 5, 5, event); + + await zoomHasHappened; + isnot(SpecialPowers.getFullZoom(window), initialZoom, id + ": should have zoomed"); + SpecialPowers.setFullZoom(window, initialZoom); + } + + async function test() { + await testControl("button"); + await testControl("input"); + await testControl("textarea"); + await testControl("select"); + await testControl("list"); + SimpleTest.finish(); + } + + SimpleTest.waitForExplicitFinish(); + SimpleTest.waitForFocus(() => { + SpecialPowers.pushPrefEnv({ + "set":[ + ["mousewheel.with_control.action", 3], // Scroll on Ctrl + mousewheel + ["test.events.async.enabled", true], + ] + }, test) + }); +</script> +</body> +</html> |