Chromium Code Reviews| Index: LayoutTests/web-animations-api/w3c/ignored-keyframes.html |
| diff --git a/LayoutTests/web-animations-api/w3c/ignored-keyframes.html b/LayoutTests/web-animations-api/w3c/ignored-keyframes.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ec41cde17224e1a1c6ef7e1a6cdb326f250f0615 |
| --- /dev/null |
| +++ b/LayoutTests/web-animations-api/w3c/ignored-keyframes.html |
| @@ -0,0 +1,79 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script src="resources/keyframes-test.js"></script> |
| +<script> |
| +var keyframeA = {opacity: '0', left: '0px'}; |
| +var keyframeB = {opacity: '0.5', left: '50px'}; |
| + |
| +function createBadOffsetKeyframe(offset) { |
| + return {opacity: '1', left: '100px', offset: offset}; |
| +} |
| + |
| +var expectations = { |
|
Eric Willigers
2014/06/30 00:31:44
Could add a comment that interpolation from keyfra
|
| + 0: {opacity: '0', left: '0px'}, |
| + 0.25: {opacity: '0.125', left: '12.5px'}, |
| + 0.5: {opacity: '0.25', left: '25px'}, |
| + 0.75: {opacity: '0.375', left: '37.5px'}, |
| + 1: {opacity: '0.5', left: '50px'}, |
| +}; |
| + |
| +function testBadOffsetvalues(badOffsets) { |
| + badOffsets.forEach(function (badOffset) { |
| + var badOffsetKeyframe = createBadOffsetKeyframe(badOffset); |
|
Eric Willigers
2014/06/30 00:31:44
Please add a comment that this keyframe should be
|
| + var keyframeCases = { |
| + 'case A': [ |
| + badOffsetKeyframe, |
| + keyframeA, |
| + keyframeB, |
| + ], |
| + 'case B': [ |
| + keyframeA, |
| + badOffsetKeyframe, |
| + keyframeB, |
| + ], |
| + 'case C': [ |
| + keyframeA, |
| + keyframeB, |
| + badOffsetKeyframe, |
| + ], |
| + 'case D': [ |
| + badOffsetKeyframe, |
| + keyframeA, |
| + badOffsetKeyframe, |
| + keyframeB, |
| + badOffsetKeyframe, |
| + ], |
| + }; |
| + for (var caseLabel in keyframeCases) { |
| + assertAnimationStyles(keyframeCases[caseLabel], expectations, caseLabel); |
| + } |
| + }); |
| +} |
| + |
| +test(function() { |
| + testBadOffsetvalues(['garbage', NaN, undefined, {non: 'number'}]); |
| +}, |
| +'element.animate() with keyframes that have non-numeric offset values', |
| +{ |
| + help: 'http://dev.w3.org/fxtf/web-animations/#the-keyframe-dictionary', |
| + assert: [ |
| + 'element.animate() should start an animation when keyframes have non-numeric offset values.', |
| + 'Keyframes with non-numeric offsets should be ignored as input.', |
| + ], |
| + author: 'Alan Cutter', |
| +}); |
| + |
| +test(function() { |
| + testBadOffsetvalues([-0.1, -Math.PI, -1, Math.PI, 400, 2200]); |
| +}, |
| +'element.animate() with keyframes that have offset values beyond the range [0, 1]', |
| +{ |
| + help: 'http://dev.w3.org/fxtf/web-animations/#the-keyframe-dictionary', |
| + assert: [ |
| + 'element.animate() should start an animation when keyframes have offset values beyond the range [0, 1].', |
| + 'Keyframes with offsets beyond the range [0, 1] should be ignored as input.', |
| + ], |
| + author: 'Alan Cutter', |
| +}); |
| +</script> |