Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Unified Diff: cc/trees/layer_tree_host_unittest_animation.cc

Issue 1905713002: cc: Remove LayerImpl::children() calls from descendants of LayerTreeTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698