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:
parent
328ad9a2f0
commit
c7c7ed780b
Notes:
sideshowbarker
2024-07-17 09:47:09 +09:00
Author: https://github.com/mattco98
Commit: c7c7ed780b
Pull-request: https://github.com/SerenityOS/serenity/pull/23774
1 changed files with 10 additions and 2 deletions
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue