mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 14:07:45 +00:00
LibWeb: Add tests for the rest of the Animation properties
This commit is contained in:
parent
e91f4dcd79
commit
dc47210360
10 changed files with 164 additions and 0 deletions
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<div id="foo"></div>
|
||||
<script src="../../include.js"></script>
|
||||
<script>
|
||||
// Note: The "persisted" state will be tested in the Animation.persist() test
|
||||
|
||||
asyncTest(async done => {
|
||||
const foo = document.getElementById("foo");
|
||||
const animation1 = foo.animate({ opacity: [0, 1] }, { duration: 10, fill: "forwards" });
|
||||
println(`Animation's replaceState is active initially: ${animation1.replaceState === "active"}`);
|
||||
|
||||
await animation1.finished;
|
||||
println(`Animation's replaceState is active after finishing: ${animation1.replaceState === "active"}`);
|
||||
|
||||
const animation2 = foo.animate({ opacity: [1, 0] }, { duration: 10, fill: "forwards" });
|
||||
println(`Animation's replaceState is not removed after creating new animation: ${animation1.replaceState === "active"}`);
|
||||
|
||||
await animation2.finished;
|
||||
println(`Animation's replaceState is removed after new animation finishes: ${animation1.replaceState === "removed"}`);
|
||||
|
||||
done();
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue