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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 1139573004: Reset property tree indices when layer is removed from layer tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 591f48c43295c82059076b4a6a8cc86656a386dc..fdc02a56bd86b05c5acd1acf7d2e86b97c533f57 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -9596,5 +9596,32 @@ TEST_F(LayerTreeHostCommonTest, InputHandlersRecursiveUpdateTest) {
EXPECT_EQ(root->num_layer_or_descendants_with_input_handler(), 0);
}
+TEST_F(LayerTreeHostCommonTest, ResetPropertyTreeIndices) {
+ gfx::Transform identity;
+ gfx::Transform translate_z;
+ translate_z.Translate3d(0, 0, 10);
+
+ scoped_refptr<Layer> root = Layer::Create();
+ SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(800, 800), true, false);
+
+ scoped_refptr<Layer> child = Layer::Create();
+ SetLayerPropertiesForTesting(child.get(), translate_z, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(100, 100), true, false);
+
+ root->AddChild(child);
+
+ scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost());
+ host->SetRootLayer(root);
+
+ ExecuteCalculateDrawProperties(root.get());
ajuma 2015/05/19 20:06:23 ExecuteCalculateDrawPropertiesWithPropertyTrees (s
Ian Vollick 2015/05/19 21:11:48 Done.
+ EXPECT_NE(-1, child->transform_tree_index());
+
+ child->RemoveFromParent();
+
+ ExecuteCalculateDrawProperties(root.get());
+ EXPECT_EQ(-1, child->transform_tree_index());
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/trees/property_tree.h » ('j') | cc/trees/property_tree.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698