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

Unified Diff: cc/animation/element_animations_unittest.cc

Issue 2527623002: add has_element_in_any_list check in ElementAnimations::UpdateActivation (Closed)
Patch Set: Deactivate ElementAnimations from AnimationHost if no element in any list Created 4 years, 1 month 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 d494e72655ce3c924849f6861c75a72f4c7016bb..eec01eb62eb1cdce23aa81a90a8be4e9f69f6254 100644
--- a/cc/animation/element_animations_unittest.cc
+++ b/cc/animation/element_animations_unittest.cc
@@ -3633,5 +3633,26 @@ TEST_F(ElementAnimationsTest, TestIsAnimatingPropertyTimeOffsetFillMode) {
ElementListType::ACTIVE));
}
+TEST_F(ElementAnimationsTest, UnregisterElementBeforePushProperties) {
+ CreateTestLayer(false, false);
+ AttachTimelinePlayerLayer();
+ EXPECT_EQ(0u, host_->active_element_animations_for_testing().size());
+
+ player_->AddAnimation(CreateAnimation(
+ std::unique_ptr<AnimationCurve>(new FakeFloatTransition(1.0, 1.f, 0.5f)),
+ 2, TargetProperty::OPACITY));
+ EXPECT_EQ(1u, host_->active_element_animations_for_testing().size());
+
+ host_->UnregisterElement(element_id_, ElementListType::ACTIVE);
loyso (OOO) 2016/11/28 00:05:53 Please, introduce void AnimationTimelinesTest::Des
junchao.han 2016/11/28 04:09:03 Done.
+ EXPECT_EQ(0u, host_->active_element_animations_for_testing().size());
+
+ PushProperties();
+ EXPECT_EQ(0u, host_->active_element_animations_for_testing().size());
+ EXPECT_EQ(1u, host_impl_->active_element_animations_for_testing().size());
loyso (OOO) 2016/11/27 23:38:53 This should be 0 since we don't have any impl-side
junchao.han 2016/11/28 04:09:03 Done.
+
+ host_impl_->AnimateLayers(kInitialTickTime);
+ EXPECT_EQ(0u, host_impl_->active_element_animations_for_testing().size());
+}
+
} // namespace
} // namespace cc
« 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