Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Unified Diff: third_party/WebKit/LayoutTests/web-animations-api/animation-set-timeline.html

Issue 2138303002: Update timeline-set-current-time to test setting animation timelines instead of document timelines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename file to .txt instead of .html (oops) Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/web-animations-api/animation-set-timeline.html
diff --git a/third_party/WebKit/LayoutTests/web-animations-api/animation-set-timeline.html b/third_party/WebKit/LayoutTests/web-animations-api/animation-set-timeline.html
new file mode 100644
index 0000000000000000000000000000000000000000..728f5c5b0d7e77b714c97a514975854b3c607222
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/web-animations-api/animation-set-timeline.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Animations are retriggered if timeline time changes</title>
+<link rel="help" href="http://w3c.github.io/web-animations/#set-the-timeline-of-an-animation">
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../imported/wpt/web-animations/testcommon.js"></script>
+
+<div id="div"></div>
+
+<script>
+
+promise_test(function(t) {
+ var animation = div.animate([], 10);
+
+ return animation.ready.then(function() {
+ animation.timeline = new DocumentTimeline(-5);
+ animation.startTime = document.timeline.currentTime;
+ assert_times_equal(animation.currentTime, 5);
+ assert_equals(animation.playState, "running");
+
+ animation.timeline = new DocumentTimeline(-15);
+ animation.startTime = document.timeline.currentTime;
+ assert_times_equal(animation.currentTime, 10);
+ assert_equals(animation.playState, "finished");
+
+ animation.timeline = new DocumentTimeline(0);
+ animation.startTime = document.timeline.currentTime;
+ assert_times_equal(animation.currentTime, 0);
+ assert_equals(animation.playState, "running");
+
+ animation.timeline = new DocumentTimeline(-5);
+ animation.startTime = document.timeline.currentTime;
+ assert_times_equal(animation.currentTime, 5);
+ assert_equals(animation.playState, "running");
+ });
+}, 'Animations are retriggered if timeline time changes');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698