Bug 1675375 Part 6: Break test_group_hittest.html into parts. r=botond
[gecko.git] / gfx / layers / apz / test / mochitest / test_group_hittest-2.html
blob8244c26395528358fa844d67404bd34595387b22
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>Various hit-testing tests that spawn in new windows - Part 2</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">
11 var prefs = [
12 // Turn off displayport expiry so that we don't miss failures where the
13 // displayport is set and then expires before we get around to doing the
14 // hit-test inside the activated scrollframe.
15 ["apz.displayport_expiry_ms", 0],
16 // Always layerize the scrollbar track, so as to get consistent results
17 // across platforms. Eventually we should probably get rid of this and make
18 // the tests more robust in terms of testing all the different cross-platform
19 // variations.
20 ["layout.scrollbars.always-layerize-track", true],
21 // We need this pref to allow the synthetic mouse events to propagate to APZ,
22 // and to allow the MozMouseHittest event in particular to be dispatched to
23 // APZ as a MouseInput so the hit result is recorded.
24 ["test.events.async.enabled", true],
25 // Turns on APZTestData logging which we use to obtain the hit test results.
26 ["apz.test.logging_enabled", true],
29 var overscroll_prefs = [...prefs,
30 ["apz.overscroll.enabled", true],
31 ["apz.overscroll.test_async_scroll_offset.enabled", true],
34 var subtests = [
35 {"file": "helper_hittest_pointerevents_svg.html", "prefs": prefs},
36 {"file": "helper_hittest_clippath.html", "prefs": prefs},
37 {"file": "helper_hittest_hoisted_scrollinfo.html", "prefs": prefs},
38 {"file": "helper_hittest_hidden_inactive_scrollframe.html", "prefs": prefs},
39 {"file": "helper_hittest_overscroll.html", "prefs": overscroll_prefs},
40 {"file": "helper_hittest_overscroll_subframe.html", "prefs": overscroll_prefs},
41 {"file": "helper_hittest_overscroll_contextmenu.html", "prefs": overscroll_prefs},
42 // This test should be at the end, because it's prone to timeout.
43 {"file": "helper_hittest_spam.html", "prefs": prefs},
46 function addConditionalTests(tests) {
47 // Add some more tests only useful with WebRender. Note that we do this in
48 // function run after loading, because trying to read layerManagerType can
49 // throw an NS_ERROR_FAILURE if called too early.
50 var utils = SpecialPowers.getDOMWindowUtils(window);
51 var isWebRender = utils.layerManagerType.startsWith("WebRender");
52 if (isWebRender) {
53 // Add new tests at the beginning, to ensure the final test remains in
54 // the final position.
55 tests = [
56 {"file": "helper_hittest_deep_scene_stack.html", "prefs": prefs},
57 ].concat(tests);
59 return tests;
62 if (isApzEnabled()) {
63 SimpleTest.waitForExplicitFinish();
64 window.onload = function() {
65 runSubtestsSeriallyInFreshWindows(addConditionalTests(subtests))
66 .then(SimpleTest.finish, SimpleTest.finishWithFailure);
70 </script>
71 </head>
72 <body>
73 </body>
74 </html>