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 f3790fe4c0ed30510108ddb8e27b9e9f4fc5fa69..d46ef2992faa206991e0f00110cf2dee9700175c 100644 |
--- a/cc/trees/layer_tree_host_impl_unittest.cc |
+++ b/cc/trees/layer_tree_host_impl_unittest.cc |
@@ -4425,6 +4425,25 @@ TEST_F(LayerTreeHostImplBrowserControlsTest, |
host_impl_->ScrollEnd(EndState().get()); |
} |
+namespace { |
+ |
+gfx::Vector2dF FixedContainerSizeDelta(LayerImpl* scroll_layer) { |
+ auto* layer_tree_impl = scroll_layer->layer_tree_impl(); |
+ auto* property_trees = layer_tree_impl->property_trees(); |
+ if (auto* inner = layer_tree_impl->InnerViewportContainerLayer()) { |
+ if (inner->element_id() == scroll_layer->scroll_clip_layer()->element_id()) |
+ return property_trees->inner_viewport_container_bounds_delta(); |
+ } |
+ if (auto* outer = layer_tree_impl->OuterViewportContainerLayer()) { |
+ if (outer->element_id() == scroll_layer->scroll_clip_layer()->element_id()) |
+ return property_trees->outer_viewport_container_bounds_delta(); |
+ } |
+ |
+ return gfx::Vector2dF(); |
+} |
+ |
+}; // namespace |
enne (OOO)
2017/04/25 00:52:20
s/;//
pdr.
2017/04/26 21:29:01
Done, kinda. And more!
|
+ |
TEST_F(LayerTreeHostImplBrowserControlsTest, |
ScrollBrowserControlsByFractionalAmount) { |
SetupBrowserControlsAndScrollLayerWithVirtualViewport( |
@@ -4450,7 +4469,7 @@ TEST_F(LayerTreeHostImplBrowserControlsTest, |
DCHECK(inner_viewport_scroll_layer); |
host_impl_->ScrollEnd(EndState().get()); |
EXPECT_FLOAT_EQ(top_controls_scroll_delta.y(), |
- inner_viewport_scroll_layer->FixedContainerSizeDelta().y()); |
+ FixedContainerSizeDelta(inner_viewport_scroll_layer).y()); |
enne (OOO)
2017/04/25 00:52:20
Can you remove the helper and just say property_tr
pdr.
2017/04/26 21:29:01
This is a real good idea. I was focused on the goa
|
} |
// In this test, the outer viewport is initially unscrollable. We test that a |
@@ -4572,7 +4591,7 @@ TEST_F(LayerTreeHostImplBrowserControlsTest, FixedContainerDelta) { |
EXPECT_FLOAT_EQ(top_controls_height_ - top_controls_scroll_delta.y(), |
host_impl_->browser_controls_manager()->ContentTopOffset()); |
EXPECT_FLOAT_EQ(top_controls_scroll_delta.y(), |
- outer_viewport_scroll_layer->FixedContainerSizeDelta().y()); |
+ FixedContainerSizeDelta(outer_viewport_scroll_layer).y()); |
host_impl_->ScrollEnd(EndState().get()); |
// Scroll past the maximum extent. The delta shouldn't be greater than the |
@@ -4583,7 +4602,7 @@ TEST_F(LayerTreeHostImplBrowserControlsTest, FixedContainerDelta) { |
host_impl_->browser_controls_manager()->ScrollBy(top_controls_scroll_delta); |
EXPECT_EQ(0.f, host_impl_->browser_controls_manager()->ContentTopOffset()); |
EXPECT_VECTOR_EQ(gfx::Vector2dF(0, top_controls_height_), |
- outer_viewport_scroll_layer->FixedContainerSizeDelta()); |
+ FixedContainerSizeDelta(outer_viewport_scroll_layer)); |
host_impl_->ScrollEnd(EndState().get()); |
// Scroll in the direction to make the browser controls show. |
@@ -4593,7 +4612,7 @@ TEST_F(LayerTreeHostImplBrowserControlsTest, FixedContainerDelta) { |
host_impl_->browser_controls_manager()->ContentTopOffset()); |
EXPECT_VECTOR_EQ( |
gfx::Vector2dF(0, top_controls_height_ - top_controls_scroll_delta.y()), |
- outer_viewport_scroll_layer->FixedContainerSizeDelta()); |
+ FixedContainerSizeDelta(outer_viewport_scroll_layer)); |
host_impl_->browser_controls_manager()->ScrollEnd(); |
} |