summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/test_group_minimum_scale_size.html
blob: 2de924d6bd67525057103d5ab6202dcffeb8706a (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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<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 = [
  // We need the APZ paint logging information
  ["apz.test.logging_enabled", true],
  // Dropping the touch slop to 0 makes the tests easier to write because
  // we can just do a one-pixel drag to get over the pan threshold rather
  // than having to hard-code some larger value.
  ["apz.touch_start_tolerance", "0.0"],
  // The subtests in this test do touch-drags to pan the page, but we don't
  // want those pans to turn into fling animations, so we increase the
  // fling-min threshold velocity to an arbitrarily large value.
  ["apz.fling_min_velocity_threshold", "10000"],
  // The helper_bug1280013's div gets a displayport on scroll, but if the
  // test takes too long the displayport can expire before we read the value
  // out of the test. So we disable displayport expiry for these tests.
  ["apz.displayport_expiry_ms", 0],
  // Similarly, explicitly enable support for meta viewport tags (which the
  // test cases use) so they're processed even on desktop.
  ["dom.meta-viewport.enabled", true],
];

const subtests = [
  { file: "helper_minimum_scale_1_0.html", prefs },
  { file: "helper_no_scalable_with_initial_scale.html", prefs },
];

if (isApzEnabled()) {
  SimpleTest.waitForExplicitFinish();
  // Run the actual test in its own window, because it requires that the
  // root APZC be scrollable. Mochitest pages themselves often run
  // inside an iframe which means we have no control over the root APZC.
  window.onload = () => {
    runSubtestsSeriallyInFreshWindows(subtests)
    .then(SimpleTest.finish, SimpleTest.finishWithFailure);
  };
}
</script>
</head>
<body>
</body>
</html>