LibWeb: Use InternalAnimationTimeline in existing tests

This commit is contained in:
Matthew Olsson
2024-03-29 18:40:37 +00:00
committed by Andreas Kling
parent f0119a818b
commit 328ad9a2f0
Notes: sideshowbarker 2024-07-17 07:19:27 +09:00
4 changed files with 13 additions and 14 deletions

View File

@@ -4,15 +4,14 @@
<script>
promiseTest(async () => {
const foo = document.getElementById("foo");
let animation = foo.animate({ opacity: [0, 1] }, { duration: 100 });
const timeline = internals.createInternalAnimationTimeline();
let animation = foo.animate({ opacity: [0, 1] }, { duration: 100, timeline });
let finishedPromise = animation.finished;
// FIXME: Figure out how to consistently test timings
// const currentTime = performance.now();
timeline.setTime(100);
// This should finish. If not, the test will time out and result in a failure
await finishedPromise;
// const elapsedTime = performance.now() - currentTime;
// if (elapsedTime > 95 && elapsedTime < 105)
// println("Animation time after 100ms is correct")
println(`finished promise remains after finishing: ${Object.is(finishedPromise, animation.finished)}`);