Bug 1359786 - only check the mid-point while testing interpolation results in animations' web-platform-tests. draft
authorJeremy Chen <jeremychen@mozilla.com>
Sat, 29 Apr 2017 21:41:43 +0800
changeset 570609 83f74fb346586455f06c4c88612b2f74efbc1071
parent 570578 308cdb913d717f8edc932f5bac93854e3e54b84d
child 570610 9880ee8893f9c837c918493808740442add97193
push id56530
push userjichen@mozilla.com
push dateSat, 29 Apr 2017 13:45:21 +0000
bugs1359786
milestone55.0a1
Bug 1359786 - only check the mid-point while testing interpolation results in animations' web-platform-tests. In case of interpolation, we shall just check at 500ms. No need to check 0ms and 1000ms. MozReview-Commit-ID: FldqRXj0HLo
testing/web-platform/tests/web-animations/animation-model/animation-types/property-types.js
--- a/testing/web-platform/tests/web-animations/animation-model/animation-types/property-types.js
+++ b/testing/web-platform/tests/web-animations/animation-model/animation-types/property-types.js
@@ -80,30 +80,26 @@ const discreteType = {
 const lengthType = {
   testInterpolation: function(property, setup) {
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate({ [idlName]: ['10px', '50px'] },
                                      { duration: 1000, fill: 'both' });
       testAnimationSamples(animation, idlName,
-                           [{ time: 0,    expected: '10px' },
-                            { time: 500,  expected: '30px' },
-                            { time: 1000, expected: '50px' }]);
+                           [{ time: 500,  expected: '30px' }]);
     }, property + ' supports animating as a length');
 
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate({ [idlName]: ['1rem', '5rem'] },
                                      { duration: 1000, fill: 'both' });
       testAnimationSamples(animation, idlName,
-                           [{ time: 0,    expected: '10px' },
-                            { time: 500,  expected: '30px' },
-                            { time: 1000, expected: '50px' }]);
+                           [{ time: 500,  expected: '30px' }]);
     }, property + ' supports animating as a length of rem');
   },
 
   testAddition: function(property, setup) {
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       target.style[idlName] = '10px';
@@ -170,19 +166,17 @@ const lengthPairType = {
 const percentageType = {
   testInterpolation: function(property, setup) {
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate({ [idlName]: ['10%', '50%'] },
                                      { duration: 1000, fill: 'both' });
       testAnimationSamples(animation, idlName,
-                           [{ time: 0,    expected: '10%' },
-                            { time: 500,  expected: '30%' },
-                            { time: 1000, expected: '50%' }]);
+                           [{ time: 500,  expected: '30%' }]);
     }, property + ' supports animating as a percentage');
   },
 
   testAddition: function(property, setup) {
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       target.style[idlName] = '60%';
@@ -197,19 +191,17 @@ const percentageType = {
 const integerType = {
   testInterpolation: function(property, setup) {
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate({ [idlName]: [-2, 2] },
                                      { duration: 1000, fill: 'both' });
       testAnimationSamples(animation, idlName,
-                           [{ time: 0,    expected: '-2' },
-                            { time: 500,  expected: '0' },
-                            { time: 1000, expected: '2' }]);
+                           [{ time: 500,  expected: '0' }]);
     }, property + ' supports animating as an integer');
   },
 
   testAddition: function(property, setup) {
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       target.style[idlName] = -1;
@@ -228,67 +220,55 @@ const lengthPercentageOrCalcType = {
     percentageType.testInterpolation(property, setup);
 
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate({ [idlName]: ['10px', '20%'] },
                                      { duration: 1000, fill: 'both' });
       testAnimationSamples(animation, idlName,
-                           [{ time: 0,    expected: '10px' },
-                            { time: 500,  expected: 'calc(5px + 10%)' },
-                            { time: 1000, expected: '20%' }]);
+                           [{ time: 500,  expected: 'calc(5px + 10%)' }]);
     }, property + ' supports animating as combination units "px" and "%"');
 
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate({ [idlName]: ['10%', '2em'] },
                                      { duration: 1000, fill: 'both' });
       testAnimationSamples(animation, idlName,
-                           [{ time: 0,    expected: '10%' },
-                            { time: 500,  expected: 'calc(10px + 5%)' },
-                            { time: 1000, expected: '20px' }]);
+                           [{ time: 500,  expected: 'calc(10px + 5%)' }]);
     }, property + ' supports animating as combination units "%" and "em"');
 
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate({ [idlName]: ['1em', '2rem'] },
                                      { duration: 1000, fill: 'both' });
       testAnimationSamples(animation, idlName,
-                           [{ time: 0,    expected: '10px' },
-                            { time: 500,  expected: '15px' },
-                            { time: 1000, expected: '20px' }]);
+                           [{ time: 500,  expected: '15px' }]);
     }, property + ' supports animating as combination units "em" and "rem"');
 
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate({ [idlName]: ['10px', 'calc(1em + 20%)'] },
                                      { duration: 1000, fill: 'both' });
       testAnimationSamples(animation, idlName,
-                           [{ time: 0,    expected: '10px' },
-                            { time: 500,  expected: 'calc(10px + 10%)' },
-                            { time: 1000, expected: 'calc(10px + 20%)' }]);
+                           [{ time: 500,  expected: 'calc(10px + 10%)' }]);
     }, property + ' supports animating as combination units "px" and "calc"');
 
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate(
         { [idlName]: ['calc(10px + 10%)', 'calc(1em + 1rem + 20%)'] },
         { duration: 1000, fill: 'both' });
       testAnimationSamples(animation, idlName,
-                           [{ time: 0,
-                              expected: 'calc(10px + 10%)' },
-                            { time: 500,
-                              expected: 'calc(15px + 15%)' },
-                            { time: 1000,
-                              expected: 'calc(20px + 20%)' }]);
+                           [{ time: 500,
+                              expected: 'calc(15px + 15%)' }]);
     }, property + ' supports animating as a calc');
   },
 
   testAddition: function(property, setup) {
     lengthType.testAddition(property, setup);
     percentageType.testAddition(property, setup);
 
     test(function(t) {
@@ -377,19 +357,17 @@ const lengthPercentageOrCalcType = {
 const positiveNumberType = {
   testInterpolation: function(property, setup) {
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate({ [idlName]: [1.1, 1.5] },
                                      { duration: 1000, fill: 'both' });
       testAnimationSamples(animation, idlName,
-                           [{ time: 0,    expected: '1.1' },
-                            { time: 500,  expected: '1.3' },
-                            { time: 1000, expected: '1.5' }]);
+                           [{ time: 500,  expected: '1.3' }]);
     }, property + ' supports animating as a positive number');
   },
 
   testAddition: function(property, setup) {
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       target.style[idlName] = 1.1;
@@ -1155,42 +1133,36 @@ const boxShadowListType = {
 const positionType = {
   testInterpolation: function(property, setup) {
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate({ [idlName]: ['10px 10px', '50px 50px'] },
                                      { duration: 1000, fill: 'both' });
       testAnimationSamples(animation, idlName,
-                           [{ time: 0,    expected: '10px 10px' },
-                            { time: 500,  expected: '30px 30px' },
-                            { time: 1000, expected: '50px 50px' }]);
+                           [{ time: 500,  expected: '30px 30px' }]);
     }, property + ' supports animating as a position');
 
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate({ [idlName]: ['1rem 1rem', '5rem 5rem'] },
                                      { duration: 1000, fill: 'both' });
       testAnimationSamples(animation, idlName,
-                           [{ time: 0,    expected: '10px 10px' },
-                            { time: 500,  expected: '30px 30px' },
-                            { time: 1000, expected: '50px 50px' }]);
+                           [{ time: 500,  expected: '30px 30px' }]);
     }, property + ' supports animating as a position of rem');
 
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       var animation = target.animate({ [idlName]: ['10% 10%', '50% 50%'] },
                                      { duration: 1000, fill: 'both' });
       testAnimationSamples(
         animation, idlName,
-        [{ time: 0,    expected: calcFromPercentage(idlName, '10% 10%') },
-         { time: 500,  expected: calcFromPercentage(idlName, '30% 30%') },
-         { time: 1000, expected: calcFromPercentage(idlName, '50% 50%') }]);
+        [{ time: 500,  expected: calcFromPercentage(idlName, '30% 30%') }]);
     }, property + ' supports animating as a position of percent');
   },
 
   testAddition: function(property, setup) {
     test(function(t) {
       var idlName = propertyToIDL(property);
       var target = createTestElement(t, setup);
       target.style[idlName] = '10px 10px';