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

Unified Diff: cc/layers/layer_unittest.cc

Issue 1697613002: cc :: Move tracking of layer_property_changed to main thread (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/layers/layer_unittest.cc
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
index f9904c0909196616d1b88478a99956f65ed7f667..2adc73720b07e90a6077b3736499553748db089e 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -973,6 +973,39 @@ TEST_F(LayerTest, LayerPropertyChangedForSubtree) {
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(1);
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetBlendMode(arbitrary_blend_mode));
+ EXECUTE_AND_VERIFY_SUBTREE_CHANGES_RESET(
+ root->PushPropertiesTo(root_impl.get());
+ child->PushPropertiesTo(child_impl.get());
+ grand_child->PushPropertiesTo(grand_child_impl.get()));
+
+ // Should be a different size than previous call, to ensure it marks tree
+ // changed.
+ gfx::Size arbitrary_size = gfx::Size(111, 222);
+ EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(1);
+ EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetBounds(arbitrary_size));
+ EXECUTE_AND_VERIFY_SUBTREE_CHANGES_RESET(
+ root->PushPropertiesTo(root_impl.get());
+ child->PushPropertiesTo(child_impl.get());
+ grand_child->PushPropertiesTo(grand_child_impl.get()));
+
+ gfx::PointF arbitrary_point_f = gfx::PointF(0.125f, 0.25f);
+ EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(1);
+ root->SetPosition(arbitrary_point_f);
+ TransformNode* node = layer_tree_host_->property_trees()->transform_tree.Node(
+ root->transform_tree_index());
+ EXPECT_TRUE(node->data.transform_changed);
+ EXECUTE_AND_VERIFY_SUBTREE_CHANGES_RESET(
+ root->PushPropertiesTo(root_impl.get());
+ child->PushPropertiesTo(child_impl.get());
+ grand_child->PushPropertiesTo(grand_child_impl.get()));
+ EXPECT_FALSE(node->data.transform_changed);
+
+ gfx::Point3F arbitrary_point_3f = gfx::Point3F(0.125f, 0.25f, 0.f);
+ EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(1);
+ root->SetTransformOrigin(arbitrary_point_3f);
+ node = layer_tree_host_->property_trees()->transform_tree.Node(
+ root->transform_tree_index());
+ EXPECT_TRUE(node->data.transform_changed);
}
TEST_F(LayerTest, AddAndRemoveChild) {

Powered by Google App Engine
This is Rietveld 408576698