summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/test_group_keyboard.html
blob: 4f1bc0d869fea087f168a93b5c1c2b6160e2dcdd (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
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>Various keyboard scrolling tests</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 smoothness_prefs = [
  ["apz.test.logging_enabled", true],
  // The default verticalScrollDistance (which is 3) is too small for native
  // keyboard scrolling, it sometimes produces same scroll offsets in the early
  // stages of the smooth animation.
  ["toolkit.scrollbox.verticalScrollDistance", 5],
  // Use a longer animation duration to avoid the situation that the
  // animation stops accidentally in between each arrow down key press.
  // If the situation happens, scroll offsets will not change at the moment.
  ["general.smoothScroll.lines.durationMaxMS", 1500],
  ["general.smoothScroll.lines.durationMinMS", 1500]
];

var subtests = [
  {"file": "helper_key_scroll.html", prefs: [["apz.test.logging_enabled", true],
                                             ["test.events.async.enabled", true]]},
  {"file": "helper_bug1674935.html", prefs: []},
  {"file": "helper_bug1719330.html", prefs: [["general.smoothScroll", false]]},
  {"file": "helper_relative_scroll_smoothness.html?input-type=key&scroll-method=scrollBy",
    prefs: smoothness_prefs },
  {"file": "helper_relative_scroll_smoothness.html?input-type=native-key&scroll-method=scrollBy",
    prefs: smoothness_prefs },
  {"file": "helper_relative_scroll_smoothness.html?input-type=native-key&scroll-method=scrollTo",
    prefs: smoothness_prefs },
  {"file": "helper_relative_scroll_smoothness.html?input-type=native-key&scroll-method=scrollTop",
    prefs: smoothness_prefs },
  {"file": "helper_bug1695598.html"},
  {"file": "helper_scroll_snap_on_page_down_scroll.html"},
  {"file": "helper_scroll_snap_on_page_down_scroll.html",
    prefs: [["test.events.async.enabled", true]]},
  {"file": "helper_transform_end_on_keyboard_scroll.html",
    prefs: [["general.smoothScroll", false]] },
];

if (isKeyApzEnabled()) {
  SimpleTest.waitForExplicitFinish();
  window.onload = function() {
    runSubtestsSeriallyInFreshWindows(subtests)
    .then(SimpleTest.finish, SimpleTest.finishWithFailure);
  };
} else {
  SimpleTest.ok(true, "Keyboard APZ is disabled");
}
  </script>
</head>
<body>
  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1383365">Async key scrolling test</a>
</body>
</html>