OLD | NEW |
1 <script src="../resources/testharness.js"></script> | 1 <script src="../resources/testharness.js"></script> |
2 <script src="../resources/testharnessreport.js"></script> | 2 <script src="../resources/testharnessreport.js"></script> |
3 <style> | 3 <style> |
4 @keyframes a {} | 4 @keyframes a {} |
5 @keyframes b {} | 5 @keyframes b {} |
6 </style> | 6 </style> |
7 <div id="target"></div> | 7 <div id="target"></div> |
8 <script> | 8 <script> |
9 function setAnimationProperty(value) { | 9 function setAnimationProperty(value) { |
10 target.style.animation = value; | 10 target.style.animation = value; |
11 target.offsetTop; | 11 target.offsetTop; |
12 } | 12 } |
13 | 13 |
14 function getAnimations() { | 14 function getAnimations() { |
15 return document.timeline.getAnimations(); | 15 return document.getAnimations(); |
16 } | 16 } |
17 | 17 |
18 function clearAnimations() { | 18 function clearAnimations() { |
19 setAnimationProperty('none'); | 19 setAnimationProperty('none'); |
20 assert_equals(getAnimations().length, 0); | 20 assert_equals(getAnimations().length, 0); |
21 } | 21 } |
22 | 22 |
23 test(() => { | 23 test(() => { |
24 clearAnimations(); | 24 clearAnimations(); |
25 setAnimationProperty('a 1000ms 1500ms forwards, a 2000ms 2500ms backwards, a 3
000ms 3500ms both'); | 25 setAnimationProperty('a 1000ms 1500ms forwards, a 2000ms 2500ms backwards, a 3
000ms 3500ms both'); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 assert_equals(animations[0].currentTime, 1000); | 130 assert_equals(animations[0].currentTime, 1000); |
131 assert_equals(animations[0].effect.timing.duration, 3500); | 131 assert_equals(animations[0].effect.timing.duration, 3500); |
132 | 132 |
133 assert_equals(animations[1].currentTime, 2000); | 133 assert_equals(animations[1].currentTime, 2000); |
134 assert_equals(animations[1].effect.timing.duration, 2500); | 134 assert_equals(animations[1].effect.timing.duration, 2500); |
135 | 135 |
136 assert_equals(animations[2].currentTime, 0); | 136 assert_equals(animations[2].currentTime, 0); |
137 assert_equals(animations[2].effect.timing.duration, 1500); | 137 assert_equals(animations[2].effect.timing.duration, 1500); |
138 }, 'Adding same animation names should start additional animations from the end
of the name list.'); | 138 }, 'Adding same animation names should start additional animations from the end
of the name list.'); |
139 </script> | 139 </script> |
OLD | NEW |