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/test_group_wheelevents.html | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream/1%115.7.0.tar.xz thunderbird-upstream/1%115.7.0.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/test_group_wheelevents.html')
-rw-r--r-- | gfx/layers/apz/test/mochitest/test_group_wheelevents.html | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/test_group_wheelevents.html b/gfx/layers/apz/test/mochitest/test_group_wheelevents.html new file mode 100644 index 0000000000..34e243f679 --- /dev/null +++ b/gfx/layers/apz/test/mochitest/test_group_wheelevents.html @@ -0,0 +1,84 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <title>Various wheel-scrolling tests that spawn in new windows</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <script type="application/javascript" src="apz_test_utils.js"></script> + <script type="application/javascript" src="apz_test_native_event_utils.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> + <script type="application/javascript"> + +var prefs = [ + // turn off smooth scrolling so that we don't have to wait for + // APZ animations to finish before sampling the scroll offset + ["general.smoothScroll", false], + // ensure that any mouse movement will trigger a new wheel transaction, + // because in this test we move the mouse a bunch and want to recalculate + // the target APZC after each such movement. + ["mousewheel.transaction.ignoremovedelay", 0], + ["mousewheel.transaction.timeout", 0], +]; + +// For helper_scroll_over_scrollbar, we need to set a pref to force +// layerization of the scrollbar track to reproduce the bug being fixed. +// Otherwise, the bug only manifests with overlay scrollbars on macOS, +// or in a XUL RCD, both of which are hard to materialize in a test. +var scrollbar_prefs = prefs.slice(); // make a copy +scrollbar_prefs.push(["layout.scrollbars.always-layerize-track", true]); + +// For helper_overscroll_behavior_bug1425573, we need to set the APZ content +// response timeout to 0, so we exercise the fallback codepath. +var timeout_prefs = prefs.slice(); // make a copy +timeout_prefs.push(["apz.content_response_timeout", 0]); + +var smoothness_prefs = [ + ["apz.test.logging_enabled", true], + // We'd want to test real wheel events rather than pan events. + ["apz.test.mac.synth_wheel_input", true], + // Use a longer animation duration to avoid the situation that the + // animation stops accidentally in between each wheel event. + // If the situation happens, scroll offsets will not change at the moment. + ["general.smoothScroll.mouseWheel.durationMaxMS", 1500], + ["general.smoothScroll.mouseWheel.durationMinMS", 1500] +]; + +var subtests = [ + {"file": "helper_scroll_on_position_fixed.html", "prefs": prefs}, + {"file": "helper_bug1271432.html", "prefs": prefs}, + {"file": "helper_overscroll_behavior_bug1425573.html", "prefs": timeout_prefs}, + {"file": "helper_overscroll_behavior_bug1425603.html", "prefs": prefs}, + {"file": "helper_overscroll_behavior_bug1494440.html", "prefs": prefs}, + {"file": "helper_scroll_inactive_perspective.html", "prefs": prefs}, + {"file": "helper_scroll_inactive_zindex.html", "prefs": prefs}, + {"file": "helper_scroll_over_scrollbar.html", "prefs": scrollbar_prefs}, + {"file": "helper_scroll_tables_perspective.html", "prefs": prefs}, + {"file": "helper_relative_scroll_smoothness.html?input-type=wheel&scroll-method=scrollBy", prefs: smoothness_prefs }, + {"file": "helper_relative_scroll_smoothness.html?input-type=wheel&scroll-method=scrollTo", prefs: smoothness_prefs }, + {"file": "helper_relative_scroll_smoothness.html?input-type=wheel&scroll-method=scrollTop", prefs: smoothness_prefs }, + {"file": "helper_transform_end_on_wheel_scroll.html", + prefs: [["general.smoothScroll", false], + ["apz.test.mac.synth_wheel_input", true]]}, + {"file": "helper_scroll_anchoring_on_wheel.html", prefs: smoothness_prefs}, +]; + +// Only Windows has the test api implemented for this test. +if (getPlatform() == "windows") { + subtests.push( + {"file": "helper_dommousescroll.html", "prefs": prefs} + ); +} + +if (isApzEnabled()) { + SimpleTest.waitForExplicitFinish(); + window.onload = function() { + runSubtestsSeriallyInFreshWindows(subtests) + .then(SimpleTest.finish, SimpleTest.finishWithFailure); + }; +} + + </script> +</head> +<body> +</body> +</html> |