| 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 29cc4f44ff52e86f80aa2695384adff12b24af7e..0a9d49e4766fb4a349e8c058380fa667d4165ad1 100644
|
| --- a/cc/trees/layer_tree_host_unittest_animation.cc
|
| +++ b/cc/trees/layer_tree_host_unittest_animation.cc
|
| @@ -264,18 +264,18 @@ class LayerTreeHostAnimationTestTickAnimationWhileBackgrounded
|
| PostAddAnimationToMainThread(layer_tree_host()->root_layer());
|
| }
|
|
|
| + virtual void DidCommit() OVERRIDE {
|
| + layer_tree_host()->SetVisible(false);
|
| + }
|
| +
|
| // Use WillAnimateLayers to set visible false before the animation runs and
|
| // causes a commit, so we block the second visible animate in single-thread
|
| // mode.
|
| virtual void WillAnimateLayers(
|
| LayerTreeHostImpl* host_impl,
|
| base::TimeTicks monotonic_time) OVERRIDE {
|
| - if (num_animates_ < 2) {
|
| - if (!num_animates_) {
|
| - // We have a long animation running. It should continue to tick even
|
| - // if we are not visible.
|
| - PostSetVisibleToMainThread(false);
|
| - }
|
| + TRACE_EVENT0("cc", __PRETTY_FUNCTION__);
|
| + if (num_animates_ < 3) {
|
| num_animates_++;
|
| return;
|
| }
|
| @@ -311,6 +311,8 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction
|
| virtual void AnimateLayers(
|
| LayerTreeHostImpl* host_impl,
|
| base::TimeTicks monotonic_time) OVERRIDE {
|
| + if (!layer_tree_host()->root_layer())
|
| + return;
|
| LayerAnimationController* controller =
|
| layer_tree_host()->root_layer()->children()[0]->
|
| layer_animation_controller();
|
| @@ -331,6 +333,8 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction
|
| // because of the default ease timing function.
|
| EXPECT_FLOAT_EQ(linearly_interpolated_opacity, curve->GetValue(time));
|
|
|
| + if (!host_impl->active_tree()->root_layer())
|
| + return;
|
| LayerAnimationController* controller_impl =
|
| host_impl->active_tree()->root_layer()->children()[0]->
|
| layer_animation_controller();
|
| @@ -357,7 +361,8 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes
|
| : public LayerTreeHostAnimationTest {
|
| public:
|
| LayerTreeHostAnimationTestSynchronizeAnimationStartTimes()
|
| - : main_start_time_(-1.0),
|
| + : test_is_setup_(false),
|
| + main_start_time_(-1.0),
|
| impl_start_time_(-1.0) {}
|
|
|
| virtual void SetupTree() OVERRIDE {
|
| @@ -366,6 +371,7 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes
|
| content_->SetBounds(gfx::Size(4, 4));
|
| content_->set_layer_animation_delegate(this);
|
| layer_tree_host()->root_layer()->AddChild(content_);
|
| + test_is_setup_ = true;
|
| }
|
|
|
| virtual void BeginTest() OVERRIDE {
|
| @@ -388,6 +394,9 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes
|
| virtual void UpdateAnimationState(
|
| LayerTreeHostImpl* impl_host,
|
| bool has_unfinished_animation) OVERRIDE {
|
| + if (!test_is_setup_ || !impl_host->active_tree()->root_layer())
|
| + return;
|
| +
|
| LayerAnimationController* controller =
|
| impl_host->active_tree()->root_layer()->children()[0]->
|
| layer_animation_controller();
|
| @@ -408,6 +417,7 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes
|
| }
|
|
|
| private:
|
| + bool test_is_setup_;
|
| double main_start_time_;
|
| double impl_start_time_;
|
| FakeContentLayerClient client_;
|
|
|