Bug 1841896 - Port helper_fission_scroll_handoff to regular mochitests r=hiro

Differential Revision: https://phabricator.services.mozilla.com/D217162
This commit is contained in:
Alex Jakobi 2024-09-04 14:11:46 +00:00
parent c370b3e602
commit 6dcdb30df6
2 changed files with 20 additions and 24 deletions

View File

@ -43,7 +43,6 @@ add_task(async function test_main() {
file: "helper_fission_tap_in_nested_iframe_on_zoomed.html",
prefs: [["apz.max_tap_time", 10000]],
},
{ file: "helper_fission_scroll_handoff.html" },
{ file: "helper_fission_large_subframe.html" },
{ file: "helper_fission_initial_displayport.html" },
{ file: "helper_fission_checkerboard_severity.html" },

View File

@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>scroll handoff</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
@ -10,41 +11,37 @@
<script src="apz_test_native_event_utils.js"></script>
<script>
fission_subtest_init();
async function test() {
const iframe = document.querySelector("iframe");
await setupCrossOriginIFrame(iframe, "helper_fission_plain.html");
FissionTestHelper.startTestPromise
.then(waitUntilApzStable)
.then(loadOOPIFrame("testframe", "helper_fission_empty.html"))
.then(waitUntilApzStable)
.then(test)
.then(FissionTestHelper.subtestDone, FissionTestHelper.subtestFailed);
let scrollEventPromise = new Promise(resolve => {
window.addEventListener("scroll", resolve, { once: true });
});
async function test() {
let scrollEventPromise = new Promise(resolve => {
window.addEventListener("scroll", resolve, { once: true });
});
await synthesizeNativeWheel(iframe, 100, 100, 0, -50);
await scrollEventPromise;
let iframe = document.getElementById("testframe");
ok(window.scrollY > 0,
"Mouse wheel scrolling on OOP iframes in position:fixed subtree " +
"should be handed off to the parent");
}
await synthesizeNativeWheel(iframe, 100, 100, 0, -50);
await scrollEventPromise;
ok(window.scrollY > 0,
"Mouse wheel scrolling on OOP iframes in position:fixed subtree " +
"should be handed off to the parent");
}
waitUntilApzStable()
.then(test)
.then(subtestDone, subtestFailed);
</script>
</head>
<style>
iframe {
iframe {
position: fixed;
width: 500px;
height: 500px;
}
}
</style>
<body>
<iframe id="testframe"></iframe>
<div style="height:1000vh"></div>
<iframe id="testframe"></iframe>
<div style="height:1000vh"></div>
</body>
</html>