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

Side by Side Diff: third_party/WebKit/LayoutTests/web-animations-api/w3c/3-keyframes-with-offsets.html

Issue 1720403002: Alternative syntax for element.animate list of keyframes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@animations-keyframeeffect-api
Patch Set: Additional (mismatched-length-list) test; ensure offset is initialized Created 4 years, 9 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
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 <script src="resources/keyframes-test.js"></script> 4 <script src="resources/keyframes-test.js"></script>
5 <script> 5 <script>
6 var keyframeA = {opacity: '0.5', left: '50px'}; 6 var keyframeA = {opacity: '0.5', left: '50px'};
7 var keyframeB = {opacity: '0', left: '0px'}; 7 var keyframeB = {opacity: '0', left: '0px'};
8 var keyframeC = {opacity: '0.75', left: '75px'}; 8 var keyframeC = {opacity: '0.75', left: '75px'};
9 9
10 var keyframeBExpectations = { 10 var keyframeBExpectations = {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 ], 85 ],
86 author: 'Alan Cutter', 86 author: 'Alan Cutter',
87 }); 87 });
88 88
89 test(function() { 89 test(function() {
90 assertAnimationStyles([ 90 assertAnimationStyles([
91 offsetKeyframeA, 91 offsetKeyframeA,
92 offsetKeyframeB, 92 offsetKeyframeB,
93 offsetKeyframeC, 93 offsetKeyframeC,
94 ], offsetKeyframeBExpectations, 'with ordered offsets'); 94 ], offsetKeyframeBExpectations, 'with ordered offsets');
95 assert_throws('InvalidModificationError', function() { 95 assert_throws({name: 'TypeError'}, function() {
96 assertAnimationStyles([ 96 assertAnimationStyles([
97 offsetKeyframeA, 97 offsetKeyframeA,
98 offsetKeyframeC, 98 offsetKeyframeC,
99 offsetKeyframeB, 99 offsetKeyframeB,
100 ], offsetKeyframeBExpectations, 'with unordered offsets (1)'); 100 ], offsetKeyframeBExpectations, 'with unordered offsets (1)');
101 }); 101 });
102 102
103 assert_throws('InvalidModificationError', function() { 103 assert_throws({name: 'TypeError'}, function() {
104 assertAnimationStyles([ 104 assertAnimationStyles([
105 offsetKeyframeB, 105 offsetKeyframeB,
106 offsetKeyframeA, 106 offsetKeyframeA,
107 offsetKeyframeC, 107 offsetKeyframeC,
108 ], offsetKeyframeBExpectations, 'with unordered offsets (2)'); 108 ], offsetKeyframeBExpectations, 'with unordered offsets (2)');
109 }); 109 });
110 110
111 assert_throws('InvalidModificationError', function() { 111 assert_throws({name: 'TypeError'}, function() {
112 assertAnimationStyles([ 112 assertAnimationStyles([
113 offsetKeyframeB, 113 offsetKeyframeB,
114 offsetKeyframeC, 114 offsetKeyframeC,
115 offsetKeyframeA, 115 offsetKeyframeA,
116 ], offsetKeyframeBExpectations, 'with unordered offsets (3)'); 116 ], offsetKeyframeBExpectations, 'with unordered offsets (3)');
117 }); 117 });
118 118
119 assert_throws('InvalidModificationError', function() { 119 assert_throws({name: 'TypeError'}, function() {
120 assertAnimationStyles([ 120 assertAnimationStyles([
121 offsetKeyframeC, 121 offsetKeyframeC,
122 offsetKeyframeA, 122 offsetKeyframeA,
123 offsetKeyframeB, 123 offsetKeyframeB,
124 ], offsetKeyframeBExpectations, 'with unordered offsets (4)'); 124 ], offsetKeyframeBExpectations, 'with unordered offsets (4)');
125 }); 125 });
126 126
127 assert_throws('InvalidModificationError', function() { 127 assert_throws({name: 'TypeError'}, function() {
128 assertAnimationStyles([ 128 assertAnimationStyles([
129 offsetKeyframeC, 129 offsetKeyframeC,
130 offsetKeyframeB, 130 offsetKeyframeB,
131 offsetKeyframeA, 131 offsetKeyframeA,
132 ], offsetKeyframeBExpectations, 'with unordered offsets (5)'); 132 ], offsetKeyframeBExpectations, 'with unordered offsets (5)');
133 }); 133 });
134 }, 134 },
135 'element.animate() with 3 keyframes and 3 offsets specified', 135 'element.animate() with 3 keyframes and 3 offsets specified',
136 { 136 {
137 help: 'http://dev.w3.org/fxtf/web-animations/#keyframe-animation-effects', 137 help: 'http://dev.w3.org/fxtf/web-animations/#keyframe-animation-effects',
138 assert: [ 138 assert: [
139 'element.animate() should start an animation when three keyframes', 139 'element.animate() should start an animation when three keyframes',
140 'are provided with matching properties and all offsets specified.', 140 'are provided with matching properties and all offsets specified.',
141 'The keyframes must maintain their ordering and get distributed', 141 'The keyframes must maintain their ordering and get distributed',
142 'correctly.', 142 'correctly.',
143 ], 143 ],
144 author: 'Alan Cutter', 144 author: 'Alan Cutter',
145 }); 145 });
146 </script> 146 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698