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

Unified Diff: cc/layers/layer_unittest.cc

Issue 2099743002: cc: Move background filters to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ' Created 4 years, 6 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_impl_unittest.cc ('k') | cc/layers/render_surface_impl.h » ('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 4622cdd629b3d1edcc233aeb3094aaf1519bb7c2..6af0def7d0f1067cb891a7e415a94cb1eb93fe7b 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -80,6 +80,23 @@ using ::testing::_;
grand_child->layer_tree_host()->LayerNeedsPushPropertiesForTesting( \
grand_child.get()));
+#define EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(code_to_test) \
+ code_to_test; \
+ root->layer_tree_host()->BuildPropertyTreesForTesting(); \
+ EXPECT_TRUE(root->layer_property_changed()); \
+ EXPECT_FALSE(root->subtree_property_changed()); \
+ EXPECT_TRUE(root->layer_tree_host()->LayerNeedsPushPropertiesForTesting( \
+ root.get())); \
+ EXPECT_FALSE(child->layer_property_changed()); \
+ EXPECT_FALSE(child->subtree_property_changed()); \
+ EXPECT_FALSE(child->layer_tree_host()->LayerNeedsPushPropertiesForTesting( \
+ child.get())); \
+ EXPECT_FALSE(grand_child->layer_property_changed()); \
+ EXPECT_FALSE(grand_child->subtree_property_changed()); \
+ EXPECT_FALSE( \
+ grand_child->layer_tree_host()->LayerNeedsPushPropertiesForTesting( \
+ grand_child.get()));
+
namespace cc {
// This class is a friend of Layer, and is used as a wrapper for all the tests
@@ -1110,6 +1127,12 @@ TEST_F(LayerTest, LayerPropertyChangedForSubtree) {
child2->PushPropertiesTo(child2_impl.get());
grand_child->PushPropertiesTo(grand_child_impl.get()));
+ EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(1);
+ EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(
+ root->SetBackgroundFilters(arbitrary_filters));
+ EXECUTE_AND_VERIFY_SUBTREE_CHANGES_RESET(
+ root->PushPropertiesTo(root_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);
« no previous file with comments | « cc/layers/layer_impl_unittest.cc ('k') | cc/layers/render_surface_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698