Bug 1332206 - Simplify invalid easing tests; r?hiro draft
authorBrian Birtles <birtles@gmail.com>
Tue, 07 Feb 2017 07:55:30 +0900
changeset 479751 85a7b3b8eff58a3c3be5f8448da80610832cdec4
parent 479750 5cb1ecb6a3c2fd9665325e6e457508315ace6ae5
child 479752 bf115b430e602fd739daac4c44409589975b89ab
push id44344
push userbbirtles@mozilla.com
push dateTue, 07 Feb 2017 06:04:57 +0000
reviewershiro
bugs1332206
milestone54.0a1
Bug 1332206 - Simplify invalid easing tests; r?hiro This doesn't need to be an array of objects when a simple array would do. MozReview-Commit-ID: 1gtdhG5RPSy
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/web-animations/interfaces/AnimationEffectTiming/easing.html
testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/effect-easing.html
testing/web-platform/tests/web-animations/resources/easing-tests.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -203831,17 +203831,17 @@
    "ab150d71daf36949d4d6804033e19c734a68552d",
    "testharness"
   ],
   "web-animations/interfaces/AnimationEffectTiming/duration.html": [
    "2e0f0a270b8acd3d345732327ee2eabd32bdb2b2",
    "testharness"
   ],
   "web-animations/interfaces/AnimationEffectTiming/easing.html": [
-   "10a1a0244e3f1ff5196a587f78e58165d5e7eeb2",
+   "5d21bb3ae43da1226f9510595b47b452b3b8f223",
    "testharness"
   ],
   "web-animations/interfaces/AnimationEffectTiming/endDelay.html": [
    "644eed9bf43bb0332ee33842ba0ad4423d90fc90",
    "testharness"
   ],
   "web-animations/interfaces/AnimationEffectTiming/fill.html": [
    "bf5b77d3c96e737700e51f8a2c5b8e2b9629902f",
@@ -203887,17 +203887,17 @@
    "577241478fdeca6257711e9f90fec64372bd5637",
    "testharness"
   ],
   "web-animations/interfaces/KeyframeEffect/copy-contructor.html": [
    "e1dfb5c05807a37974ecce98bb8c683cc291bfe4",
    "testharness"
   ],
   "web-animations/interfaces/KeyframeEffect/effect-easing.html": [
-   "ffbcc5eca862491a2866ac46cf1b030e17100881",
+   "5e053831e2b3070ea39b0bbd90c2e7198e98955d",
    "testharness"
   ],
   "web-animations/interfaces/KeyframeEffect/getComputedTiming.html": [
    "c9dcf7c17010e5495007e000b33aeb4dc89f92b7",
    "testharness"
   ],
   "web-animations/interfaces/KeyframeEffect/iterationComposite.html": [
    "5b7dbc28de885751ea952f4fecc2bd07cb3cea11",
@@ -203923,17 +203923,17 @@
    "8ef986f13e7fe7ffeb7403f647b4169ac0d6a138",
    "testharness"
   ],
   "web-animations/interfaces/KeyframeEffectReadOnly/spacing.html": [
    "ffca3a0ad5c7b08242224b80c52ebb8b9b7bfce6",
    "testharness"
   ],
   "web-animations/resources/easing-tests.js": [
-   "78fa1da90b2d65cb5bed9978b8d032e85de8d16e",
+   "190134380a0724f470a03ed0aa20c936bfed8d6c",
    "support"
   ],
   "web-animations/resources/keyframe-utils.js": [
    "7a0f21838f4bbda51fe7e0b5d8e55952c6cdcbd4",
    "support"
   ],
   "web-animations/testcommon.js": [
    "001012b71248cdecba02215c827ab437b672e8c6",
--- a/testing/web-platform/tests/web-animations/interfaces/AnimationEffectTiming/easing.html
+++ b/testing/web-platform/tests/web-animations/interfaces/AnimationEffectTiming/easing.html
@@ -35,25 +35,25 @@ gEasingTests.forEach(function(options) {
     assert_progress(anim, 0, easing);
     assert_progress(anim, 250 * MS_PER_SEC, easing);
     assert_progress(anim, 500 * MS_PER_SEC, easing);
     assert_progress(anim, 750 * MS_PER_SEC, easing);
     assert_progress(anim, 1000 * MS_PER_SEC, easing);
   }, options.desc);
 });
 
-gInvalidEasingTests.forEach(function(options) {
+gInvalidEasings.forEach(function(invalidEasing) {
   test(function(t) {
     var div = createDiv(t);
     var anim = div.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC);
     assert_throws({ name: 'TypeError' },
                   function() {
-                    anim.effect.timing.easing = options.easing;
+                    anim.effect.timing.easing = invalidEasing;
                   });
-  }, 'Invalid effect easing value test: \'' + options.easing + '\'');
+  }, 'Invalid effect easing value test: \'' + invalidEasing + '\'');
 });
 
 test(function(t) {
   var delay = 1000 * MS_PER_SEC;
 
   var target = createDiv(t);
   var anim = target.animate([ { opacity: 0 }, { opacity: 1 } ],
                             { duration: 1000 * MS_PER_SEC,
--- a/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/effect-easing.html
+++ b/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/effect-easing.html
@@ -591,20 +591,20 @@ gStepTimingFunctionTests.forEach(functio
         assert_equals(getComputedStyle(target).width,
                       condition.width,
                       'Progress at ' + animation.currentTime + 'ms');
       }
     });
   }, options.description);
 });
 
-gInvalidEasingTests.forEach(function(options) {
+gInvalidEasings.forEach(function(invalidEasing) {
   test(function(t) {
     var div = createDiv(t);
     assert_throws({ name: 'TypeError' },
                   function() {
-                    div.animate({ easing: options.easing }, 100 * MS_PER_SEC);
+                    div.animate({ easing: invalidEasing }, 100 * MS_PER_SEC);
                   });
-  }, 'Invalid keyframe easing value: \'' + options.easing + '\'');
+  }, 'Invalid keyframe easing value: \'' + invalidEasing + '\'');
 });
 
 </script>
 </body>
--- a/testing/web-platform/tests/web-animations/resources/easing-tests.js
+++ b/testing/web-platform/tests/web-animations/resources/easing-tests.js
@@ -70,34 +70,18 @@ var gEasingTests = [
   },
   {
     desc: 'easing function which produces values less than 1',
     easing: 'cubic-bezier(0, -0.5, 1, -0.5)',
     easingFunction: cubicBezier(0, -0.5, 1, -0.5)
   }
 ];
 
-var gInvalidEasingTests = [
-  {
-    easing: ''
-  },
-  {
-    easing: 'test'
-  },
-  {
-    easing: 'cubic-bezier(1.1, 0, 1, 1)'
-  },
-  {
-    easing: 'cubic-bezier(0, 0, 1.1, 1)'
-  },
-  {
-    easing: 'cubic-bezier(-0.1, 0, 1, 1)'
-  },
-  {
-    easing: 'cubic-bezier(0, 0, -0.1, 1)'
-  },
-  {
-    easing: 'steps(-1, start)'
-  },
-  {
-    easing: 'steps(0.1, start)'
-  },
+var gInvalidEasings = [
+  '',
+  'test',
+  'cubic-bezier(1.1, 0, 1, 1)',
+  'cubic-bezier(0, 0, 1.1, 1)',
+  'cubic-bezier(-0.1, 0, 1, 1)',
+  'cubic-bezier(0, 0, -0.1, 1)',
+  'steps(-1, start)',
+  'steps(0.1, start)'
 ];