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

Unified Diff: cc/trees/layer_tree_host_unittest_animation.cc

Issue 1151763011: Fix assumptions made in LAC::MarkAnimationsForDeletion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 6 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
« no previous file with comments | « cc/animation/layer_animation_controller_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_animation.cc
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index b1287d3024820684d51d3fb3577ff41da4a7b816..45e345623d8f4de7e608a54725ec31fccb3df4bc 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -1035,5 +1035,55 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestAddAnimationAfterAnimating);
+class LayerTreeHostAnimationTestNotifyAnimationFinished
+ : public LayerTreeHostAnimationTest {
+ public:
+ LayerTreeHostAnimationTestNotifyAnimationFinished()
+ : called_animation_started_(false), called_animation_finished_(false) {}
+
+ void SetupTree() override {
+ LayerTreeHostAnimationTest::SetupTree();
+ picture_ = FakePictureLayer::Create(layer_settings(), &client_);
+ picture_->SetBounds(gfx::Size(4, 4));
+ picture_->set_layer_animation_delegate(this);
+ layer_tree_host()->root_layer()->AddChild(picture_);
+ }
+
+ void BeginTest() override {
+ layer_tree_host()->SetViewportSize(gfx::Size());
+ PostAddLongAnimationToMainThread(picture_.get());
+ }
+
+ void NotifyAnimationStarted(base::TimeTicks monotonic_time,
+ Animation::TargetProperty target_property,
+ int group) override {
+ called_animation_started_ = true;
+ layer_tree_host()->AnimateLayers(
+ base::TimeTicks::FromInternalValue(std::numeric_limits<int64>::max()));
+ PostSetNeedsCommitToMainThread();
+ }
+
+ void NotifyAnimationFinished(base::TimeTicks monotonic_time,
+ Animation::TargetProperty target_property,
+ int group) override {
+ called_animation_finished_ = true;
+ EndTest();
+ }
+
+ void AfterTest() override {
+ EXPECT_TRUE(called_animation_started_);
+ EXPECT_TRUE(called_animation_finished_);
+ }
+
+ private:
+ bool called_animation_started_;
+ bool called_animation_finished_;
+ FakeContentLayerClient client_;
+ scoped_refptr<FakePictureLayer> picture_;
+};
+
+SINGLE_AND_MULTI_THREAD_TEST_F(
+ LayerTreeHostAnimationTestNotifyAnimationFinished);
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/animation/layer_animation_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698