mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Use InternalAnimationTimeline in existing tests
This commit is contained in:
committed by
Andreas Kling
parent
f0119a818b
commit
328ad9a2f0
Notes:
sideshowbarker
2024-07-17 07:19:27 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/328ad9a2f0 Pull-request: https://github.com/SerenityOS/serenity/pull/23774
@@ -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)}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user