Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: third_party/WebKit/LayoutTests/animations/element-animate-iterable-keyframes.html

Issue 2334123002: Web Animations: Support iterator protocol in property indexed keyframe values (Closed)
Patch Set: Add missing null check Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/animations/unstringable-keyframe-value-crash.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/animations/unstringable-keyframe-value-crash.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698