Bug 1301305 - Rename assert_property_state_on_compositor to assert_all_properties_running_on_compositor; r=hiro
authorBrian Birtles <birtles@gmail.com>
Fri, 02 Dec 2016 08:56:42 +0900
changeset 325326 aa5c5ad83b28d871837a3265d1b35fd2d75e8212
parent 325325 ca7fd1a24055581dbfcd48f2cd71b2abbbad33f3
child 325327 aba14a8202e05d4c62b478ff9c61f0ac02dc8438
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewershiro
bugs1301305
milestone53.0a1
Bug 1301305 - Rename assert_property_state_on_compositor to assert_all_properties_running_on_compositor; r=hiro Currently we have: assert_animation_property_state_equals assert_animation_property_state_on_compositor and it's not clear what the difference is. This patch renames the latter to make it clear it is testing that all properties are running on the compositor. MozReview-Commit-ID: 3PRm8fse9UI
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
@@ -73,17 +73,17 @@ function assert_animation_property_state
                     'warning message should match');
     }
   }
 }
 
 // Check that the animation is running on compositor and
 // warning property is not set for the CSS property regardless
 // expected values.
-function assert_property_state_on_compositor(actual, expected) {
+function assert_all_properties_running_on_compositor(actual, expected) {
   assert_equals(actual.length, expected.length);
 
   var sortedActual = actual.sort(compare_property_state);
   var sortedExpected = expected.sort(compare_property_state);
 
   for (var i = 0; i < sortedActual.length; i++) {
     assert_equals(sortedActual[i].property,
                   sortedExpected[i].property,
@@ -360,29 +360,29 @@ function testStyleChanges() {
         }
       ]
     },
   ].forEach(subtest => {
     promise_test(function(t) {
       var animation = addDivAndAnimate(t, { class: 'compositable' },
                                        subtest.frames, 100 * MS_PER_SEC);
       return animation.ready.then(function() {
-        assert_property_state_on_compositor(
+        assert_all_properties_running_on_compositor(
           animation.effect.getProperties(),
           subtest.expected);
         animation.effect.target.style = subtest.style;
         return waitForFrame();
       }).then(function() {
         assert_animation_property_state_equals(
           animation.effect.getProperties(),
           subtest.expected);
         animation.effect.target.style = '';
         return waitForFrame();
       }).then(function() {
-        assert_property_state_on_compositor(
+        assert_all_properties_running_on_compositor(
           animation.effect.getProperties(),
           subtest.expected);
       });
     }, subtest.desc);
   });
 }
 
 // Performance warning tests that set and clear the id property
@@ -407,29 +407,29 @@ function testIdChanges() {
     promise_test(function(t) {
       if (subtest.createelement) {
         addDiv(t, { style: subtest.createelement });
       }
 
       var animation = addDivAndAnimate(t, { class: 'compositable' },
                                        subtest.frames, 100 * MS_PER_SEC);
       return animation.ready.then(function() {
-        assert_property_state_on_compositor(
+        assert_all_properties_running_on_compositor(
           animation.effect.getProperties(),
           subtest.expected);
         animation.effect.target.id = subtest.id;
         return waitForFrame();
       }).then(function() {
         assert_animation_property_state_equals(
           animation.effect.getProperties(),
           subtest.expected);
         animation.effect.target.id = '';
         return waitForFrame();
       }).then(function() {
-        assert_property_state_on_compositor(
+        assert_all_properties_running_on_compositor(
           animation.effect.getProperties(),
           subtest.expected);
       });
     }, subtest.desc);
   });
 }
 
 function testMultipleAnimations() {
@@ -499,33 +499,33 @@ function testMultipleAnimations() {
         var animation = div.animate(anim.frames, 100 * MS_PER_SEC);
 
         // Bind expected values to animation object.
         animation.expected = anim.expected;
         return animation;
       });
       return waitForAllAnimations(animations).then(function() {
         animations.forEach(anim => {
-          assert_property_state_on_compositor(
+          assert_all_properties_running_on_compositor(
             anim.effect.getProperties(),
             anim.expected);
         });
         div.style = subtest.style;
         return waitForFrame();
       }).then(function() {
         animations.forEach(anim => {
           assert_animation_property_state_equals(
             anim.effect.getProperties(),
             anim.expected);
         });
         div.style = '';
         return waitForFrame();
       }).then(function() {
         animations.forEach(anim => {
-          assert_property_state_on_compositor(
+          assert_all_properties_running_on_compositor(
             anim.effect.getProperties(),
             anim.expected);
         });
       });
     }, 'Multiple animations: ' + subtest.desc);
   });
 }
 
@@ -760,17 +760,17 @@ function testMultipleAnimationsWithGeome
         animation.expected = anim.expected;
         return animation;
       });
 
       var widthAnimation;
 
       return waitForAllAnimations(animations).then(function() {
         animations.forEach(anim => {
-          assert_property_state_on_compositor(
+          assert_all_properties_running_on_compositor(
             anim.effect.getProperties(),
             anim.expected);
         });
       }).then(function() {
         // Append 'width' animation on the same element.
         widthAnimation = div.animate({ width: ['100px', '200px'] },
                                      100 * MS_PER_SEC);
         return waitForFrame();
@@ -783,17 +783,17 @@ function testMultipleAnimationsWithGeome
             anim.expected);
         });
         // Remove the 'width' animation.
         widthAnimation.cancel();
         return waitForFrame();
       }).then(function() {
         // Now all animations are running on compositor.
         animations.forEach(anim => {
-          assert_property_state_on_compositor(
+          assert_all_properties_running_on_compositor(
             anim.effect.getProperties(),
             anim.expected);
         });
       });
     }, 'Multiple async animations and geometric animation: ' + subtest.desc);
   });
 }