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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1952413002: cc: Remove remaining calls to LayerImpl::child_at in LayerTreeTests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/layer_tree_host_unittest_scroll.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.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 0653493a4586efe5320834788977c5172de0c350..ead75c7a5cf4bc7c251ca5047784ee861727b282 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -739,12 +739,12 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDamageWithReplica);
class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
protected:
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create();
- scoped_refptr<Layer> child = Layer::Create();
+ root_ = Layer::Create();
+ child_ = Layer::Create();
// This is to force the child to create a transform and effect node.
- child->SetForceRenderSurfaceForTesting(true);
- root->AddChild(std::move(child));
- layer_tree_host()->SetRootLayer(root);
+ child_->SetForceRenderSurfaceForTesting(true);
+ root_->AddChild(child_);
+ layer_tree_host()->SetRootLayer(root_);
LayerTreeHostTest::SetupTree();
}
@@ -785,13 +785,16 @@ class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
break;
case TRANSFORM:
index_++;
- EXPECT_TRUE(impl->active_tree()->root_layer()->LayerPropertyChanged());
+ EXPECT_TRUE(impl->active_tree()
+ ->LayerById(root_->id())
+ ->LayerPropertyChanged());
impl->active_tree()->ResetAllChangeTracking(
PropertyTrees::ResetFlags::EFFECT_TREE);
- EXPECT_FALSE(impl->active_tree()->root_layer()->LayerPropertyChanged());
EXPECT_FALSE(impl->active_tree()
- ->root_layer()
- ->child_at(0)
+ ->LayerById(root_->id())
+ ->LayerPropertyChanged());
+ EXPECT_FALSE(impl->active_tree()
+ ->LayerById(child_->id())
->LayerPropertyChanged());
transform.Translate(10, 10);
impl->active_tree()->root_layer()->OnTransformAnimated(transform);
@@ -801,15 +804,13 @@ class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
index_++;
EXPECT_TRUE(impl->active_tree()->root_layer()->LayerPropertyChanged());
EXPECT_TRUE(impl->active_tree()
- ->root_layer()
- ->child_at(0)
+ ->LayerById(child_->id())
->LayerPropertyChanged());
impl->active_tree()->ResetAllChangeTracking(
PropertyTrees::ResetFlags::TRANSFORM_TREE);
EXPECT_FALSE(impl->active_tree()->root_layer()->LayerPropertyChanged());
EXPECT_FALSE(impl->active_tree()
- ->root_layer()
- ->child_at(0)
+ ->LayerById(child_->id())
->LayerPropertyChanged());
filters.Append(FilterOperation::CreateOpacityFilter(0.5f));
impl->active_tree()->root_layer()->OnFilterAnimated(filters);
@@ -823,7 +824,11 @@ class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
}
void AfterTest() override {}
+
+ private:
int index_;
+ scoped_refptr<Layer> root_;
+ scoped_refptr<Layer> child_;
};
SINGLE_THREAD_TEST_F(LayerTreeHostTestPropertyTreesChangedSync);
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698