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

Unified Diff: cc/layers/layer_unittest.cc

Issue 2331983002: cc: Make LayerTreeHost a protected Layer member. (Closed)
Patch Set: settings Created 4 years, 3 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/layers/layer_proto_converter_unittest.cc ('k') | cc/layers/nine_patch_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_unittest.cc
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
index 933df2b7095b9f28d2fcf7cd8d3962cd5a46ebbc..46818fa3b1a86e4e84cfbf1b8a7743abccd54b24 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -58,7 +58,7 @@ using ::testing::_;
#define EXECUTE_AND_VERIFY_SUBTREE_CHANGED(code_to_test) \
code_to_test; \
- root->layer_tree_host()->BuildPropertyTreesForTesting(); \
+ root->GetLayerTree()->BuildPropertyTreesForTesting(); \
EXPECT_TRUE(root->subtree_property_changed()); \
EXPECT_TRUE( \
root->GetLayerTree()->LayerNeedsPushPropertiesForTesting(root.get())); \
@@ -84,7 +84,7 @@ using ::testing::_;
#define EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(code_to_test) \
code_to_test; \
- root->layer_tree_host()->BuildPropertyTreesForTesting(); \
+ root->GetLayerTree()->BuildPropertyTreesForTesting(); \
EXPECT_TRUE(root->layer_property_changed()); \
EXPECT_FALSE(root->subtree_property_changed()); \
EXPECT_TRUE( \
@@ -1889,7 +1889,7 @@ class LayerTreeHostFactory {
};
void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) {
- EXPECT_EQ(host, layer->layer_tree_host());
+ EXPECT_EQ(host, layer->GetLayerTreeHostForTesting());
for (size_t i = 0; i < layer->children().size(); ++i)
AssertLayerTreeHostMatchesForSubtree(layer->children()[i].get(), host);
@@ -1943,7 +1943,7 @@ TEST_F(LayerLayerTreeHostTest, AddingLayerSubtree) {
layer_tree->SetRootLayer(parent.get());
- EXPECT_EQ(parent->layer_tree_host(), layer_tree_host.get());
+ EXPECT_EQ(parent->GetLayerTreeHostForTesting(), layer_tree_host.get());
// Adding a subtree to a layer already associated with a host should set the
// host pointer on all layers in that subtree.
@@ -2023,9 +2023,10 @@ TEST_F(LayerLayerTreeHostTest, ChangeHostInSubtree) {
second_parent->AddChild(second_child);
// The moved layer and its children should point to the new host.
- EXPECT_EQ(second_layer_tree_host.get(), second_child->layer_tree_host());
EXPECT_EQ(second_layer_tree_host.get(),
- second_grand_child->layer_tree_host());
+ second_child->GetLayerTreeHostForTesting());
+ EXPECT_EQ(second_layer_tree_host.get(),
+ second_grand_child->GetLayerTreeHostForTesting());
// Test over, cleanup time.
first_layer_tree_host->GetLayerTree()->SetRootLayer(nullptr);
@@ -2054,13 +2055,13 @@ TEST_F(LayerLayerTreeHostTest, ReplaceMaskAndReplicaLayer) {
// Replacing the mask should clear out the old mask's subtree's host pointers.
parent->SetMaskLayer(mask_replacement.get());
- EXPECT_EQ(nullptr, mask->layer_tree_host());
- EXPECT_EQ(nullptr, mask_child->layer_tree_host());
+ EXPECT_EQ(nullptr, mask->GetLayerTreeHostForTesting());
+ EXPECT_EQ(nullptr, mask_child->GetLayerTreeHostForTesting());
// Same for replacing a replica layer.
parent->SetReplicaLayer(replica_replacement.get());
- EXPECT_EQ(nullptr, replica->layer_tree_host());
- EXPECT_EQ(nullptr, replica_child->layer_tree_host());
+ EXPECT_EQ(nullptr, replica->GetLayerTreeHostForTesting());
+ EXPECT_EQ(nullptr, replica_child->GetLayerTreeHostForTesting());
// Test over, cleanup time.
layer_tree_host->GetLayerTree()->SetRootLayer(nullptr);
@@ -2093,7 +2094,7 @@ TEST_F(LayerTest, SafeOpaqueBackgroundColor) {
: SK_ColorTRANSPARENT);
layer_tree->property_trees()->needs_rebuild = true;
- layer_tree_host->BuildPropertyTreesForTesting();
+ layer_tree_host->GetLayerTree()->BuildPropertyTreesForTesting();
SkColor safe_color = layer->SafeOpaqueBackgroundColor();
if (contents_opaque) {
EXPECT_EQ(SkColorGetA(safe_color), 255u)
« no previous file with comments | « cc/layers/layer_proto_converter_unittest.cc ('k') | cc/layers/nine_patch_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698