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

Side by Side Diff: LayoutTests/web-animations-api/w3c/ignored-keyframes.html

Issue 253963002: Web Animations API: Add layout tests for element.animate() keyframes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments and naming for 3-keyframes-with-offsets Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="resources/keyframes-test.js"></script>
5 <script>
6 var keyframeA = {opacity: '0', left: '0px'};
7 var keyframeB = {opacity: '0.5', left: '50px'};
8
9 function createBadOffsetKeyframe(offset) {
10 return {opacity: '1', left: '100px', offset: offset};
11 }
12
13 var expectations = {
Eric Willigers 2014/06/30 00:31:44 Could add a comment that interpolation from keyfra
14 0: {opacity: '0', left: '0px'},
15 0.25: {opacity: '0.125', left: '12.5px'},
16 0.5: {opacity: '0.25', left: '25px'},
17 0.75: {opacity: '0.375', left: '37.5px'},
18 1: {opacity: '0.5', left: '50px'},
19 };
20
21 function testBadOffsetvalues(badOffsets) {
22 badOffsets.forEach(function (badOffset) {
23 var badOffsetKeyframe = createBadOffsetKeyframe(badOffset);
Eric Willigers 2014/06/30 00:31:44 Please add a comment that this keyframe should be
24 var keyframeCases = {
25 'case A': [
26 badOffsetKeyframe,
27 keyframeA,
28 keyframeB,
29 ],
30 'case B': [
31 keyframeA,
32 badOffsetKeyframe,
33 keyframeB,
34 ],
35 'case C': [
36 keyframeA,
37 keyframeB,
38 badOffsetKeyframe,
39 ],
40 'case D': [
41 badOffsetKeyframe,
42 keyframeA,
43 badOffsetKeyframe,
44 keyframeB,
45 badOffsetKeyframe,
46 ],
47 };
48 for (var caseLabel in keyframeCases) {
49 assertAnimationStyles(keyframeCases[caseLabel], expectations, caseLabel);
50 }
51 });
52 }
53
54 test(function() {
55 testBadOffsetvalues(['garbage', NaN, undefined, {non: 'number'}]);
56 },
57 'element.animate() with keyframes that have non-numeric offset values',
58 {
59 help: 'http://dev.w3.org/fxtf/web-animations/#the-keyframe-dictionary',
60 assert: [
61 'element.animate() should start an animation when keyframes have non-numeric offset values.',
62 'Keyframes with non-numeric offsets should be ignored as input.',
63 ],
64 author: 'Alan Cutter',
65 });
66
67 test(function() {
68 testBadOffsetvalues([-0.1, -Math.PI, -1, Math.PI, 400, 2200]);
69 },
70 'element.animate() with keyframes that have offset values beyond the range [0, 1 ]',
71 {
72 help: 'http://dev.w3.org/fxtf/web-animations/#the-keyframe-dictionary',
73 assert: [
74 'element.animate() should start an animation when keyframes have offset valu es beyond the range [0, 1].',
75 'Keyframes with offsets beyond the range [0, 1] should be ignored as input.' ,
76 ],
77 author: 'Alan Cutter',
78 });
79 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698