Bug 1255710 - Part 1: Remove all unnecessary t.step_func. r=birtles
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Tue, 29 Mar 2016 12:50:35 +0900
changeset 290916 98655db9da52e696c2a5fb13002a4a6cad214c04
parent 290915 3d848bfe065d17eee74395b798c4956869ae73cf
child 290917 80660b035524486c182f75a780009141c714e879
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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() {