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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 476113004: Replace overdraw_bottom_height with top_controls_layout_height. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 4 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/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 1322f835e08d0e75f29d17c3aba64ed729847e98..66cf5cc9a0bef95794c62fdbcb3530b878b0267c 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -991,61 +991,6 @@ TEST_F(LayerTreeHostImplTest, ScrollWithSwapPromises) {
EXPECT_EQ(latency_info.trace_id, scroll_info->swap_promises[0]->TraceId());
}
-TEST_F(LayerTreeHostImplTest, MasksToBoundsDoesntClobberInnerContainerSize) {
- SetupScrollAndContentsLayers(gfx::Size(100, 100));
- host_impl_->SetViewportSize(gfx::Size(50, 50));
- DrawFrame();
-
- LayerImpl* scroll_layer = host_impl_->InnerViewportScrollLayer();
- LayerImpl* container_layer = scroll_layer->scroll_clip_layer();
- DCHECK(scroll_layer);
-
- float min_page_scale = 1.f;
- float max_page_scale = 4.f;
- host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f,
- min_page_scale,
- max_page_scale);
-
- // If the container's masks_to_bounds is false, the viewport size should
- // overwrite the inner viewport container layer's size.
- {
- EXPECT_EQ(gfx::Size(50, 50),
- container_layer->bounds());
- container_layer->SetMasksToBounds(false);
-
- container_layer->SetBounds(gfx::Size(30, 25));
- EXPECT_EQ(gfx::Size(30, 25),
- container_layer->bounds());
-
- // This should cause a reset of the inner viewport container layer's bounds.
- host_impl_->DidChangeTopControlsPosition();
-
- EXPECT_EQ(gfx::Size(50, 50),
- container_layer->bounds());
- }
-
- host_impl_->SetViewportSize(gfx::Size(50, 50));
- container_layer->SetBounds(gfx::Size(50, 50));
-
- // If the container's masks_to_bounds is true, the viewport size should
- // *NOT* overwrite the inner viewport container layer's size.
- {
- EXPECT_EQ(gfx::Size(50, 50),
- container_layer->bounds());
- container_layer->SetMasksToBounds(true);
-
- container_layer->SetBounds(gfx::Size(30, 25));
- EXPECT_EQ(gfx::Size(30, 25),
- container_layer->bounds());
-
- // This should cause a reset of the inner viewport container layer's bounds.
- host_impl_->DidChangeTopControlsPosition();
-
- EXPECT_EQ(gfx::Size(30, 25),
- container_layer->bounds());
- }
-}
-
TEST_F(LayerTreeHostImplTest, PinchGesture) {
SetupScrollAndContentsLayers(gfx::Size(100, 100));
host_impl_->SetViewportSize(gfx::Size(50, 50));
@@ -2180,6 +2125,7 @@ class LayerTreeHostImplTopControlsTest : public LayerTreeHostImplTest {
// Set a viewport size that is large enough to contain both the top controls
// and some content.
host_impl_->SetViewportSize(viewport_size_);
+ host_impl_->SetTopControlsLayoutHeight(settings_.top_controls_height);
LayerImpl* root_clip_ptr = host_impl_->active_tree()->root_layer();
EXPECT_EQ(clip_size_, root_clip_ptr->bounds());
}
@@ -6862,8 +6808,7 @@ TEST_F(LayerTreeHostImplTest, ExternalTransformReflectedInNextDraw) {
}
TEST_F(LayerTreeHostImplTest, ScrollAnimated) {
- SetupScrollAndContentsLayers(gfx::Size(100, 150));
- host_impl_->SetViewportSize(gfx::Size(50, 50));
+ SetupScrollAndContentsLayers(gfx::Size(100, 200));
DrawFrame();
base::TimeTicks start_time =

Powered by Google App Engine
This is Rietveld 408576698