Bug 1298571 - Add test cases for bug 1293806 r=hiro
authorSatoshi Kojima <skoji@mac.com>
Mon, 29 Aug 2016 17:40:42 +0900
changeset 311750 02a345df379c3d36556166722ca712a24fb29070
parent 311749 ee96068b9523274d9354b0b530f97d2b15ce9a08
child 311751 481d77e756cb34de51ffbb82e44bc8ff09b3a79f
push id20417
push userryanvm@gmail.com
push dateTue, 30 Aug 2016 13:55:34 +0000
treeherderfx-team@b18c8bcdc116 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs1298571, 1293806
milestone51.0a1
Bug 1298571 - Add test cases for bug 1293806 r=hiro MozReview-Commit-ID: 7pqjv3w1pbM
dom/animation/test/chrome/test_restyles.html
--- a/dom/animation/test/chrome/test_restyles.html
+++ b/dom/animation/test/chrome/test_restyles.html
@@ -689,12 +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_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;
+    ok(animation.isRunningOnCompositor);
+    // Apply the same animation style
+    div.style.animation = 'opacity 100s';
+    var markers = yield observeStyling(5);
+    is(markers.length, 0,
+       '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 100s' });
+    var animation = div.getAnimations()[0];
+    yield animation.ready;
+    yield waitForAnimationFrames(5);
+    // Apply another animation style
+    div.style.animation = 'background-color 110s';
+    var animation = div.getAnimations()[0];
+    var markers = yield observeStyling(5);
+    is(markers.length, 5,
+       'Applying animation style with different duration '  +
+       'should cause restyles on every frame.');
+    yield ensureElementRemoval(div);
+  });
+
 });
 
 </script>
 </body>