| 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 <body></body> | 4 <body></body> |
| 5 <script> | 5 <script> |
| 6 function assertAnimationEffect({keyframes, expect}) { | 6 function assertAnimationEffect({keyframes, expect}) { |
| 7 var target = document.createElement('target'); | 7 var target = document.createElement('target'); |
| 8 document.body.appendChild(target); | 8 document.body.appendChild(target); |
| 9 var animation = target.animate(keyframes, {duration: 1, fill: 'forwards'}); | 9 var animation = target.animate(keyframes, {duration: 1, fill: 'forwards'}); |
| 10 animation.pause(); | 10 animation.pause(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 {at: 0, is: {left: '100px'}}, | 37 {at: 0, is: {left: '100px'}}, |
| 38 {at: 0.25, is: {left: '200px'}}, | 38 {at: 0.25, is: {left: '200px'}}, |
| 39 {at: 0.5, is: {left: '300px'}}, | 39 {at: 0.5, is: {left: '300px'}}, |
| 40 {at: 0.75, is: {left: '250px'}}, | 40 {at: 0.75, is: {left: '250px'}}, |
| 41 {at: 1, is: {left: '200px'}}, | 41 {at: 1, is: {left: '200px'}}, |
| 42 ], | 42 ], |
| 43 }); | 43 }); |
| 44 }, 'Custom iterator with basic keyframes.'); | 44 }, 'Custom iterator with basic keyframes.'); |
| 45 | 45 |
| 46 test(() => { | 46 test(() => { |
| 47 assertAnimationEffect({ |
| 48 keyframes: { |
| 49 left: createIterable([ |
| 50 {done: false, value: '100px'}, |
| 51 {done: false, value: '300px'}, |
| 52 {done: false, value: '200px'}, |
| 53 {done: true}, |
| 54 ]), |
| 55 }, |
| 56 expect: [ |
| 57 {at: 0, is: {left: '100px'}}, |
| 58 {at: 0.25, is: {left: '200px'}}, |
| 59 {at: 0.5, is: {left: '300px'}}, |
| 60 {at: 0.75, is: {left: '250px'}}, |
| 61 {at: 1, is: {left: '200px'}}, |
| 62 ], |
| 63 }); |
| 64 }, 'Custom iterator in property indexed keyframes.'); |
| 65 |
| 66 test(() => { |
| 47 var keyframes = createIterable([ | 67 var keyframes = createIterable([ |
| 48 {done: false, value: {left: '100px'}}, | 68 {done: false, value: {left: '100px'}}, |
| 49 {done: false, value: {left: '300px'}}, | 69 {done: false, value: {left: '300px'}}, |
| 50 {done: false, value: {left: '200px'}}, | 70 {done: false, value: {left: '200px'}}, |
| 51 {done: true}, | 71 {done: true}, |
| 52 ]); | 72 ]); |
| 53 keyframes.easing = 'ease-in-out'; | 73 keyframes.easing = 'ease-in-out'; |
| 54 keyframes.offset = '0.1'; | 74 keyframes.offset = '0.1'; |
| 55 assertAnimationEffect({ | 75 assertAnimationEffect({ |
| 56 keyframes, | 76 keyframes, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 assert_throws({name: 'TypeError'}, () => { | 138 assert_throws({name: 'TypeError'}, () => { |
| 119 assertAnimationEffect({ | 139 assertAnimationEffect({ |
| 120 keyframes: createIterable([ | 140 keyframes: createIterable([ |
| 121 {done: false, value: {left: ['100px', '200px']}}, | 141 {done: false, value: {left: ['100px', '200px']}}, |
| 122 {done: true}, | 142 {done: true}, |
| 123 ]), | 143 ]), |
| 124 expect: [], | 144 expect: [], |
| 125 }); | 145 }); |
| 126 }); | 146 }); |
| 127 }, 'Custom iterator with value list in keyframe should throw.'); | 147 }, 'Custom iterator with value list in keyframe should throw.'); |
| 148 |
| 149 test(() => { |
| 150 assert_throws({name: 'TypeError'}, () => { |
| 151 assertAnimationEffect({ |
| 152 keyframes: { |
| 153 left: createIterable([ |
| 154 {done: false, value: {toString: null}}, |
| 155 {done: true}, |
| 156 ]), |
| 157 }, |
| 158 expect: [], |
| 159 }); |
| 160 }); |
| 161 }, 'Custom iterator in property indexed keyframes with null toString method shou
ld throw.'); |
| 128 </script> | 162 </script> |
| OLD | NEW |