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 /dom/events/test/window_bug659071.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/events/test/window_bug659071.html')
-rw-r--r-- | dom/events/test/window_bug659071.html | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/dom/events/test/window_bug659071.html b/dom/events/test/window_bug659071.html new file mode 100644 index 0000000000..bff1bd22a6 --- /dev/null +++ b/dom/events/test/window_bug659071.html @@ -0,0 +1,72 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Test for Bug 659071</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <script src="/tests/SimpleTest/EventUtils.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> +</head> +<body> +<video id="v" controls></video> +<script type="application/javascript"> + +SimpleTest.waitForFocus(startTests, window); +SimpleTest.requestFlakyTimeout("untriaged"); + +function is() +{ + window.opener.is.apply(window.opener, arguments); +} + +function isnot() +{ + window.opener.isnot.apply(window.opener, arguments); +} + +function hitEventLoop(aFunc, aTimes) +{ + if (--aTimes) { + setTimeout(hitEventLoop, 0, aFunc, aTimes); + } else { + setTimeout(aFunc, 20); + } +} + +function startTests() { + SpecialPowers.pushPrefEnv( + {"set": [["mousewheel.with_control.action", 3], + ["test.events.async.enabled", true]]}, + runTests); +} + +function runTests() +{ + synthesizeKey("0", { accelKey: true }); + + var video = document.getElementById("v"); + hitEventLoop(function () { + is(SpecialPowers.getFullZoom(window), 1.0, + "failed to reset zoom"); + synthesizeWheel(video, 10, 10, + { deltaMode: WheelEvent.DOM_DELTA_LINE, ctrlKey: true, + deltaX: 0, deltaY: 1.0, lineOrPageDeltaX: 0, lineOrPageDeltaY: 1 }); + hitEventLoop(function () { + isnot(SpecialPowers.getFullZoom(window), 1.0, + "failed to zoom by ctrl+wheel"); + + synthesizeWheel(video, 10, 10, + { deltaMode: WheelEvent.DOM_DELTA_LINE, ctrlKey: true, + deltaX: 0, deltaY: 1.0, lineOrPageDeltaX: 0, lineOrPageDeltaY: -1 }); + hitEventLoop(function () { + is(SpecialPowers.getFullZoom(window), 1.0, + "failed to reset zoom"); + + hitEventLoop(window.opener.finish, 20); + }, 20); + }, 20); + }, 20); +} + +</script> +</body> +</html> |