Bug 1298571 - Fix for review comments r?hiro draft
authorSatoshi Kojima <skoji@mac.com>
Mon, 29 Aug 2016 17:40:42 +0900
changeset 406673 02171cbce104fa041fbe4c01380f16a432f282a1
parent 406539 e37335459b486efee73ce9cda16aa7493cd5f5b8
child 529713 2abdfc012105c92a4f2eaa8e99608d588dd2905a
push id27791
push userbmo:skoji@mac.com
push dateMon, 29 Aug 2016 09:02:07 +0000
reviewershiro
bugs1298571
milestone51.0a1
Bug 1298571 - Fix for review comments r?hiro * change test case name from unnecessary_update_is_not_invoked to no_restyling_when_animation_style_when_re_setting_same_animation_property * use add_task_if_omta_enabled instead of add_task * Add some comments * Remove bug number from test message MozReview-Commit-ID: FXjYHD2kwWm
dom/animation/test/chrome/test_restyles.html
--- a/dom/animation/test/chrome/test_restyles.html
+++ b/dom/animation/test/chrome/test_restyles.html
@@ -689,40 +689,41 @@ waitForAllPaints(function() {
 
     is(markers.length, 1,
        'Setting an empty set of keyframes should trigger a single restyle ' +
        'to remove the previous animated style');
 
     yield ensureElementRemoval(div);
   });
 
-  add_task(function* unnecessary_update_is_not_invoked() {
-    var div = addDiv(null, { style: 'animation: opacity 10s' });
+  add_task_if_omta_enabled(function* no_restyling_when_animation_style_when_re_setting_same_animation_property() {
+    var div = addDiv(null, { style: 'animation: opacity 100s' });
     var animation = div.getAnimations()[0];
     yield animation.ready;
-    yield waitForAnimationFrames(5);
-    div.style.animation = 'opacity 10s';
+    ok(animation.isRunningOnCompositor);
+    // Apply the same animation style
+    div.style.animation = 'opacity 100s';
     var markers = yield observeStyling(5);
     is(markers.length, 0,
-       'Bug 1293806: Applying same animation style '  +
+       'Applying same animation style '  +
        'should never cause restyles');
     yield ensureElementRemoval(div);
   });
 
   add_task(function* necessary_update_should_be_invoked() {
     var div = addDiv(null, { style: 'animation: background-color 10s' });
     var animation = div.getAnimations()[0];
     yield animation.ready;
     yield waitForAnimationFrames(5);
+    // Apply another animation style
     div.style.animation = 'background-color 8s';
     var animation = div.getAnimations()[0];
-    yield animation.ready;
     var markers = yield observeStyling(5);
     is(markers.length, 5,
-       'Bug 1293806: Applying animation style with different duration '  +
-       'should cause restyles');
+       'Applying animation style with different duration '  +
+       'should cause restyles on every frame.');
     yield ensureElementRemoval(div);
   });
 
 });
 
 </script>
 </body>