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
commit c7c7ed780b
Notes: sideshowbarker 2024-07-17 09:47:09 +09:00

View file

@ -2,12 +2,20 @@
<div id="foo"></div>
<script src="include.js"></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++) {
// FIXME: Workaround for https://github.com/SerenityOS/serenity/issues/23552
let x = i;
requestAnimationFrame(() => {
println(x);
animFrameCb(x);
});
}
});