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

Side by Side Diff: LayoutTests/web-animations-api/timeline-time.html

Issue 215043007: Web Animations: Expose timeline currentTime in IDL (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: isNull not isNullTime Created 6 years, 8 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
« no previous file with comments | « no previous file | Source/core/animation/DocumentTimeline.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 4
5 <body> 5 <body>
6 <div id='e'></div> 6 <div id='element'></div>
7 </body> 7 </body>
8 8
9 <script> 9 <script>
10 var element = document.getElementById('e'); 10 var element = document.getElementById('element');
11 var style = getComputedStyle(element);
12 var duration = 1; 11 var duration = 1;
13 12
14 var animation = new Animation(element, 13 var animation = new Animation(element,
15 [{opacity: '1', offset: 0}, 14 [{opacity: '1', offset: 0},
16 {opacity: '0', offset: 1}], 15 {opacity: '0', offset: 1}],
17 duration); 16 duration);
18 17
19 test(function() { 18 test(function() {
19 var startTime = document.timeline.currentTime;
20 var player = document.timeline.play(animation); 20 var player = document.timeline.play(animation);
21 player.pause(); 21 player.finish();
22 player.currentTime = duration / 2; 22 var finishTime = document.timeline.currentTime;
23 assert_equals(style.opacity, '0.5'); 23 assert_greater_than_equal(startTime, 0);
24 }, 'Calling document.timeline.play() should start an animation.'); 24 assert_equals(startTime, finishTime);
25 }, 'document.timeline.currentTime should not change within a script block.');
25 </script> 26 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/DocumentTimeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698