summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/test_group_wheelevents.html
blob: 34e243f6790a6cc6f9f5e5d6f576a316d642f1e3 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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>