Bug 1398038 - Add tests for extended easing syntax; r?hiro draft
authorBrian Birtles <birtles@gmail.com>
Wed, 18 Oct 2017 15:01:20 +0900
changeset 683763 7b0b16ddc8c3ca29012441d332085a1703a3c8fc
parent 683762 67073a66a7319d7b5f7b7e246cffba9e336def6f
child 683764 8c27b68144c9e1e65ce9cace87eddabe3d7f540d
push id85456
push userbmo:bbirtles@mozilla.com
push dateFri, 20 Oct 2017 06:31:55 +0000
reviewershiro
bugs1398038
milestone58.0a1
Bug 1398038 - Add tests for extended easing syntax; r?hiro MozReview-Commit-ID: 7LkaWCrVvYD
testing/web-platform/meta/web-animations/interfaces/Animatable/animate.html.ini
testing/web-platform/meta/web-animations/interfaces/KeyframeEffect/constructor.html.ini
testing/web-platform/meta/web-animations/interfaces/KeyframeEffect/setKeyframes.html.ini
testing/web-platform/tests/web-animations/resources/keyframe-tests.js
--- a/testing/web-platform/meta/web-animations/interfaces/Animatable/animate.html.ini
+++ b/testing/web-platform/meta/web-animations/interfaces/Animatable/animate.html.ini
@@ -13,14 +13,22 @@
   [Element.animate() accepts a property-indexed keyframe with an array of offsets with a trailing null value]
     expected: FAIL
   [Element.animate() accepts a property-indexed keyframe with an array of offsets with leading and trailing null values]
     expected: FAIL
   [Element.animate() accepts a property-indexed keyframe with an array of offsets with adjacent null values]
     expected: FAIL
   [Element.animate() accepts a property-indexed keyframe with an array of offsets that is not strictly ascending in the unused part of the array]
     expected: FAIL
+  [Element.animate() accepts a property-indexed keyframe with an array of easings]
+    expected: FAIL
+  [Element.animate() accepts a property-indexed keyframe with an array of easings that is too short]
+    expected: FAIL
+  [Element.animate() accepts a property-indexed keyframe with an array of easings that is too long]
+    expected: FAIL
+  [Element.animate() accepts a property-indexed keyframe with an empty array of easings]
+    expected: FAIL
   [Element.animate() does not accept property-indexed keyframes not loosely sorted by offset]
     expected: FAIL
   [Element.animate() does not accept property-indexed keyframes not loosely sorted by offset even though not all offsets are specified]
     expected: FAIL
   [Element.animate() does not accept property-indexed keyframes with offsets out of range]
     expected: FAIL
--- a/testing/web-platform/meta/web-animations/interfaces/KeyframeEffect/constructor.html.ini
+++ b/testing/web-platform/meta/web-animations/interfaces/KeyframeEffect/constructor.html.ini
@@ -13,14 +13,30 @@
   [a KeyframeEffectReadOnly can be constructed with a property-indexed keyframe with an array of offsets with a trailing null value]
     expected: FAIL
   [a KeyframeEffectReadOnly can be constructed with a property-indexed keyframe with an array of offsets with leading and trailing null values]
     expected: FAIL
   [a KeyframeEffectReadOnly can be constructed with a property-indexed keyframe with an array of offsets with adjacent null values]
     expected: FAIL
   [a KeyframeEffectReadOnly can be constructed with a property-indexed keyframe with an array of offsets that is not strictly ascending in the unused part of the array]
     expected: FAIL
+  [a KeyframeEffectReadOnly can be constructed with a property-indexed keyframe with an array of easings]
+    expected: FAIL
+  [a KeyframeEffectReadOnly constructed with a property-indexed keyframe with an array of easings roundtrips]
+    expected: FAIL
+  [a KeyframeEffectReadOnly can be constructed with a property-indexed keyframe with an array of easings that is too short]
+    expected: FAIL
+  [a KeyframeEffectReadOnly constructed with a property-indexed keyframe with an array of easings that is too short roundtrips]
+    expected: FAIL
+  [a KeyframeEffectReadOnly can be constructed with a property-indexed keyframe with an array of easings that is too long]
+    expected: FAIL
+  [a KeyframeEffectReadOnly constructed with a property-indexed keyframe with an array of easings that is too long roundtrips]
+    expected: FAIL
+  [a KeyframeEffectReadOnly can be constructed with a property-indexed keyframe with an empty array of easings]
+    expected: FAIL
+  [a KeyframeEffectReadOnly constructed with a property-indexed keyframe with an empty array of easings roundtrips]
+    expected: FAIL
   [KeyframeEffectReadOnly constructor throws with property-indexed keyframes not loosely sorted by offset]
     expected: FAIL
   [KeyframeEffectReadOnly constructor throws with property-indexed keyframes not loosely sorted by offset even though not all offsets are specified]
     expected: FAIL
   [KeyframeEffectReadOnly constructor throws with property-indexed keyframes with offsets out of range]
     expected: FAIL
--- a/testing/web-platform/meta/web-animations/interfaces/KeyframeEffect/setKeyframes.html.ini
+++ b/testing/web-platform/meta/web-animations/interfaces/KeyframeEffect/setKeyframes.html.ini
@@ -13,14 +13,22 @@
   [Keyframes can be replaced with a property-indexed keyframe with an array of offsets with a trailing null value]
     expected: FAIL
   [Keyframes can be replaced with a property-indexed keyframe with an array of offsets with leading and trailing null values]
     expected: FAIL
   [Keyframes can be replaced with a property-indexed keyframe with an array of offsets with adjacent null values]
     expected: FAIL
   [Keyframes can be replaced with a property-indexed keyframe with an array of offsets that is not strictly ascending in the unused part of the array]
     expected: FAIL
+  [Keyframes can be replaced with a property-indexed keyframe with an array of easings]
+    expected: FAIL
+  [Keyframes can be replaced with a property-indexed keyframe with an array of easings that is too short]
+    expected: FAIL
+  [Keyframes can be replaced with a property-indexed keyframe with an array of easings that is too long]
+    expected: FAIL
+  [Keyframes can be replaced with a property-indexed keyframe with an empty array of easings]
+    expected: FAIL
   [KeyframeEffect constructor throws with property-indexed keyframes not loosely sorted by offset]
     expected: FAIL
   [KeyframeEffect constructor throws with property-indexed keyframes not loosely sorted by offset even though not all offsets are specified]
     expected: FAIL
   [KeyframeEffect constructor throws with property-indexed keyframes with offsets out of range]
     expected: FAIL
--- a/testing/web-platform/tests/web-animations/resources/keyframe-tests.js
+++ b/testing/web-platform/tests/web-animations/resources/keyframe-tests.js
@@ -255,16 +255,74 @@ const gKeyframesTests = [
             + ' strictly ascending in the unused part of the array',
     input:  { left: ['10px', '20px', '30px'],
               offset: [ 0, 0.2, 0.8, 0.6 ] },
     output: [keyframe(offset(0),   { left: '10px' }),
              keyframe(offset(0.2), { left: '20px' }),
              keyframe(offset(0.8), { left: '30px' })],
   },
 
+  // ----------- Property-indexed keyframes: easing handling -----------
+
+  {
+    desc:   'a property-indexed keyframe without any specified easing',
+    input:  { left: ['10px', '20px', '30px'] },
+    output: [keyframe(computedOffset(0),   { left: '10px' }, 'linear'),
+             keyframe(computedOffset(0.5), { left: '20px' }, 'linear'),
+             keyframe(computedOffset(1),   { left: '30px' }, 'linear')],
+  },
+  {
+    desc:   'a property-indexed keyframe with a single easing',
+    input:  { left: ['10px', '20px', '30px'], easing: 'ease-in' },
+    output: [keyframe(computedOffset(0),   { left: '10px' }, 'ease-in'),
+             keyframe(computedOffset(0.5), { left: '20px' }, 'ease-in'),
+             keyframe(computedOffset(1),   { left: '30px' }, 'ease-in')],
+  },
+  {
+    desc:   'a property-indexed keyframe with an array of easings',
+    input:  { left: ['10px', '20px', '30px'],
+              easing: ['ease-in', 'ease-out', 'ease-in-out'] },
+    output: [keyframe(computedOffset(0),   { left: '10px' }, 'ease-in'),
+             keyframe(computedOffset(0.5), { left: '20px' }, 'ease-out'),
+             keyframe(computedOffset(1),   { left: '30px' }, 'ease-in-out')],
+  },
+  {
+    desc:   'a property-indexed keyframe with an array of easings that is too'
+            + ' short',
+    input:  { left: ['10px', '20px', '30px'],
+              easing: ['ease-in', 'ease-out'] },
+    output: [keyframe(computedOffset(0),   { left: '10px' }, 'ease-in'),
+             keyframe(computedOffset(0.5), { left: '20px' }, 'ease-out'),
+             keyframe(computedOffset(1),   { left: '30px' }, 'ease-in')],
+  },
+  {
+    desc:   'a property-indexed keyframe with a single-element array of'
+            + ' easings',
+    input:  { left: ['10px', '20px', '30px'], easing: ['ease-in'] },
+    output: [keyframe(computedOffset(0),   { left: '10px' }, 'ease-in'),
+             keyframe(computedOffset(0.5), { left: '20px' }, 'ease-in'),
+             keyframe(computedOffset(1),   { left: '30px' }, 'ease-in')],
+  },
+  {
+    desc:   'a property-indexed keyframe with an empty array of easings',
+    input:  { left: ['10px', '20px', '30px'], easing: [] },
+    output: [keyframe(computedOffset(0),   { left: '10px' }, 'linear'),
+             keyframe(computedOffset(0.5), { left: '20px' }, 'linear'),
+             keyframe(computedOffset(1),   { left: '30px' }, 'linear')],
+  },
+  {
+    desc:   'a property-indexed keyframe with an array of easings that is too'
+            + ' long',
+    input:  { left: ['10px', '20px', '30px'],
+              easing: ['steps(1)', 'steps(2)', 'steps(3)', 'steps(4)'] },
+    output: [keyframe(computedOffset(0),   { left: '10px' }, 'steps(1)'),
+             keyframe(computedOffset(0.5), { left: '20px' }, 'steps(2)'),
+             keyframe(computedOffset(1),   { left: '30px' }, 'steps(3)')],
+  },
+
   // ----------- Keyframe sequence: property handling -----------
 
   {
     desc:   'a one property one keyframe sequence',
     input:  [{ offset: 1, left: '10px' }],
     output: [keyframe(offset(1), { left: '10px' })],
   },
   {
@@ -520,16 +578,36 @@ const gInvalidKeyframesTests = [
              { opacity: 1, offset: 0 } ],
   },
   {
     desc:  'property-indexed keyframes with an invalid easing value',
     input: { opacity: [ 0, 0.5, 1 ],
              easing: 'inherit' },
   },
   {
+    desc:  'property-indexed keyframes with an invalid easing value as one of'
+           + ' the array values',
+    input: { opacity: [ 0, 0.5, 1 ],
+             easing: [ 'ease-in', 'inherit' ] },
+  },
+  {
+    desc:   'property-indexed keyframe with an invalid easing in the unused'
+            + ' part of the array of easings',
+    input:  { left: ['10px', '20px', '30px'],
+              easing: ['steps(1)', 'steps(2)', 'steps(3)', 'invalid'] },
+  },
+  {
+    desc:   'empty property-indexed keyframe with an invalid easing',
+    input:  { easing: 'invalid' },
+  },
+  {
+    desc:   'empty property-indexed keyframe with an invalid easings array',
+    input:  { easing: ['invalid'] },
+  },
+  {
     desc:  'a keyframe sequence with an invalid easing value',
     input: [ { opacity: 0, easing: 'jumpy' },
              { opacity: 1 } ],
   },
   {
     desc:  'keyframes with an invalid composite value',
     input: [ { opacity: 0, composite: 'alternate' },
              { opacity: 1 } ],