OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta charset=utf-8> | 2 <meta charset=utf-8> |
3 <title>Active time tests</title> | 3 <title>Active time tests</title> |
4 <link rel="help" href="https://w3c.github.io/web-animations/#calculating-the-act
ive-time"> | 4 <link rel="help" href="https://w3c.github.io/web-animations/#calculating-the-act
ive-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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 anim.finish(); | 93 anim.finish(); |
94 assert_equals(anim.effect.getComputedTiming().currentIteration, 1); | 94 assert_equals(anim.effect.getComputedTiming().currentIteration, 1); |
95 assert_times_equal(anim.effect.getComputedTiming().progress, 0.5); | 95 assert_times_equal(anim.effect.getComputedTiming().progress, 0.5); |
96 }, 'Active time in after phase with forwards fill and negative end delay' | 96 }, 'Active time in after phase with forwards fill and negative end delay' |
97 + ' is the active duration + end delay'); | 97 + ' is the active duration + end delay'); |
98 | 98 |
99 test(function(t) { | 99 test(function(t) { |
100 var anim = createDiv(t).animate(null, { duration: 1000, | 100 var anim = createDiv(t).animate(null, { duration: 1000, |
101 iterations: 2.3, | 101 iterations: 2.3, |
102 delay: 500, | 102 delay: 500, |
103 endDelay: -2500, | 103 endDelay: -3000, |
104 fill: 'forwards' }); | 104 fill: 'forwards' }); |
105 anim.finish(); | 105 anim.finish(); |
106 assert_equals(anim.effect.getComputedTiming().currentIteration, 0); | 106 assert_equals(anim.effect.getComputedTiming().currentIteration, 0); |
107 assert_equals(anim.effect.getComputedTiming().progress, 0); | 107 assert_equals(anim.effect.getComputedTiming().progress, 0); |
108 }, 'Active time in after phase with forwards fill and negative end delay' | 108 }, 'Active time in after phase with forwards fill and negative end delay' |
109 + ' greater in magnitude than the active duration is zero'); | 109 + ' greater in magnitude than the active duration is zero'); |
110 | 110 |
111 test(function(t) { | 111 test(function(t) { |
112 var anim = createDiv(t).animate(null, { duration: 1000, | 112 var anim = createDiv(t).animate(null, { duration: 1000, |
113 iterations: 2.3, | 113 iterations: 2.3, |
(...skipping 19 matching lines...) Expand all Loading... |
133 | 133 |
134 test(function(t) { | 134 test(function(t) { |
135 // Create an effect with a non-zero duration so we ensure we're not just | 135 // Create an effect with a non-zero duration so we ensure we're not just |
136 // testing the after-phase behavior. | 136 // testing the after-phase behavior. |
137 var effect = new KeyframeEffect(null, null, 1); | 137 var effect = new KeyframeEffect(null, null, 1); |
138 assert_equals(effect.getComputedTiming().progress, null); | 138 assert_equals(effect.getComputedTiming().progress, null); |
139 }, 'Active time when the local time is unresolved, is unresolved'); | 139 }, 'Active time when the local time is unresolved, is unresolved'); |
140 | 140 |
141 </script> | 141 </script> |
142 </body> | 142 </body> |
OLD | NEW |