| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharnessreport.js"></script> | |
| 4 <body> | |
| 5 <script> | |
| 6 function infiniteAnimation() { | |
| 7 var anim = document.body.animate([], | |
| 8 {duration: 1000, iterations: Infinity}); | |
| 9 anim.cancel(); | |
| 10 return anim; | |
| 11 } | |
| 12 | |
| 13 test(function() { | |
| 14 var anim = infiniteAnimation(); | |
| 15 try { | |
| 16 anim.finish(); | |
| 17 assert_unreached(); | |
| 18 } catch (e) { | |
| 19 assert_equals(e.code, DOMException.INVALID_STATE_ERR); | |
| 20 } | |
| 21 }, "finishing an infinite animation"); | |
| 22 | |
| 23 test(function() { | |
| 24 var anim = infiniteAnimation(); | |
| 25 anim.playbackRate = -1; | |
| 26 try { | |
| 27 anim.pause(); | |
| 28 assert_unreached(); | |
| 29 } catch (e) { | |
| 30 assert_equals(e.code, DOMException.INVALID_STATE_ERR); | |
| 31 } | |
| 32 }, "pausing a reversed infinite animation"); | |
| 33 | |
| 34 test(function() { | |
| 35 var anim = infiniteAnimation(); | |
| 36 anim.playbackRate = -1; | |
| 37 try { | |
| 38 anim.play(); | |
| 39 assert_unreached(); | |
| 40 } catch (e) { | |
| 41 assert_equals(e.code, DOMException.INVALID_STATE_ERR); | |
| 42 } | |
| 43 }, "playing a reversed infinite animation"); | |
| 44 | |
| 45 test(function() { | |
| 46 var anim = infiniteAnimation(); | |
| 47 try { | |
| 48 anim.reverse(); | |
| 49 assert_unreached(); | |
| 50 } catch (e) { | |
| 51 assert_equals(e.code, DOMException.INVALID_STATE_ERR); | |
| 52 } | |
| 53 }, "reversing an infinite animation"); | |
| 54 </script> | |
| OLD | NEW |