Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: cc/animation/element_animations_unittest.cc

Issue 2346583002: cc : Fix the bug in tracking currently running animations for an element (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« cc/animation/element_animations.cc ('K') | « cc/animation/element_animations.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/element_animations_unittest.cc
diff --git a/cc/animation/element_animations_unittest.cc b/cc/animation/element_animations_unittest.cc
index c2fb1dfb3964beb25088c1c3011772751ff6c669..ec1a4b54c6abc9bc5869bc9d34ac36b6d8552775 100644
--- a/cc/animation/element_animations_unittest.cc
+++ b/cc/animation/element_animations_unittest.cc
@@ -2888,6 +2888,12 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenTransformAnimationChanges) {
// Case 2: An animation that's removed before it finishes.
int animation_id =
AddAnimatedTransformToElementAnimations(animations.get(), 10.0, 2, 2);
+ int animation2_id =
+ AddAnimatedTransformToElementAnimations(animations.get(), 10.0, 2, 1);
+ animations->GetAnimationById(animation2_id)
+ ->set_time_offset(base::TimeDelta::FromMilliseconds(-10000));
+ animations->GetAnimationById(animation2_id)
+ ->set_fill_mode(Animation::FillMode::NONE);
EXPECT_TRUE(client_.GetHasPotentialTransformAnimation(
element_id_, ElementListType::ACTIVE));
EXPECT_TRUE(client_.GetTransformIsCurrentlyAnimating(
@@ -2906,6 +2912,9 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenTransformAnimationChanges) {
animations_impl->ActivateAnimations();
EXPECT_TRUE(client_impl_.GetHasPotentialTransformAnimation(
element_id_, ElementListType::ACTIVE));
+ // animation1 is in effect currently and animation2 isn't. As the element has
+ // atleast one animation that's in effect currently, client should be notified
+ // that the transform is currently animating.
ajuma 2016/09/14 21:41:13 Would one of the tests above also have failed with
jaydasika 2016/09/14 21:50:55 Yes, the test in line 2906.
EXPECT_TRUE(client_impl_.GetTransformIsCurrentlyAnimating(
element_id_, ElementListType::ACTIVE));
@@ -2917,6 +2926,7 @@ TEST_F(ElementAnimationsTest, ObserverNotifiedWhenTransformAnimationChanges) {
events->events_.clear();
animations->RemoveAnimation(animation_id);
+ animations->RemoveAnimation(animation2_id);
EXPECT_FALSE(client_.GetHasPotentialTransformAnimation(
element_id_, ElementListType::ACTIVE));
EXPECT_FALSE(client_.GetTransformIsCurrentlyAnimating(
« cc/animation/element_animations.cc ('K') | « cc/animation/element_animations.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698