summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/test_group_scroll_snap.html
blob: 9a1341c503ef44cc1ffee9e8d4c9793da9569989 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>Various tests for scroll snap</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="application/javascript" src="apz_test_utils.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <script type="application/javascript">

const prefs = [
  ["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],
];

const subtests = [
  {"file": "helper_scroll_snap_no_valid_snap_position.html", "prefs": prefs},
  {"file": "helper_scroll_snap_resnap_after_async_scroll.html",
    // Specify a small `layout.css.scroll-behavior.spring-constant` value to
    // keep the smooth scroll animation running long enough so that we can
    // trigger a reflow during the animation.
   "prefs": [["layout.css.scroll-behavior.spring-constant", 10],
             ["apz.test.mac.synth_wheel_input", true]]},
  {"file": "helper_scroll_snap_resnap_after_async_scroll.html",
    "prefs": [["general.smoothScroll", false],
             ["apz.test.mac.synth_wheel_input", true]]},
  {"file": "helper_scroll_snap_resnap_after_async_scrollBy.html",
    // Same as above helper_scroll_snap_resnap_after_async_scroll.html.
   "prefs": [["layout.css.scroll-behavior.spring-constant", 10]]},
  {"file": "helper_scroll_snap_not_resnap_during_panning.html",
    // Specify a strong spring constant to make scroll snap animation be
    // effective in a short span of time.
   "prefs": [["layout.css.scroll-behavior.spring-constant", 1000]]},
  {"file": "helper_scroll_snap_not_resnap_during_scrollbar_dragging.html",
    // Same as above helper_scroll_snap_not_resnap_during_scrollbar_dragging.html.
   "prefs": [["layout.css.scroll-behavior.spring-constant", 1000]]},
  {"file": "helper_bug1780701.html"},
  {"file": "helper_bug1783936.html",
             // Shorten the scroll snap animation duration.
   "prefs": [["layout.css.scroll-behavior.spring-constant", 1000],
             // Avoid fling at the end of pan.
             ["apz.fling_min_velocity_threshold", "10000"],
             // This test needs mSimilateMomentum flag on headless mode.
             ["apz.test.headless.simulate_momentum", true],
             ["apz.gtk.kinetic_scroll.enabled", true],
             // Use the pixel mode to make the test predictable easily.
             ["apz.gtk.kinetic_scroll.delta_mode", 2],
             ["apz.gtk.kinetic_scroll.pixel_delta_mode_multiplier", 1]]},
];

if (isApzEnabled()) {
  SimpleTest.waitForExplicitFinish();
  window.onload = function() {
    runSubtestsSeriallyInFreshWindows(subtests)
    .then(SimpleTest.finish, SimpleTest.finishWithFailure);
  };
}

  </script>
</head>
<body>
</body>
</html>