LibWeb: Add some async/animation test utilities

This commit is contained in:
Matthew Olsson 2024-03-29 16:54:12 +00:00 committed by Andreas Kling
commit e298e8af5a
Notes: sideshowbarker 2024-07-16 23:55:09 +09:00
13 changed files with 65 additions and 91 deletions

View file

@ -2,13 +2,7 @@
<div id="foo"></div>
<script src="../../include.js"></script>
<script>
const animationFrame = () => {
const { promise, resolve } = Promise.withResolvers();
requestAnimationFrame(resolve);
return promise;
};
asyncTest(async done => {
promiseTest(async () => {
const foo = document.getElementById("foo");
let anim = foo.animate({}, {});
@ -32,7 +26,5 @@
await animationFrame();
if (anim1.replaceState === "persisted" && anim2.replaceState === "active")
println("persist() keeps an animation from being replaced");
done();
});
</script>