Chromium Code Reviews| Index: cc/trees/layer_tree_host_impl_unittest.cc |
| diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc |
| index a3895708e55b8fed40a0918a7b42007c9d5d58f9..e0ad08ca805312a3c9396753f1df2922a8098ab3 100644 |
| --- a/cc/trees/layer_tree_host_impl_unittest.cc |
| +++ b/cc/trees/layer_tree_host_impl_unittest.cc |
| @@ -371,11 +371,14 @@ class LayerTreeHostImplTest : public testing::Test, |
| content_layer->SetBounds(content_size); |
| host_impl_->OuterViewportScrollLayer()->SetBounds(content_size); |
| - LayerImpl* outer_clip = host_impl_->OuterViewportScrollLayer()->parent(); |
| + LayerImpl* outer_clip = |
| + host_impl_->OuterViewportScrollLayer()->test_properties()->parent; |
| outer_clip->SetBounds(viewport_size); |
| - LayerImpl* inner_clip_layer = |
| - host_impl_->InnerViewportScrollLayer()->parent()->parent(); |
| + LayerImpl* inner_clip_layer = host_impl_->InnerViewportScrollLayer() |
| + ->test_properties() |
| + ->parent->test_properties() |
| + ->parent; |
| inner_clip_layer->SetBounds(viewport_size); |
| host_impl_->InnerViewportScrollLayer()->SetBounds(viewport_size); |
| host_impl_->active_tree()->BuildLayerListAndPropertyTreesForTesting(); |
| @@ -1224,7 +1227,8 @@ TEST_F(LayerTreeHostImplTest, ScrollWithUserUnscrollableLayers) { |
| ASSERT_EQ(1u, scroll_layer->test_properties()->children.size()); |
| LayerImpl* overflow = scroll_layer->test_properties()->children[0]; |
| overflow->SetBounds(overflow_size); |
| - overflow->SetScrollClipLayer(scroll_layer->parent()->parent()->id()); |
| + overflow->SetScrollClipLayer( |
| + scroll_layer->test_properties()->parent->test_properties()->parent->id()); |
| overflow->layer_tree_impl() |
| ->property_trees() |
| ->scroll_tree.UpdateScrollOffsetBaseForTesting(overflow->id(), |
| @@ -1480,7 +1484,7 @@ TEST_F(LayerTreeHostImplTest, AnimationSchedulingOnLayerDestruction) { |
| did_request_next_frame_ = false; |
| // Destroy layer, unregister animation target (element). |
| - child->SetParent(nullptr); |
| + child->test_properties()->parent = nullptr; |
| root->RemoveChildForTesting(child); |
| child = nullptr; |
| @@ -2020,7 +2024,8 @@ TEST_F(LayerTreeHostImplTest, ScrollWithSwapPromises) { |
| EXPECT_EQ(latency_info.trace_id(), scroll_info->swap_promises[0]->TraceId()); |
| } |
| -// Test that scrolls targeting a layer with a non-null scroll_parent() don't |
| +// Test that scrolls targeting a layer with a non-null |
| +// scroll_test_properties()->parent don't |
|
ajuma
2016/06/10 22:32:58
This should still say 'scroll_parent'
jaydasika
2016/06/15 09:18:39
Done.
|
| // bubble up. |
| TEST_F(LayerTreeHostImplTest, ScrollDoesntBubble) { |
| LayerImpl* viewport_scroll = |
| @@ -4314,8 +4319,10 @@ TEST_F(LayerTreeHostImplTopControlsTest, PositionTopControlsExplicitly) { |
| host_impl_->DidChangeTopControlsPosition(); |
| // Now that top controls have moved, expect the clip to resize. |
| - LayerImpl* inner_clip_ptr = |
| - host_impl_->InnerViewportScrollLayer()->parent()->parent(); |
| + LayerImpl* inner_clip_ptr = host_impl_->InnerViewportScrollLayer() |
| + ->test_properties() |
| + ->parent->test_properties() |
| + ->parent; |
| EXPECT_EQ(viewport_size_, inner_clip_ptr->bounds()); |
| } |
| @@ -4342,14 +4349,19 @@ TEST_F(LayerTreeHostImplTopControlsTest, ApplyDeltaOnTreeActivation) { |
| top_controls_height_); |
| host_impl_->DidChangeTopControlsPosition(); |
| - LayerImpl* inner_clip_ptr = |
| - host_impl_->InnerViewportScrollLayer()->parent()->parent(); |
| + LayerImpl* inner_clip_ptr = host_impl_->InnerViewportScrollLayer() |
| + ->test_properties() |
| + ->parent->test_properties() |
| + ->parent; |
| EXPECT_EQ(viewport_size_, inner_clip_ptr->bounds()); |
| EXPECT_EQ(0.f, host_impl_->top_controls_manager()->ContentTopOffset()); |
| host_impl_->ActivateSyncTree(); |
| - inner_clip_ptr = host_impl_->InnerViewportScrollLayer()->parent()->parent(); |
| + inner_clip_ptr = host_impl_->InnerViewportScrollLayer() |
| + ->test_properties() |
| + ->parent->test_properties() |
| + ->parent; |
| EXPECT_EQ(0.f, host_impl_->top_controls_manager()->ContentTopOffset()); |
| EXPECT_EQ(viewport_size_, inner_clip_ptr->bounds()); |
| @@ -4382,8 +4394,10 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsLayoutHeightChanged) { |
| host_impl_->active_tree()->SetCurrentTopControlsShownRatio(0.f); |
| host_impl_->DidChangeTopControlsPosition(); |
| - LayerImpl* inner_clip_ptr = |
| - host_impl_->InnerViewportScrollLayer()->parent()->parent(); |
| + LayerImpl* inner_clip_ptr = host_impl_->InnerViewportScrollLayer() |
| + ->test_properties() |
| + ->parent->test_properties() |
| + ->parent; |
| EXPECT_EQ(viewport_size_, inner_clip_ptr->bounds()); |
| EXPECT_EQ(0.f, host_impl_->top_controls_manager()->ContentTopOffset()); |
| @@ -4393,8 +4407,10 @@ TEST_F(LayerTreeHostImplTopControlsTest, TopControlsLayoutHeightChanged) { |
| host_impl_->ActivateSyncTree(); |
| - inner_clip_ptr = |
| - host_impl_->InnerViewportScrollLayer()->parent()->parent(); |
| + inner_clip_ptr = host_impl_->InnerViewportScrollLayer() |
| + ->test_properties() |
| + ->parent->test_properties() |
| + ->parent; |
| EXPECT_EQ(0.f, host_impl_->top_controls_manager()->ContentTopOffset()); |
| // The total bounds should remain unchanged since the bounds delta should |
| @@ -4612,8 +4628,10 @@ TEST_F(LayerTreeHostImplTopControlsTest, |
| host_impl_->top_controls_manager()->ScrollEnd(); |
| EXPECT_EQ(0.f, host_impl_->top_controls_manager()->ContentTopOffset()); |
| // Now that top controls have moved, expect the clip to resize. |
| - LayerImpl* inner_clip_ptr = |
| - host_impl_->InnerViewportScrollLayer()->parent()->parent(); |
| + LayerImpl* inner_clip_ptr = host_impl_->InnerViewportScrollLayer() |
| + ->test_properties() |
| + ->parent->test_properties() |
| + ->parent; |
| EXPECT_EQ(viewport_size_, inner_clip_ptr->bounds()); |
| host_impl_->ScrollEnd(EndState().get()); |
| @@ -4882,8 +4900,10 @@ TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnMainThread) { |
| SetupScrollAndContentsLayers(viewport_size); |
| // Setup the layers so that the outer viewport is scrollable. |
| - host_impl_->active_tree()->InnerViewportScrollLayer()->parent()->SetBounds( |
| - viewport_size); |
| + host_impl_->active_tree() |
| + ->InnerViewportScrollLayer() |
| + ->test_properties() |
| + ->parent->SetBounds(viewport_size); |
| host_impl_->active_tree()->OuterViewportScrollLayer()->SetBounds( |
| gfx::Size(40, 40)); |
| host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 2.f); |
| @@ -4928,8 +4948,10 @@ TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnImplThread) { |
| SetupScrollAndContentsLayers(viewport_size); |
| // Setup the layers so that the outer viewport is scrollable. |
| - host_impl_->active_tree()->InnerViewportScrollLayer()->parent()->SetBounds( |
| - viewport_size); |
| + host_impl_->active_tree() |
| + ->InnerViewportScrollLayer() |
| + ->test_properties() |
| + ->parent->SetBounds(viewport_size); |
| host_impl_->active_tree()->OuterViewportScrollLayer()->SetBounds( |
| gfx::Size(40, 40)); |
| host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 2.f); |
| @@ -5579,7 +5601,7 @@ TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) { |
| int scale = 2; |
| gfx::Transform scale_transform; |
| scale_transform.Scale(scale, scale); |
| - scroll_layer->parent()->SetTransform(scale_transform); |
| + scroll_layer->test_properties()->parent->SetTransform(scale_transform); |
| gfx::Size surface_size(50, 50); |
| host_impl_->SetViewportSize(surface_size); |
| @@ -5704,7 +5726,8 @@ TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) { |
| TestInputHandlerClient scroll_watcher; |
| host_impl_->SetViewportSize(gfx::Size(10, 20)); |
| LayerImpl* scroll_layer = SetupScrollAndContentsLayers(gfx::Size(100, 100)); |
| - LayerImpl* clip_layer = scroll_layer->parent()->parent(); |
| + LayerImpl* clip_layer = |
| + scroll_layer->test_properties()->parent->test_properties()->parent; |
| SetNeedsRebuildPropertyTrees(); |
| clip_layer->SetBounds(gfx::Size(10, 20)); |
| RebuildPropertyTrees(); |
| @@ -5815,7 +5838,8 @@ TEST_F(LayerTreeHostImplTest, |
| ExternalRootLayerScrollOffsetDelegationReflectedInNextDraw) { |
| host_impl_->SetViewportSize(gfx::Size(10, 20)); |
| LayerImpl* scroll_layer = SetupScrollAndContentsLayers(gfx::Size(100, 100)); |
| - LayerImpl* clip_layer = scroll_layer->parent()->parent(); |
| + LayerImpl* clip_layer = |
| + scroll_layer->test_properties()->parent->test_properties()->parent; |
| clip_layer->SetBounds(gfx::Size(10, 20)); |
| scroll_layer->SetDrawsContent(true); |
| @@ -6087,7 +6111,8 @@ TEST_F(LayerTreeHostImplTest, OverscrollAlways) { |
| CreateHostImpl(settings, CreateOutputSurface()); |
| LayerImpl* scroll_layer = SetupScrollAndContentsLayers(gfx::Size(50, 50)); |
| - LayerImpl* clip_layer = scroll_layer->parent()->parent(); |
| + LayerImpl* clip_layer = |
| + scroll_layer->test_properties()->parent->test_properties()->parent; |
| clip_layer->SetBounds(gfx::Size(50, 50)); |
| SetNeedsRebuildPropertyTrees(); |
| RebuildPropertyTrees(); |