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

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 6300622773729219ec593cb5e42f208b90f274f7..3634d3dcde6bfa506df301eaf1a7d967bb9caf9a 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -1042,5 +1042,54 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestAddAnimationAfterAnimating);
+class LayerTreeHostAnimationTestNotifyAnimationFinished
+ : public LayerTreeHostAnimationTest {
+ public:
+ void SetupTree() override {
+ LayerTreeHostAnimationTest::SetupTree();
+ content_ = FakeContentLayer::Create(layer_settings(), &client_);
+ content_->SetBounds(gfx::Size(4, 4));
+ content_->set_layer_animation_delegate(this);
+ layer_tree_host()->root_layer()->AddChild(content_);
+ }
+
+ void BeginTest() override {
+ layer_tree_host()->SetViewportSize(gfx::Size());
+ PostAddLongAnimationToMainThread(content_.get());
+ }
+
+ void NotifyAnimationStarted(base::TimeTicks monotonic_time,
+ Animation::TargetProperty target_property,
+ int group) override {
+ is_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 {
+ is_called_animation_finished_ = true;
+ EndTest();
+ }
+
+ void AfterTest() override {
+ EXPECT_TRUE(is_called_animation_started_);
+ EXPECT_TRUE(is_called_animation_finished_);
+ }
+
+ private:
+ bool is_called_animation_started_ = false;
+ bool is_called_animation_finished_ = false;
+ FakeContentLayerClient client_;
+ scoped_refptr<FakeContentLayer> content_;
+};
+
+TEST_F(LayerTreeHostAnimationTestNotifyAnimationFinished,
Lof 2015/06/05 20:07:43 Could you please use SINGLE_AND_MULTI_THREAD_TEST_
+ MainThreadAnimationNoCallbackTest) {
+ RunTest(false, false, false);
+}
+
} // 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