test_group_scroll_snap.html (3672B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Various tests for scroll snap</title> 6 <script src="/tests/SimpleTest/SimpleTest.js"></script> 7 <script type="application/javascript" src="apz_test_utils.js"></script> 8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 9 <script type="application/javascript"> 10 11 const prefs = [ 12 ["general.smoothScroll", false], 13 // ensure that any mouse movement will trigger a new wheel transaction, 14 // because in this test we move the mouse a bunch and want to recalculate 15 // the target APZC after each such movement. 16 ["mousewheel.transaction.ignoremovedelay", 0], 17 ["mousewheel.transaction.timeout", 0], 18 ]; 19 20 const subtests = [ 21 {"file": "helper_scroll_snap_no_valid_snap_position.html", "prefs": prefs}, 22 {"file": "helper_bug1960053_scroll_snap_align_start.html", 23 "prefs": [["apz.test.mac.synth_wheel_input", true]]}, 24 {"file": "helper_scroll_snap_resnap_after_async_scroll.html", 25 // Specify a small `layout.css.scroll-snap.spring-constant` value to 26 // keep the smooth scroll animation running long enough so that we can 27 // trigger a reflow during the animation. 28 // FIXME: This test uses promiseMoveMouseAndScrollWheelOver(), so even 29 // with layout.css.scroll-behavior.same-physics-as-user-input=false, 30 // layout.css.scroll-snap.* prefs have no impact on scroll 31 // animation speed. 32 "prefs": [["layout.css.scroll-snap.spring-constant", 10], 33 ["layout.css.scroll-behavior.same-physics-as-user-input", false], 34 ["apz.test.mac.synth_wheel_input", true]]}, 35 {"file": "helper_scroll_snap_resnap_after_async_scroll.html", 36 "prefs": [["general.smoothScroll", false], 37 ["apz.test.mac.synth_wheel_input", true]]}, 38 {"file": "helper_scroll_snap_resnap_after_async_scrollBy.html", 39 // Same as above helper_scroll_snap_resnap_after_async_scroll.html. 40 "prefs": [["layout.css.scroll-snap.spring-constant", 10], 41 ["layout.css.scroll-behavior.same-physics-as-user-input", false]]}, 42 {"file": "helper_scroll_snap_not_resnap_during_panning.html", 43 // Specify a strong spring constant to make scroll snap animation be 44 // effective in a short span of time. 45 "prefs": [["layout.css.scroll-snap.spring-constant", 1000]]}, 46 {"file": "helper_scroll_snap_not_resnap_during_scrollbar_dragging.html", 47 // Same as above helper_scroll_snap_not_resnap_during_scrollbar_dragging.html. 48 "prefs": [["layout.css.scroll-snap.spring-constant", 1000]]}, 49 {"file": "helper_bug1780701.html"}, 50 {"file": "helper_bug1783936.html", 51 // Shorten the scroll snap animation duration. 52 "prefs": [["layout.css.scroll-snap.spring-constant", 1000], 53 // Avoid fling at the end of pan. 54 ["apz.fling_min_velocity_threshold", "10000"], 55 // This test needs mSimilateMomentum flag on headless mode. 56 ["apz.test.headless.simulate_momentum", true], 57 ["apz.gtk.kinetic_scroll.enabled", true], 58 // Use the pixel mode to make the test predictable easily. 59 ["apz.gtk.kinetic_scroll.delta_mode", 2], 60 ["apz.gtk.kinetic_scroll.pixel_delta_mode_multiplier", 1]]}, 61 {"file": "helper_bug1922904.html", 62 "prefs": [["apz.test.mac.synth_wheel_input", true]]}, 63 {"file": "helper_bug1934118.html", 64 "prefs": [["apz.test.mac.synth_wheel_input", true]]}, 65 ]; 66 67 if (isApzEnabled()) { 68 SimpleTest.waitForExplicitFinish(); 69 window.onload = function() { 70 runSubtestsSeriallyInFreshWindows(subtests) 71 .then(SimpleTest.finish, SimpleTest.finishWithFailure); 72 }; 73 } 74 75 </script> 76 </head> 77 <body> 78 </body> 79 </html>