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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/current-time.html

Issue 2697453005: Import wpt@758b3b4cfa805067f36121333ba031e583d3a62c (Closed)
Patch Set: Add -expected.txt files. Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <meta charset=utf-8> 2 <meta charset=utf-8>
3 <title>Tests for current time</title> 3 <title>Tests for current time</title>
4 <link rel="help" href="https://w3c.github.io/web-animations/#current-time"> 4 <link rel="help" href="https://w3c.github.io/web-animations/#current-time">
5 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script> 6 <script src="/resources/testharnessreport.js"></script>
7 <script src="../../testcommon.js"></script> 7 <script src="../../testcommon.js"></script>
8 <body> 8 <body>
9 <div id="log"></div> 9 <div id="log"></div>
10 <script> 10 <script>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 animation.startTime = document.timeline.currentTime - 25 * MS_PER_SEC; 54 animation.startTime = document.timeline.currentTime - 25 * MS_PER_SEC;
55 55
56 var timelineTime = document.timeline.currentTime; 56 var timelineTime = document.timeline.currentTime;
57 var startTime = animation.startTime; 57 var startTime = animation.startTime;
58 var playbackRate = animation.playbackRate; 58 var playbackRate = animation.playbackRate;
59 assert_times_equal(animation.currentTime, 59 assert_times_equal(animation.currentTime,
60 (timelineTime - startTime) * playbackRate, 60 (timelineTime - startTime) * playbackRate,
61 'Animation has a unresolved start time'); 61 'Animation has a unresolved start time');
62 }, 'The current time is calculated from the timeline time, start time and ' + 62 }, 'The current time is calculated from the timeline time, start time and ' +
63 'playback rate'); 63 'playback rate');
64
65 promise_test(function(t) {
66 var animation = createDiv(t).animate(null, 100 * MS_PER_SEC);
67 animation.playbackRate = 0;
68
69 return animation.ready.then(function() {
70 return waitForAnimationFrames(1);
71 }).then(function() {
72 assert_times_equal(animation.currentTime, 0);
73 });
74 }, 'The current time does not progress if playback rate is 0');
75
64 </script> 76 </script>
65 </body> 77 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698