Bug 1298571 - Add test cases for bug 1293806 r?hiro draft
authorSatoshi Kojima <skoji@mac.com>
Mon, 29 Aug 2016 17:40:42 +0900
changeset 406922 c3d8f416dc6b2911c52b02ef684c30cf6ac91314
parent 406450 1a5b53a831e5a6c20de1b081c774feb3ff76756c
child 529796 6107824a4cf01a305d833edc96d7ae352b41fb92
push id27879
push userbmo:skoji@mac.com
push dateTue, 30 Aug 2016 00:35:46 +0000
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>