| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "cc/animation/animation_curve.h" | 7 #include "cc/animation/animation_curve.h" |
| 8 #include "cc/animation/layer_animation_controller.h" | 8 #include "cc/animation/layer_animation_controller.h" |
| 9 #include "cc/animation/timing_function.h" | 9 #include "cc/animation/timing_function.h" |
| 10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
| 11 #include "cc/layers/layer_impl.h" | 11 #include "cc/layers/layer_impl.h" |
| 12 #include "cc/test/animation_test_common.h" | 12 #include "cc/test/animation_test_common.h" |
| 13 #include "cc/test/fake_content_layer.h" | 13 #include "cc/test/fake_content_layer.h" |
| 14 #include "cc/test/fake_content_layer_client.h" | 14 #include "cc/test/fake_content_layer_client.h" |
| 15 #include "cc/test/layer_tree_test.h" | 15 #include "cc/test/layer_tree_test.h" |
| 16 #include "cc/trees/layer_tree_impl.h" | 16 #include "cc/trees/layer_tree_impl.h" |
| 17 | 17 |
| 18 namespace cc { | 18 namespace cc { |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 class LayerTreeHostAnimationTest : public LayerTreeTest { | 21 class LayerTreeHostAnimationTest : public LayerTreeTest { |
| 22 public: | 22 public: |
| 23 virtual void SetupTree() OVERRIDE { | 23 virtual void SetupTree() OVERRIDE { |
| 24 LayerTreeTest::SetupTree(); | 24 LayerTreeTest::SetupTree(); |
| 25 layer_tree_host()->root_layer()->set_layer_animation_delegate(this); | 25 layer_tree_host()->root_layer()->set_layer_animation_delegate(this); |
| 26 } | 26 } |
| 27 |
| 28 virtual void InitializeSettings(LayerTreeSettings* settings) { |
| 29 settings->max_bytes_pending_upload = 16 * 1024 * 1024; |
| 30 } |
| 27 }; | 31 }; |
| 28 | 32 |
| 29 // Makes sure that SetNeedsAnimate does not cause the CommitRequested() state to | 33 // Makes sure that SetNeedsAnimate does not cause the CommitRequested() state to |
| 30 // be set. | 34 // be set. |
| 31 class LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested | 35 class LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested |
| 32 : public LayerTreeHostAnimationTest { | 36 : public LayerTreeHostAnimationTest { |
| 33 public: | 37 public: |
| 34 LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested() | 38 LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested() |
| 35 : num_commits_(0) {} | 39 : num_commits_(0) {} |
| 36 | 40 |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 content_ = FakeContentLayer::Create(&client_); | 719 content_ = FakeContentLayer::Create(&client_); |
| 716 content_->SetBounds(gfx::Size(4, 4)); | 720 content_->SetBounds(gfx::Size(4, 4)); |
| 717 content_->set_layer_animation_delegate(this); | 721 content_->set_layer_animation_delegate(this); |
| 718 layer_tree_host()->root_layer()->AddChild(content_); | 722 layer_tree_host()->root_layer()->AddChild(content_); |
| 719 } | 723 } |
| 720 | 724 |
| 721 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | 725 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
| 722 // Make sure that drawing many times doesn't cause a checkerboarded | 726 // Make sure that drawing many times doesn't cause a checkerboarded |
| 723 // animation to start so we avoid flake in this test. | 727 // animation to start so we avoid flake in this test. |
| 724 settings->timeout_and_draw_when_animation_checkerboards = false; | 728 settings->timeout_and_draw_when_animation_checkerboards = false; |
| 729 settings->max_bytes_pending_upload = 16 * 1024 * 1024; |
| 725 } | 730 } |
| 726 | 731 |
| 727 virtual void BeginTest() OVERRIDE { | 732 virtual void BeginTest() OVERRIDE { |
| 728 prevented_draw_ = 0; | 733 prevented_draw_ = 0; |
| 729 added_animations_ = 0; | 734 added_animations_ = 0; |
| 730 started_times_ = 0; | 735 started_times_ = 0; |
| 731 finished_times_ = 0; | 736 finished_times_ = 0; |
| 732 | 737 |
| 733 PostSetNeedsCommitToMainThread(); | 738 PostSetNeedsCommitToMainThread(); |
| 734 } | 739 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 int finished_times_; | 802 int finished_times_; |
| 798 FakeContentLayerClient client_; | 803 FakeContentLayerClient client_; |
| 799 scoped_refptr<FakeContentLayer> content_; | 804 scoped_refptr<FakeContentLayer> content_; |
| 800 }; | 805 }; |
| 801 | 806 |
| 802 MULTI_THREAD_TEST_F( | 807 MULTI_THREAD_TEST_F( |
| 803 LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations); | 808 LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations); |
| 804 | 809 |
| 805 } // namespace | 810 } // namespace |
| 806 } // namespace cc | 811 } // namespace cc |
| OLD | NEW |