2 <script src=
"../resources/testharness.js"></script>
3 <script src=
"../resources/testharnessreport.js"></script>
5 <!-- This tests that animation timeline current time affects players correctly. -->
7 <div id='element'
></div>
10 async_test(function(t
) {
11 var player
= element
.animate([], 10);
12 var readyPromise
= player
.ready
.then(function() {
14 assert_equals(player
.currentTime
, 0);
15 document
.timeline
.currentTime
= player
.startTime
+ 5;
16 assert_approx_equals(player
.currentTime
, 5, 0.1);
17 assert_equals(player
.playState
, "running");
19 document
.timeline
.currentTime
= player
.startTime
+ 15;
20 assert_approx_equals(player
.currentTime
, 10, 0.1);
21 assert_equals(player
.playState
, "finished");
23 document
.timeline
.currentTime
= player
.startTime
;
24 assert_equals(player
.currentTime
, 0);
25 assert_equals(player
.playState
, "running");
27 document
.timeline
.currentTime
= player
.startTime
+ 5;
28 assert_approx_equals(player
.currentTime
, 5, 0.1);
29 assert_equals(player
.playState
, "running");
33 }, 'Animation players are retriggered if timeline time changes');