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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1983543002: cc : Fix bug in LayerToPropertyTreeIndices map (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/property_tree_builder.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 56e76da262cb1960b431ff0c4e9014e8519a197f..dd9af8d18f5440d958a335d21f2d10ac681f066f 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -720,25 +720,46 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
PropertyTrees* property_trees = impl->sync_tree()->property_trees();
+ auto root_transform_id_to_index =
+ property_trees->transform_id_to_index_map.find(root_->id());
+ auto child_transform_id_to_index =
+ property_trees->transform_id_to_index_map.find(child_->id());
+ auto root_effect_id_to_index =
+ property_trees->effect_id_to_index_map.find(root_->id());
+ auto child_effect_id_to_index =
+ property_trees->effect_id_to_index_map.find(child_->id());
+ auto root_clip_id_to_index =
+ property_trees->clip_id_to_index_map.find(root_->id());
+ auto child_clip_id_to_index =
+ property_trees->clip_id_to_index_map.find(child_->id());
+ auto root_scroll_id_to_index =
+ property_trees->scroll_id_to_index_map.find(root_->id());
+ auto child_scroll_id_to_index =
+ property_trees->scroll_id_to_index_map.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.
- EXPECT_NE(property_trees->transform_id_to_index_map.find(root_->id()),
+ EXPECT_NE(root_transform_id_to_index,
property_trees->transform_id_to_index_map.end());
- EXPECT_NE(property_trees->effect_id_to_index_map.find(root_->id()),
+ EXPECT_EQ(root_transform_id_to_index->second,
+ root_->transform_tree_index());
+ EXPECT_NE(root_effect_id_to_index,
property_trees->effect_id_to_index_map.end());
- EXPECT_NE(property_trees->clip_id_to_index_map.find(root_->id()),
+ EXPECT_EQ(root_effect_id_to_index->second, root_->effect_tree_index());
+ EXPECT_NE(root_clip_id_to_index,
property_trees->clip_id_to_index_map.end());
- EXPECT_NE(property_trees->scroll_id_to_index_map.find(root_->id()),
+ EXPECT_EQ(root_clip_id_to_index->second, root_->clip_tree_index());
+ EXPECT_NE(root_scroll_id_to_index,
property_trees->scroll_id_to_index_map.end());
- EXPECT_EQ(property_trees->transform_id_to_index_map.find(child_->id()),
+ EXPECT_EQ(root_scroll_id_to_index->second, root_->scroll_tree_index());
+ EXPECT_EQ(child_transform_id_to_index,
property_trees->transform_id_to_index_map.end());
- EXPECT_EQ(property_trees->effect_id_to_index_map.find(child_->id()),
+ EXPECT_EQ(child_effect_id_to_index,
property_trees->effect_id_to_index_map.end());
- EXPECT_EQ(property_trees->clip_id_to_index_map.find(child_->id()),
+ EXPECT_EQ(child_clip_id_to_index,
property_trees->clip_id_to_index_map.end());
- EXPECT_EQ(property_trees->scroll_id_to_index_map.find(child_->id()),
+ EXPECT_EQ(child_scroll_id_to_index,
property_trees->scroll_id_to_index_map.end());
break;
case 1:
@@ -746,10 +767,15 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
// node.
EXPECT_NE(property_trees->transform_id_to_index_map.find(child_->id()),
property_trees->transform_id_to_index_map.end());
+ EXPECT_EQ(child_transform_id_to_index->second,
+ child_->transform_tree_index());
EXPECT_NE(property_trees->effect_id_to_index_map.find(child_->id()),
property_trees->effect_id_to_index_map.end());
+ EXPECT_EQ(child_effect_id_to_index->second,
+ child_->effect_tree_index());
EXPECT_NE(property_trees->clip_id_to_index_map.find(child_->id()),
property_trees->clip_id_to_index_map.end());
+ EXPECT_EQ(child_clip_id_to_index->second, child_->clip_tree_index());
EXPECT_EQ(property_trees->scroll_id_to_index_map.find(child_->id()),
property_trees->scroll_id_to_index_map.end());
break;
@@ -757,6 +783,8 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
// child_ should create a scroll node.
EXPECT_NE(property_trees->scroll_id_to_index_map.find(child_->id()),
property_trees->scroll_id_to_index_map.end());
+ EXPECT_EQ(child_scroll_id_to_index->second,
+ child_->scroll_tree_index());
break;
case 3:
// child_ should not create any property tree nodes.
« no previous file with comments | « no previous file | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698