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 dbc427504d846299a8e807775e72974eb38f396f..fad2607da107f0421cc2f0b748f334824bc8b7b4 100644 |
--- a/cc/trees/layer_tree_host_unittest_animation.cc |
+++ b/cc/trees/layer_tree_host_unittest_animation.cc |
@@ -270,6 +270,9 @@ class LayerTreeHostAnimationTestTickAnimationWhileBackgrounded |
virtual void WillAnimateLayers( |
LayerTreeHostImpl* host_impl, |
base::TimeTicks monotonic_time) OVERRIDE { |
+ if (!host_impl->active_tree()->root_layer()) |
enne (OOO)
2013/08/15 19:47:59
I'm a little confused why animation is happening w
brianderson
2013/08/15 23:05:10
I would be fine with moving the early out up to th
brianderson
2013/08/15 23:45:12
Animation used to be coupled with drawing, but thi
enne (OOO)
2013/08/16 00:53:22
Yeah. LayerTreeHostImpl::Animate does this check.
|
+ return; |
+ |
// Verify that the host can draw, it's just not visible. |
EXPECT_TRUE(host_impl->CanDraw()); |
if (num_animates_ < 2) { |
@@ -313,6 +316,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(); |
@@ -382,6 +387,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(); |
@@ -743,16 +751,18 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations |
virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
LayerTreeHostImpl::FrameData* frame_data, |
bool result) OVERRIDE { |
- if (added_animations_ < 2) |
+ if (host_impl->active_tree()->source_frame_number() < 2) |
return result; |
if (TestEnded()) |
return result; |
// Act like there is checkerboard when the second animation wants to draw. |
++prevented_draw_; |
+ if (finished_times_) |
+ EndTest(); |
return false; |
} |
- virtual void DidCommitAndDrawFrame() OVERRIDE { |
+ virtual void DidCommit() OVERRIDE { |
switch (layer_tree_host()->source_frame_number()) { |
case 1: |
// The animation is longer than 1 BeginFrame interval. |
@@ -776,9 +786,9 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations |
virtual void NotifyAnimationFinished(double wall_clock_time) OVERRIDE { |
// We should be checkerboarding already, but it should still finish the |
// first animation. |
- EXPECT_EQ(2, added_animations_); |
enne (OOO)
2013/08/15 19:47:59
Just as a sanity check, move this to AfterTest rat
brianderson
2013/08/15 23:05:10
Ok.
|
finished_times_++; |
- EndTest(); |
+ if (prevented_draw_) |
+ EndTest(); |
} |
virtual void AfterTest() OVERRIDE { |