Bug 1402170 - Use for...of instead of forEach for several tests in processing-a-keyframes-argument.html; r?hiro draft
authorBrian Birtles <birtles@gmail.com>
Fri, 22 Sep 2017 11:36:42 +0900
changeset 668834 0efdf2f6dbf8faf7265b63b68b0c2abdbe99dd1d
parent 668833 b6be6aab2239a622d006e6fc1ce780dfa99fa75f
child 668835 76bb5631daf83cf35b2ae4805f5244347a5081e8
push id81132
push userbbirtles@mozilla.com
push dateFri, 22 Sep 2017 02:57:12 +0000
reviewershiro
bugs1402170
milestone58.0a1
Bug 1402170 - Use for...of instead of forEach for several tests in processing-a-keyframes-argument.html; r?hiro for...of is generally preferred for over forEach and is supported in all major browsers. (It also makes wrapping one of the long lines in this file easier.) MozReview-Commit-ID: 1BuoW0QSxaG
testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument.html
--- a/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument.html
+++ b/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument.html
@@ -52,37 +52,37 @@ function TestKeyframe(testProp) {
     get: function() { return _propAccessCount; }
   });
 }
 
 function GetTestKeyframeSequence(testProp) {
   return [ new TestKeyframe(testProp) ]
 }
 
-gNonAnimatableProps.forEach(function(prop) {
+for (const prop of gNonAnimatableProps) {
   test(function(t) {
     const testKeyframe = new TestKeyframe(prop);
 
     new KeyframeEffect(null, testKeyframe);
 
     assert_equals(testKeyframe.propAccessCount, 0, 'Accessor not called');
   }, 'non-animatable property \'' + prop + '\' is not accessed when using'
      + ' a property-indexed keyframe object');
-});
+}
 
-gNonAnimatableProps.forEach(function(prop) {
+for (const prop of gNonAnimatableProps) {
   test(function(t) {
     const testKeyframes = GetTestKeyframeSequence(prop);
 
     new KeyframeEffect(null, testKeyframes);
 
     assert_equals(testKeyframes[0].propAccessCount, 0, 'Accessor not called');
   }, 'non-animatable property \'' + prop + '\' is not accessed when using'
      + ' a keyframe sequence');
-});
+}
 
 // Test equivalent forms of property indexed and sequenced keyframe syntax
 
 function assertEquivalentKeyframeSyntax(keyframesA, keyframesB) {
   const processedKeyframesA =
     new KeyframeEffect(null, keyframesA).getKeyframes();
   const processedKeyframesB =
     new KeyframeEffect(null, keyframesB).getKeyframes();
@@ -156,21 +156,22 @@ const gEquivalentSyntaxTests = [
     },
     sequencedKeyframes: [
       {left: '0px', composite: 'add'},
       {left: '100px', composite: 'add'},
     ],
   },
 ];
 
-gEquivalentSyntaxTests.forEach(function({description, indexedKeyframes, sequencedKeyframes}) {
+for (const {description, indexedKeyframes, sequencedKeyframes} of
+     gEquivalentSyntaxTests) {
   test(function(t) {
     assertEquivalentKeyframeSyntax(indexedKeyframes, sequencedKeyframes);
-  }, 'Equivalent property indexed and sequenced keyframes: ' + description);
-});
+  }, `Equivalent property indexed and sequenced keyframes ${description}`);
+}
 
 // Test handling of custom iterable objects.
 
 function createIterable(iterations) {
   return {
     [Symbol.iterator]() {
       let i = 0;
       return {