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

Unified Diff: cc/layers/layer_position_constraint_unittest.cc

Issue 1909283004: cc: Remove LayerImpl::children() calls after tree synchronization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_position_constraint_unittest.cc
diff --git a/cc/layers/layer_position_constraint_unittest.cc b/cc/layers/layer_position_constraint_unittest.cc
index 9c060eab43a99ccfceb9131965b9e74cd60ab6a1..f61bd85e892387eb1f4914c3f30f673b29abee9e 100644
--- a/cc/layers/layer_position_constraint_unittest.cc
+++ b/cc/layers/layer_position_constraint_unittest.cc
@@ -155,14 +155,18 @@ class LayerPositionConstraintTest : public testing::Test {
SetScrollOffsetDelta(grand_child_impl_, gfx::Vector2dF());
}
root_impl_ = layer_tree_host_->CommitAndCreateLayerImplTree();
- inner_viewport_container_layer_impl_ = root_impl_->children()[0];
- scroll_layer_impl_ = inner_viewport_container_layer_impl_->children()[0];
- outer_viewport_container_layer_impl_ = scroll_layer_impl_->children()[0];
+ layer_tree_impl_ = root_impl_->layer_tree_impl();
+ inner_viewport_container_layer_impl_ =
+ layer_tree_impl_->LayerById(inner_viewport_container_layer_->id());
+ scroll_layer_impl_ = layer_tree_impl_->LayerById(scroll_layer_->id());
+ outer_viewport_container_layer_impl_ =
+ layer_tree_impl_->LayerById(outer_viewport_container_layer_->id());
child_transform_layer_impl_ =
- outer_viewport_container_layer_impl_->children()[0];
- child_impl_ = child_transform_layer_impl_->children()[0];
- grand_child_impl_ = child_impl_->children()[0];
- great_grand_child_impl_ = grand_child_impl_->children()[0];
+ layer_tree_impl_->LayerById(child_transform_layer_->id());
+ child_impl_ = layer_tree_impl_->LayerById(child_->id());
+ grand_child_impl_ = layer_tree_impl_->LayerById(grand_child_->id());
+ great_grand_child_impl_ =
+ layer_tree_impl_->LayerById(great_grand_child_->id());
}
protected:
@@ -177,6 +181,7 @@ class LayerPositionConstraintTest : public testing::Test {
scoped_refptr<Layer> child_;
scoped_refptr<Layer> grand_child_;
scoped_refptr<Layer> great_grand_child_;
+ LayerTreeImpl* layer_tree_impl_;
LayerImpl* root_impl_;
LayerImpl* inner_viewport_container_layer_impl_;
LayerImpl* scroll_layer_impl_;
@@ -575,7 +580,8 @@ TEST_F(LayerPositionConstraintTest,
fixed_position_child->SetTransform(rotation_about_z);
CommitAndUpdateImplPointers();
- LayerImpl* fixed_position_child_impl = great_grand_child_impl_->children()[0];
+ LayerImpl* fixed_position_child_impl =
+ layer_tree_impl_->LayerById(fixed_position_child->id());
// Case 1: scroll delta of 0, 0
SetScrollOffsetDelta(child_impl_, gfx::Vector2d(0, 0));
@@ -671,7 +677,8 @@ TEST_F(LayerPositionConstraintTest,
// Case 4: Bottom-right fixed-position layer.
fixed_position_child->SetPositionConstraint(fixed_to_bottom_right_);
CommitAndUpdateImplPointers();
- fixed_position_child_impl = great_grand_child_impl_->children()[0];
+ fixed_position_child_impl =
+ layer_tree_impl_->LayerById(fixed_position_child->id());
SetScrollOffsetDelta(child_impl_, gfx::Vector2d(10, 30));
SetFixedContainerSizeDelta(child_impl_, gfx::Vector2d(20, 20));
ExecuteCalculateDrawProperties(root_impl_);
@@ -732,7 +739,8 @@ TEST_F(
fixed_position_child->SetTransform(rotation_about_z);
CommitAndUpdateImplPointers();
- LayerImpl* fixed_position_child_impl = great_grand_child_impl_->children()[0];
+ LayerImpl* fixed_position_child_impl =
+ layer_tree_impl_->LayerById(fixed_position_child->id());
// Case 1: scroll delta of 0, 0
SetScrollOffsetDelta(child_impl_, gfx::Vector2d(0, 0));
@@ -1051,7 +1059,8 @@ TEST_F(LayerPositionConstraintTest,
LayerImpl* container1 = child_impl_;
LayerImpl* fixed_to_container1 = grand_child_impl_;
LayerImpl* container2 = great_grand_child_impl_;
- LayerImpl* fixed_to_container2 = container2->children()[0];
+ LayerImpl* fixed_to_container2 =
+ layer_tree_impl_->LayerById(great_great_grand_child->id());
SetScrollOffsetDelta(container1, gfx::Vector2d(0, 15));
container1->SetDrawsContent(true);
« no previous file with comments | « no previous file | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698