Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <!-- This tests that players get updated even if they have previously had their source content removed or go out of effect. --> | 5 <!-- This tests that players get updated even if they have previously had their source content removed or go out of effect. --> |
| 6 | 6 |
| 7 <div id='element'></div> | 7 <div id='element'></div> |
| 8 | 8 |
| 9 <script> | 9 <script> |
| 10 var element = document.getElementById('element'); | 10 var element = document.getElementById('element'); |
| 11 var animation = new Animation(element, [{left: '0px'}, {left: '100px'}], 10); | 11 var animation = new KeyframeEffect(element, [{left: '0px'}, {left: '100px'}], 10 ); |
|
alancutter (OOO until 2018)
2015/05/05 01:04:51
s/animation/keyframeEffect/
s/players.html/animati
dstockwell
2015/05/05 03:33:25
Done! (but not the file)
| |
| 12 test(function() { | 12 test(function() { |
| 13 var player = document.timeline.play(animation); | 13 var player = document.timeline.play(animation); |
| 14 player.finish(); | 14 player.finish(); |
| 15 assert_equals(getComputedStyle(element).left, 'auto'); | 15 assert_equals(getComputedStyle(element).left, 'auto'); |
| 16 | 16 |
| 17 player.play(); | 17 player.play(); |
| 18 assert_equals(getComputedStyle(element).left, '0px'); | 18 assert_equals(getComputedStyle(element).left, '0px'); |
| 19 | 19 |
| 20 player.finish(); | 20 player.finish(); |
| 21 }, 'Player updated after finish and play'); | 21 }, 'Player updated after finish and play'); |
| 22 | 22 |
| 23 test(function() { | 23 test(function() { |
| 24 var player = document.timeline.play(animation); | 24 var player = document.timeline.play(animation); |
| 25 assert_equals(getComputedStyle(element).left, '0px'); | 25 assert_equals(getComputedStyle(element).left, '0px'); |
| 26 var source = player.source | 26 var source = player.source |
| 27 player.source = null; | 27 player.source = null; |
| 28 assert_equals(getComputedStyle(element).left, 'auto'); | 28 assert_equals(getComputedStyle(element).left, 'auto'); |
| 29 | 29 |
| 30 player.source = source; | 30 player.source = source; |
| 31 assert_equals(getComputedStyle(element).left, '0px'); | 31 assert_equals(getComputedStyle(element).left, '0px'); |
| 32 | 32 |
| 33 player.finish(); | 33 player.finish(); |
| 34 }, 'Player updated after clear and set source'); | 34 }, 'Player updated after clear and set source'); |
| 35 </script> | 35 </script> |
| OLD | NEW |