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

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

Issue 2610243002: Import wpt@5e1a3b80cea8d36774d2afd78b29a74792e9f15a (Closed)
Patch Set: Rebased Created 3 years, 11 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 27 matching lines...) Expand all
38 test(function(t) { 38 test(function(t) {
39 var animation = 39 var animation =
40 new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC), 40 new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC),
41 document.timeline); 41 document.timeline);
42 42
43 animation.startTime = null; 43 animation.startTime = null;
44 assert_equals(animation.currentTime, null); 44 assert_equals(animation.currentTime, null);
45 }, 'The current time is unresolved when the start time is unresolved ' + 45 }, 'The current time is unresolved when the start time is unresolved ' +
46 '(and no hold time is set)'); 46 '(and no hold time is set)');
47 47
48 promise_test(function(t) { 48 test(function(t) {
49 var animation = 49 var animation =
50 new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC), 50 new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC),
51 document.timeline); 51 document.timeline);
52 52
53 animation.playbackRate = 2; 53 animation.playbackRate = 2;
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 </script> 64 </script>
65 </body> 65 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698