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

Unified Diff: cc/layers/layer_impl_unittest.cc

Issue 2840433002: Move LayerImpl's bounds_delta to property trees (Closed)
Patch Set: Document ViewportBoundsDelta better Created 3 years, 8 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.cc ('k') | cc/layers/layer_position_constraint_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl_unittest.cc
diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc
index 2180d540d58a60dc5d986550608bb46fe7562ab6..f8f55537c48a92033f2e319478e6e70ae3c28a08 100644
--- a/cc/layers/layer_impl_unittest.cc
+++ b/cc/layers/layer_impl_unittest.cc
@@ -138,6 +138,11 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) {
root_clip_ptr->test_properties()->AddChild(std::move(root_ptr));
host_impl.active_tree()->SetRootLayerForTesting(std::move(root_clip_ptr));
+ // Make root the inner viewport scroll layer. This ensures the later call to
+ // |SetViewportBoundsDelta| will be on a viewport layer.
+ host_impl.active_tree()->SetViewportLayersFromIds(
+ Layer::INVALID_ID, Layer::INVALID_ID, root->id(), Layer::INVALID_ID);
+
root->test_properties()->force_render_surface = true;
root->SetMasksToBounds(true);
root->layer_tree_impl()->ResetAllChangeTracking();
@@ -192,11 +197,13 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) {
arbitrary_transform));
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->ScrollBy(arbitrary_vector2d);
root->SetNeedsPushProperties());
- // SetBoundsDelta changes subtree only when masks_to_bounds is true and it
- // doesn't set needs_push_properties as it is always called on active tree.
+ // SetViewportBoundsDelta changes subtree only when masks_to_bounds is true
+ // and it doesn't set needs_push_properties as it is always called on active
+ // tree.
root->SetMasksToBounds(true);
- EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetBoundsDelta(arbitrary_vector2d);
- root->SetNeedsPushProperties());
+ EXECUTE_AND_VERIFY_SUBTREE_CHANGED(
+ root->SetViewportBoundsDelta(arbitrary_vector2d);
+ root->SetNeedsPushProperties());
// Changing these properties only affects the layer itself.
EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetDrawsContent(true));
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/layer_position_constraint_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698