| 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..7a50216faf0bf8792eadbcdf921c63fe231f74fb 100644
|
| --- a/cc/trees/layer_tree_host_unittest_animation.cc
|
| +++ b/cc/trees/layer_tree_host_unittest_animation.cc
|
| @@ -314,10 +314,9 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction
|
| LayerTreeHostImpl* host_impl,
|
| base::TimeTicks monotonic_time) OVERRIDE {
|
| LayerAnimationController* controller_impl =
|
| - host_impl->active_tree()->root_layer()->children()[0]->
|
| - layer_animation_controller();
|
| - Animation* animation =
|
| - controller_impl->GetAnimation(Animation::Opacity);
|
| + host_impl->active_tree()->root_layer()->children()[0]
|
| + ->layer_animation_controller();
|
| + Animation* animation = controller_impl->GetAnimation(Animation::Opacity);
|
| if (!animation)
|
| return;
|
|
|
| @@ -383,10 +382,9 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes
|
| LayerTreeHostImpl* impl_host,
|
| bool has_unfinished_animation) OVERRIDE {
|
| LayerAnimationController* controller =
|
| - impl_host->active_tree()->root_layer()->children()[0]->
|
| - layer_animation_controller();
|
| - Animation* animation =
|
| - controller->GetAnimation(Animation::Opacity);
|
| + impl_host->active_tree()->root_layer()->children()[0]
|
| + ->layer_animation_controller();
|
| + Animation* animation = controller->GetAnimation(Animation::Opacity);
|
| if (!animation)
|
| return;
|
|
|
| @@ -743,16 +741,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,12 +776,14 @@ 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_);
|
| finished_times_++;
|
| - EndTest();
|
| + if (prevented_draw_)
|
| + EndTest();
|
| }
|
|
|
| virtual void AfterTest() OVERRIDE {
|
| + // Make sure both animations were added.
|
| + EXPECT_EQ(2, added_animations_);
|
| // Make sure we tried to draw the second animation but failed.
|
| EXPECT_LT(0, prevented_draw_);
|
| // The first animation should be started, but the second should not because
|
|
|