1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 02:13:56 +09:00

LibWeb: Make request-animation-frame-order test async

Even though this test worked fine, it does use requestAnimationFrame
callbacks, so lets make it async to ensure it doesn't timeout.
This commit is contained in:
Matthew Olsson 2024-03-30 09:56:07 -07:00 committed by Andreas Kling
parent 328ad9a2f0
commit c7c7ed780b
Notes: sideshowbarker 2024-07-17 09:47:09 +09:00

View file

@ -2,12 +2,20 @@
<div id="foo"></div> <div id="foo"></div>
<script src="include.js"></script> <script src="include.js"></script>
<script> <script>
test(() => { asyncTest(done => {
let animFrameCallCount = 0;
function animFrameCb(i) {
println(i);
animFrameCallCount++;
if (animFrameCallCount === 20)
done();
}
for (let i = 0; i < 20; i++) { for (let i = 0; i < 20; i++) {
// FIXME: Workaround for https://github.com/SerenityOS/serenity/issues/23552 // FIXME: Workaround for https://github.com/SerenityOS/serenity/issues/23552
let x = i; let x = i;
requestAnimationFrame(() => { requestAnimationFrame(() => {
println(x); animFrameCb(x);
}); });
} }
}); });