| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset=utf-8> | 2 <meta charset=utf-8> |
| 3 <title>easing tests</title> | 3 <title>easing tests</title> |
| 4 <link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffect
timing-easing"> | 4 <link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffect
timing-easing"> |
| 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 <script src="../../resources/easing-tests.js"></script> | 8 <script src="../../resources/easing-tests.js"></script> |
| 9 <body> | 9 <body> |
| 10 <div id="log"></div> | 10 <div id="log"></div> |
| 11 <script> | 11 <script> |
| 12 'use strict'; | 12 'use strict'; |
| 13 | 13 |
| 14 test(function(t) { |
| 15 var anim = createDiv(t).animate(null); |
| 16 assert_equals(anim.effect.timing.easing, 'linear'); |
| 17 }, 'Test default value'); |
| 18 |
| 14 function assert_progress(animation, currentTime, easingFunction) { | 19 function assert_progress(animation, currentTime, easingFunction) { |
| 15 animation.currentTime = currentTime; | 20 animation.currentTime = currentTime; |
| 16 var portion = currentTime / animation.effect.timing.duration; | 21 var portion = currentTime / animation.effect.timing.duration; |
| 17 assert_approx_equals(animation.effect.getComputedTiming().progress, | 22 assert_approx_equals(animation.effect.getComputedTiming().progress, |
| 18 easingFunction(portion), | 23 easingFunction(portion), |
| 19 0.01, | 24 0.01, |
| 20 'The progress of the animation should be approximately '
+ | 25 'The progress of the animation should be approximately '
+ |
| 21 easingFunction(portion) + ' at ' + currentTime + 'ms'); | 26 easingFunction(portion) + ' at ' + currentTime + 'ms'); |
| 22 } | 27 } |
| 23 | 28 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 'easing replace to steps(2, start) at active phase'); | 79 'easing replace to steps(2, start) at active phase'); |
| 75 | 80 |
| 76 anim.currentTime = delay + 1500 * MS_PER_SEC; | 81 anim.currentTime = delay + 1500 * MS_PER_SEC; |
| 77 anim.effect.timing.easing = 'steps(2, end)'; | 82 anim.effect.timing.easing = 'steps(2, end)'; |
| 78 assert_equals(anim.effect.getComputedTiming().progress, 1, | 83 assert_equals(anim.effect.getComputedTiming().progress, 1, |
| 79 'easing replace to steps(2, end) again at after phase'); | 84 'easing replace to steps(2, end) again at after phase'); |
| 80 }, 'Change the easing while the animation is running'); | 85 }, 'Change the easing while the animation is running'); |
| 81 | 86 |
| 82 </script> | 87 </script> |
| 83 </body> | 88 </body> |
| OLD | NEW |