| 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 9547562a00eff715f0487896afeaa37be990da0f..11039c1da0315d9562febb04a3437cdd576d73a9 100644
|
| --- a/cc/trees/layer_tree_host_unittest_animation.cc
|
| +++ b/cc/trees/layer_tree_host_unittest_animation.cc
|
| @@ -825,7 +825,7 @@ class LayerTreeHostAnimationTestScrollOffsetAnimationRemoval
|
| timeline_impl->GetPlayerById(player_child_id_);
|
|
|
| LayerImpl* scroll_layer_impl =
|
| - host_impl->active_tree()->root_layer()->children()[0];
|
| + host_impl->active_tree()->LayerById(scroll_layer_->id());
|
| Animation* animation = player_impl->element_animations()
|
| ->GetAnimation(TargetProperty::SCROLL_OFFSET);
|
|
|
| @@ -847,7 +847,7 @@ class LayerTreeHostAnimationTestScrollOffsetAnimationRemoval
|
| if (host_impl->pending_tree()->source_frame_number() != 1)
|
| return;
|
| LayerImpl* scroll_layer_impl =
|
| - host_impl->pending_tree()->root_layer()->children()[0];
|
| + host_impl->pending_tree()->LayerById(scroll_layer_->id());
|
| EXPECT_EQ(final_postion_, scroll_layer_impl->CurrentScrollOffset());
|
| }
|
|
|
| @@ -855,7 +855,7 @@ class LayerTreeHostAnimationTestScrollOffsetAnimationRemoval
|
| if (host_impl->active_tree()->source_frame_number() != 1)
|
| return;
|
| LayerImpl* scroll_layer_impl =
|
| - host_impl->active_tree()->root_layer()->children()[0];
|
| + host_impl->active_tree()->LayerById(scroll_layer_->id());
|
| EXPECT_EQ(final_postion_, scroll_layer_impl->CurrentScrollOffset());
|
| EndTest();
|
| }
|
| @@ -1015,8 +1015,7 @@ class LayerTreeHostAnimationTestPendingTreeAnimatesFirstCommit
|
| scoped_refptr<AnimationPlayer> player_impl =
|
| timeline_impl->GetPlayerById(player_id_);
|
|
|
| - LayerImpl* root = host_impl->sync_tree()->root_layer();
|
| - LayerImpl* child = root->children()[0];
|
| + LayerImpl* child = host_impl->sync_tree()->LayerById(layer_->id());
|
| Animation* animation = player_impl->element_animations()->GetAnimation(
|
| TargetProperty::TRANSFORM);
|
|
|
| @@ -1173,7 +1172,7 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating
|
| if (id == host_impl->RootLayer()->id()) {
|
| Animation* anim = it.second->GetAnimation(TargetProperty::TRANSFORM);
|
| EXPECT_GT((anim->start_time() - base::TimeTicks()).InSecondsF(), 0);
|
| - } else if (id == host_impl->RootLayer()->children()[0]->id()) {
|
| + } else if (id == layer_->id()) {
|
| Animation* anim = it.second->GetAnimation(TargetProperty::OPACITY);
|
| EXPECT_GT((anim->start_time() - base::TimeTicks()).InSecondsF(), 0);
|
| }
|
| @@ -1237,8 +1236,7 @@ class LayerTreeHostAnimationTestRemoveAnimation
|
| }
|
|
|
| void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
|
| - LayerImpl* root = host_impl->active_tree()->root_layer();
|
| - LayerImpl* child = root->children()[0];
|
| + LayerImpl* child = host_impl->active_tree()->LayerById(layer_->id());
|
| switch (host_impl->active_tree()->source_frame_number()) {
|
| case 0:
|
| // No animation yet.
|
| @@ -1301,8 +1299,7 @@ class LayerTreeHostAnimationTestIsAnimating
|
| }
|
|
|
| void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
|
| - LayerImpl* root = host_impl->sync_tree()->root_layer();
|
| - LayerImpl* child = root->children()[0];
|
| + LayerImpl* child = host_impl->sync_tree()->LayerById(layer_->id());
|
| switch (host_impl->sync_tree()->source_frame_number()) {
|
| case 0:
|
| // No animation yet.
|
| @@ -1322,8 +1319,7 @@ class LayerTreeHostAnimationTestIsAnimating
|
| }
|
|
|
| void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
|
| - LayerImpl* root = host_impl->active_tree()->root_layer();
|
| - LayerImpl* child = root->children()[0];
|
| + LayerImpl* child = host_impl->active_tree()->LayerById(layer_->id());
|
| switch (host_impl->active_tree()->source_frame_number()) {
|
| case 0:
|
| // No animation yet.
|
| @@ -1396,8 +1392,7 @@ class LayerTreeHostAnimationTestAnimationFinishesDuringCommit
|
| case 2:
|
| gfx::Transform expected_transform;
|
| expected_transform.Translate(5.f, 5.f);
|
| - LayerImpl* layer_impl =
|
| - host_impl->sync_tree()->root_layer()->children()[0];
|
| + LayerImpl* layer_impl = host_impl->sync_tree()->LayerById(layer_->id());
|
| EXPECT_EQ(expected_transform, layer_impl->DrawTransform());
|
| EndTest();
|
| break;
|
|
|