Bug 1402170 - Tidy up processing-a-keyframes-argument-002.html; r?hiro draft
authorBrian Birtles <birtles@gmail.com>
Fri, 22 Sep 2017 16:03:01 +0900
changeset 673231 01f2208a99fddb3dce7c52b8bbb618429bef35cf
parent 673230 5f61687b2adae3dba91926df06eaea1796c13868
child 673232 1fef9cd1843177b6a89c5742dd4b018e3b1c8d1c
push id82504
push userbmo:bbirtles@mozilla.com
push dateMon, 02 Oct 2017 05:09:17 +0000
reviewershiro
bugs1402170
milestone58.0a1
Bug 1402170 - Tidy up processing-a-keyframes-argument-002.html; r?hiro MozReview-Commit-ID: H7envMXOJhU
testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html
--- a/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html
+++ b/testing/web-platform/tests/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html
@@ -9,54 +9,50 @@
 <script src="../../resources/easing-tests.js"></script>
 <body>
 <div id="log"></div>
 <div id="target"></div>
 <script>
 'use strict';
 
 test(function(t) {
-  gEasingValueTests.forEach(function(subtest) {
-    var easing = subtest[0];
-    var expected = subtest[1];
-    var effect = new KeyframeEffectReadOnly(target, {
-      left: ["10px", "20px"],
+  for (const [easing, expected] of gEasingValueTests) {
+    const effect = new KeyframeEffectReadOnly(target, {
+      left: ['10px', '20px'],
       easing: easing
     });
     assert_equals(effect.getKeyframes()[0].easing, expected,
-                  "resulting easing for '" + easing + "'");
-  });
-}, "easing values are parsed correctly when passed to the " +
-   "KeyframeEffectReadOnly constructor in a property-indexed keyframe");
+                  `resulting easing for '${easing}'`);
+  }
+}, 'easing values are parsed correctly when passed to the ' +
+   'KeyframeEffectReadOnly constructor in a property-indexed keyframe');
 
 test(function(t) {
-  gEasingValueTests.forEach(function(subtest) {
-    var easing = subtest[0];
-    var expected = subtest[1];
-    var effect = new KeyframeEffectReadOnly(target, [
-      { offset: 0, left: "10px", easing: easing },
-      { offset: 1, left: "20px" }
+  for (const [easing, expected] of gEasingValueTests) {
+    const effect = new KeyframeEffectReadOnly(target, [
+      { offset: 0, left: '10px', easing: easing },
+      { offset: 1, left: '20px' }
     ]);
     assert_equals(effect.getKeyframes()[0].easing, expected,
-                  "resulting easing for '" + easing + "'");
-  });
-}, "easing values are parsed correctly when passed to the " +
-   "KeyframeEffectReadOnly constructor in regular keyframes");
+                  `resulting easing for '${easing}'`);
+  }
+}, 'easing values are parsed correctly when passed to the ' +
+   'KeyframeEffectReadOnly constructor in regular keyframes');
 
 test(function(t) {
-  gInvalidEasings.forEach(invalidEasing => {
+  for (const invalidEasing of gInvalidEasings) {
     assert_throws(new TypeError, () => {
       new KeyframeEffectReadOnly(target, { easing: invalidEasing });
     }, `TypeError is thrown for easing '${invalidEasing}'`);
-  });
+  }
 }, 'invalid easing values are correctly rejected when passed to the ' +
    'KeyframeEffectReadOnly constructor in regular keyframes');
 
 test(function(t) {
-  gInvalidEasings.forEach(invalidEasing => {
+  for (const invalidEasing of gInvalidEasings) {
     assert_throws(new TypeError, () => {
       new KeyframeEffectReadOnly(target, [{ easing: invalidEasing }]);
     }, `TypeError is thrown for easing '${invalidEasing}'`);
-  });
+  }
 }, 'invalid easing values are correctly rejected when passed to the ' +
    'KeyframeEffectReadOnly constructor in a keyframe sequence');
 
 </script>