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 fa4b88632b366eb61b42e1ec4be1cec63d25e3c9..e6677c911b892b772f8211f9ef1a63909f284dde 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 DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
+ if (num_animates_ == 1) |
+ PostSetVisibleToMainThread(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); |
- } |
+ 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 (!host_impl->active_tree()->root_layer()) |
+ return; |
LayerAnimationController* controller_impl = |
host_impl->active_tree()->root_layer()->children()[0]-> |
layer_animation_controller(); |
@@ -380,6 +382,9 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes |
virtual void UpdateAnimationState( |
LayerTreeHostImpl* impl_host, |
bool has_unfinished_animation) OVERRIDE { |
+ if (!impl_host->active_tree()->root_layer()) |
+ return; |
+ |
LayerAnimationController* controller = |
impl_host->active_tree()->root_layer()->children()[0]-> |
layer_animation_controller(); |