mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-31 22:56:04 +00:00
LibWeb: Add some async/animation test utilities
This commit is contained in:
parent
b2907f62a6
commit
e298e8af5a
Notes:
sideshowbarker
2024-07-16 23:55:09 +09:00
Author: https://github.com/mattco98
Commit: e298e8af5a
Pull-request: https://github.com/SerenityOS/serenity/pull/23774
13 changed files with 65 additions and 91 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue