Bug 1255710 - Part 1: Remove all unnecessary t.step_func. r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Mon, 28 Mar 2016 09:55:29 +0900
changeset 345033 6c319a33c5ab226e562341860f65d7a52ab067d5
parent 345032 40952ab105898def4c52c11ad3f33377927fc0c3
child 345034 928fe685cfbf5f038856d7d4fe3aea7effc56d9c
child 345037 a7e2a7b7e99fe78c52ba787377948cf9737ffeaf
push id14001
push userbmo:hiroyuke.ikezoe@gmail.com
push dateMon, 28 Mar 2016 01:30:15 +0000
reviewersbirtles
bugs1255710
milestone48.0a1
Bug 1255710 - Part 1: Remove all unnecessary t.step_func. r?birtles MozReview-Commit-ID: BNBRYLpHjLy
dom/animation/test/chrome/test_animation_performance_warning.html
--- a/dom/animation/test/chrome/test_animation_performance_warning.html
+++ b/dom/animation/test/chrome/test_animation_performance_warning.html
@@ -212,21 +212,21 @@ var gAnimationsTests = [
     ]
   },
 ];
 
 gAnimationsTests.forEach(function(subtest) {
   promise_test(function(t) {
     var div = addDiv(t, { class: 'compositable' });
     var animation = div.animate(subtest.frames, 100000);
-    return animation.ready.then(t.step_func(function() {
+    return animation.ready.then(function() {
       assert_animation_property_state_equals(
         animation.effect.getProperties(),
         subtest.expected);
-    }));
+    });
   }, subtest.desc);
 });
 
 var gPerformanceWarningTests = [
   {
     desc: 'preserve-3d transform',
     frames: {
       transform: ['translate(0px)', 'translate(100px)']
@@ -498,50 +498,50 @@ function start() {
     .getService(SpecialPowers.Ci.nsIStringBundleService);
   gStringBundle = bundleService
     .createBundle("chrome://global/locale/layout_errors.properties");
 
   gAnimationsTests.forEach(function(subtest) {
     promise_test(function(t) {
       var div = addDiv(t, { class: 'compositable' });
       var animation = div.animate(subtest.frames, 100000);
-      return animation.ready.then(t.step_func(function() {
+      return animation.ready.then(function() {
         assert_animation_property_state_equals(
           animation.effect.getProperties(),
           subtest.expected);
-      }));
+      });
     }, subtest.desc);
   });
 
   gPerformanceWarningTests.forEach(function(subtest) {
     // FIXME: Bug 1255710: 'preserve-3d' frame breaks other tests,
     // we should skip all 'preserve-3d' tests here.
     if (subtest.desc.includes('preserve-3d')) {
       return;
     }
     promise_test(function(t) {
       var div = addDiv(t, { class: 'compositable' });
       var animation = div.animate(subtest.frames, 100000);
-      return animation.ready.then(t.step_func(function() {
+      return animation.ready.then(function() {
         assert_property_state_on_compositor(
           animation.effect.getProperties(),
           subtest.expected);
         div.style = subtest.style;
         return waitForFrame();
-      })).then(t.step_func(function() {
+      }).then(function() {
         assert_animation_property_state_equals(
           animation.effect.getProperties(),
           subtest.expected);
         div.style = '';
         return waitForFrame();
-      })).then(t.step_func(function() {
+      }).then(function() {
         assert_property_state_on_compositor(
           animation.effect.getProperties(),
           subtest.expected);
-      }));
+      });
     }, subtest.desc);
   });
 
   gMultipleAsyncAnimationsTests.forEach(function(subtest) {
     // FIXME: Bug 1255710: 'preserve-3d' frame breaks other tests,
     // we should skip all 'preserve-3d' tests here.
     if (subtest.desc.includes('preserve-3d')) {
       return;
@@ -550,138 +550,138 @@ function start() {
       var div = addDiv(t, { class: 'compositable' });
       var animations = subtest.animations.map(function(anim) {
         var animation = div.animate(anim.frames, 100000);
 
         // Bind expected values to animation object.
         animation.expected = anim.expected;
         return animation;
       });
-      return waitForAllAnimations(animations).then(t.step_func(function() {
-        animations.forEach(t.step_func(function(anim) {
+      return waitForAllAnimations(animations).then(function() {
+        animations.forEach(function(anim) {
           assert_property_state_on_compositor(
             anim.effect.getProperties(),
             anim.expected);
-        }));
+        });
         div.style = subtest.style;
         return waitForFrame();
-      })).then(t.step_func(function() {
-        animations.forEach(t.step_func(function(anim) {
+      }).then(function() {
+        animations.forEach(function(anim) {
           assert_animation_property_state_equals(
             anim.effect.getProperties(),
             anim.expected);
-        }));
+        });
         div.style = '';
         return waitForFrame();
-      })).then(t.step_func(function() {
-        animations.forEach(t.step_func(function(anim) {
+      }).then(function() {
+        animations.forEach(function(anim) {
           assert_property_state_on_compositor(
             anim.effect.getProperties(),
             anim.expected);
-        }));
-      }));
+        });
+      });
     }, 'Multiple animations: ' + subtest.desc);
   });
 
   gMultipleAsyncAnimationsWithGeometricKeyframeTests.forEach(function(subtest) {
     promise_test(function(t) {
       var div = addDiv(t, { class: 'compositable' });
       var animations = subtest.animations.map(function(anim) {
         var animation = div.animate(anim.frames, 100000);
 
         // Bind expected values to animation object.
         animation.expected = anim.expected;
         return animation;
       });
-      return waitForAllAnimations(animations).then(t.step_func(function() {
-        animations.forEach(t.step_func(function(anim) {
+      return waitForAllAnimations(animations).then(function() {
+        animations.forEach(function(anim) {
           assert_animation_property_state_equals(
             anim.effect.getProperties(),
             anim.expected);
-        }));
-      }));
+        });
+      });
     }, 'Multiple animations with geometric property: ' + subtest.desc);
   });
 
   gMultipleAsyncAnimationsWithGeometricAnimationTests.forEach(function(subtest) {
     promise_test(function(t) {
       var div = addDiv(t, { class: 'compositable' });
       var animations = subtest.animations.map(function(anim) {
         var animation = div.animate(anim.frames, 100000);
 
         // Bind expected values to animation object.
         animation.expected = anim.expected;
         return animation;
       });
 
       var widthAnimation;
 
-      return waitForAllAnimations(animations).then(t.step_func(function() {
-        animations.forEach(t.step_func(function(anim) {
+      return waitForAllAnimations(animations).then(function() {
+        animations.forEach(function(anim) {
           assert_property_state_on_compositor(
             anim.effect.getProperties(),
             anim.expected);
-        }));
-      })).then(t.step_func(function() {
+        });
+      }).then(function() {
         // Append 'width' animation on the same element.
         widthAnimation = div.animate({ width: ['100px', '200px'] }, 100000);
         return waitForFrame();
-      })).then(t.step_func(function() {
+      }).then(function() {
         // Now transform animations are not running on compositor because of
         // the 'width' animation.
-        animations.forEach(t.step_func(function(anim) {
+        animations.forEach(function(anim) {
           assert_animation_property_state_equals(
             anim.effect.getProperties(),
             anim.expected);
-        }));
+        });
         // Remove the 'width' animation.
         widthAnimation.cancel();
         return waitForFrame();
-      })).then(t.step_func(function() {
+      }).then(function() {
         // Now all animations are running on compositor.
-        animations.forEach(t.step_func(function(anim) {
+        animations.forEach(function(anim) {
           assert_property_state_on_compositor(
             anim.effect.getProperties(),
             anim.expected);
-        }));
-      }));
+        });
+      });
     }, 'Multiple async animations and geometric animation: ' + subtest.desc);
   });
 
   promise_test(function(t) {
     var div = addDiv(t, { class: 'compositable' });
     var animation = div.animate(
       { transform: ['translate(0px)', 'translate(100px)'] }, 100000);
-    return animation.ready.then(t.step_func(function() {
+    return animation.ready.then(function() {
       assert_animation_property_state_equals(
         animation.effect.getProperties(),
         [ { property: 'transform', runningOnCompositor: true } ]);
       div.style = 'width: 10000px; height: 10000px';
       return waitForFrame();
-    })).then(t.step_func(function() {
+    }).then(function() {
       // viewport depends on test environment.
       var expectedWarning = new RegExp(
         "Async animation disabled because frame size \\(10000, 10000\\) is " +
         "bigger than the viewport \\(\\d+, \\d+\\) or the visual rectangle " +
         "\\(10000, 10000\\) is larger than the max allowed value \\(\\d+\\)");
       assert_animation_property_state_equals(
         animation.effect.getProperties(),
         [ {
           property: 'transform',
           runningOnCompositor: false,
           warning: expectedWarning
         } ]);
       div.style = 'width: 100px; height: 100px';
       return waitForFrame();
-    })).then(t.step_func(function() {
+    }).then(function() {
       // FIXME: Bug 1253164: the animation should get back on compositor.
       assert_animation_property_state_equals(
         animation.effect.getProperties(),
         [ { property: 'transform', runningOnCompositor: false } ]);
-    }));
+    });
   }, 'transform on too big element');
 
   promise_test(function(t) {
     var svg  = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
     svg.setAttribute('width', '100');
     svg.setAttribute('height', '100');
     var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
     rect.setAttribute('width', '100');
@@ -690,37 +690,37 @@ function start() {
     svg.appendChild(rect);
     document.body.appendChild(svg);
     t.add_cleanup(function() {
       svg.remove();
     });
 
     var animation = svg.animate(
       { transform: ['translate(0px)', 'translate(100px)'] }, 100000);
-    return animation.ready.then(t.step_func(function() {
+    return animation.ready.then(function() {
       assert_animation_property_state_equals(
         animation.effect.getProperties(),
         [ { property: 'transform', runningOnCompositor: true } ]);
       svg.setAttribute('transform', 'translate(10, 20)');
       return waitForFrame();
-    })).then(t.step_func(function() {
+    }).then(function() {
       assert_animation_property_state_equals(
         animation.effect.getProperties(),
         [ {
           property: 'transform',
           runningOnCompositor: false,
           warning: 'AnimationWarningTransformSVG'
         } ]);
       svg.removeAttribute('transform');
       return waitForFrame();
-    })).then(t.step_func(function() {
+    }).then(function() {
       assert_animation_property_state_equals(
         animation.effect.getProperties(),
         [ { property: 'transform', runningOnCompositor: true } ]);
-    }));
+    });
   }, 'transform of nsIFrame with SVG transform');
 
   promise_test(function(t) {
     var div = addDiv(t, { class: 'compositable',
                           style: 'animation: fade 100s' });
     var cssAnimation = div.getAnimations()[0];
     var scriptAnimation = div.animate({ opacity: [ 1, 0 ] }, 100000);
     return scriptAnimation.ready.then(function() {