Chromium Code Reviews| 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 |