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");
// FIXME: passing a null timeline here is broken, needs [ExplicitNull] support for dictionary members
@ -38,7 +32,5 @@
}
if (anim.playbackRate === -1)
println("reverse() does not update the playback rate if calling play() would throw an exception");
done();
});
</script>