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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 2655233006: cc : Clean up cc clip tree (Closed)
Patch Set: blink_tests Created 3 years, 9 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
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 921e22db5a4db4377cce0b3a242af5eff1be2cda..5dafbec5acaccc0c7cfb3825e0e01dc42e35865e 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -803,7 +803,7 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
void DidCommit() override {
switch (layer_tree_host()->SourceFrameNumber()) {
case 1:
- // child_ should create transform, effect, clip node.
+ // child_ should create transform, effect node.
child_->SetForceRenderSurfaceForTesting(true);
break;
case 2:
@@ -811,7 +811,12 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
child_->SetScrollClipLayerId(root_->id());
break;
case 3:
+ // child_ should create a clip node.
+ child_->SetMasksToBounds(true);
+ break;
+ case 4:
// child_ should not create any property tree node.
+ child_->SetMasksToBounds(false);
child_->SetForceRenderSurfaceForTesting(false);
child_->SetScrollClipLayerId(Layer::INVALID_ID);
}
@@ -837,8 +842,8 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
property_trees->layer_id_to_scroll_node_index.find(child_->id());
switch (impl->sync_tree()->source_frame_number()) {
case 0:
- // root_ should create every property tree node and child_ should not
- // create any.
+ // root_ should create transform, scroll and effect tree nodes but not
+ // a clip node.
EXPECT_NE(root_transform_id_to_index,
property_trees->layer_id_to_transform_node_index.end());
EXPECT_EQ(root_transform_id_to_index->second,
@@ -846,12 +851,11 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
EXPECT_NE(root_effect_id_to_index,
property_trees->layer_id_to_effect_node_index.end());
EXPECT_EQ(root_effect_id_to_index->second, root_->effect_tree_index());
- EXPECT_NE(root_clip_id_to_index,
- property_trees->layer_id_to_clip_node_index.end());
- EXPECT_EQ(root_clip_id_to_index->second, root_->clip_tree_index());
EXPECT_NE(root_scroll_id_to_index,
property_trees->layer_id_to_scroll_node_index.end());
EXPECT_EQ(root_scroll_id_to_index->second, root_->scroll_tree_index());
+ EXPECT_EQ(root_clip_id_to_index,
+ property_trees->layer_id_to_clip_node_index.end());
EXPECT_EQ(child_transform_id_to_index,
property_trees->layer_id_to_transform_node_index.end());
EXPECT_EQ(child_effect_id_to_index,
@@ -862,7 +866,7 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
property_trees->layer_id_to_scroll_node_index.end());
break;
case 1:
- // child_ should create a transfrom, clip, effect nodes but not a scroll
+ // child_ should create a transfrom, effect nodes but not a scroll, clip
// node.
EXPECT_NE(
property_trees->layer_id_to_transform_node_index.find(child_->id()),
@@ -874,10 +878,9 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
property_trees->layer_id_to_effect_node_index.end());
EXPECT_EQ(child_effect_id_to_index->second,
child_->effect_tree_index());
- EXPECT_NE(
+ EXPECT_EQ(
property_trees->layer_id_to_clip_node_index.find(child_->id()),
property_trees->layer_id_to_clip_node_index.end());
- EXPECT_EQ(child_clip_id_to_index->second, child_->clip_tree_index());
EXPECT_EQ(
property_trees->layer_id_to_scroll_node_index.find(child_->id()),
property_trees->layer_id_to_scroll_node_index.end());
@@ -891,6 +894,13 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
child_->scroll_tree_index());
break;
case 3:
+ // child_ should create a clip node.
+ EXPECT_NE(
+ property_trees->layer_id_to_clip_node_index.find(child_->id()),
+ property_trees->layer_id_to_clip_node_index.end());
+ EXPECT_EQ(child_clip_id_to_index->second, child_->clip_tree_index());
+ break;
+ case 4:
// child_ should not create any property tree nodes.
EXPECT_EQ(
property_trees->layer_id_to_transform_node_index.find(child_->id()),

Powered by Google App Engine
This is Rietveld 408576698