mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 07:02:54 +00:00
Even though this test worked fine, it does use requestAnimationFrame callbacks, so lets make it async to ensure it doesn't timeout.
22 lines
580 B
HTML
22 lines
580 B
HTML
<!DOCTYPE html>
|
|
<div id="foo"></div>
|
|
<script src="include.js"></script>
|
|
<script>
|
|
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(() => {
|
|
animFrameCb(x);
|
|
});
|
|
}
|
|
});
|
|
</script>
|