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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 238753004: Vertical GlowEffect shown on about:blank page in low end devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed Unittest Name Created 6 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 93bc83106b434ba36079a756f89cd15fb272d59d..71bf70d5b18da50740b3d328c033d075e8148023 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -97,6 +97,7 @@ class LayerTreeHostImplTest : public testing::Test,
settings.minimum_occlusion_tracking_size = gfx::Size();
settings.impl_side_painting = true;
settings.texture_id_allocation_chunk_size = 1;
+ settings.report_overscroll_only_for_scrollable_axes = true;
return settings;
}
@@ -3171,6 +3172,45 @@ TEST_F(LayerTreeHostImplTest, OverscrollAlways) {
EXPECT_EQ(gfx::Vector2dF(0, 10), host_impl_->accumulated_root_overscroll());
}
+TEST_F(LayerTreeHostImplTest, NoOverscrollOnFractionalDeviceScale) {
+ gfx::Size surface_size(980, 1439);
+ gfx::Size content_size(980, 1438);
+ float device_scale_factor = 1.5f;
+ scoped_ptr<LayerImpl> root_clip =
+ LayerImpl::Create(host_impl_->active_tree(), 3);
+ scoped_ptr<LayerImpl> root =
+ CreateScrollableLayer(1, content_size, root_clip.get());
+ root->SetIsContainerForFixedPositionLayers(true);
+ scoped_ptr<LayerImpl> child =
+ CreateScrollableLayer(2, content_size, root_clip.get());
+ root->scroll_clip_layer()->SetBounds(gfx::Size(320, 469));
+ host_impl_->active_tree()->SetPageScaleFactorAndLimits(
+ 0.326531f, 0.326531f, 5.f);
+ host_impl_->active_tree()->SetPageScaleDelta(1.f);
+ child->SetScrollClipLayer(Layer::INVALID_ID);
+ root->AddChild(child.Pass());
+ root_clip->AddChild(root.Pass());
+
+ host_impl_->SetViewportSize(surface_size);
+ host_impl_->SetDeviceScaleFactor(device_scale_factor);
+ host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
+ host_impl_->active_tree()->SetViewportLayersFromIds(3, 1, Layer::INVALID_ID);
+ host_impl_->active_tree()->DidBecomeActive();
+ DrawFrame();
+ {
+ // Horizontal & Vertical GlowEffect should not be applied when
+ // content size is less then view port size. For Example Horizontal &
+ // vertical GlowEffect should not be applied in about:blank page.
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Wheel));
+ host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, -1));
+ EXPECT_EQ(gfx::Vector2dF().ToString(),
+ host_impl_->accumulated_root_overscroll().ToString());
+
+ host_impl_->ScrollEnd();
+ }
+}
+
TEST_F(LayerTreeHostImplTest, NoOverscrollWhenNotAtEdge) {
gfx::Size surface_size(100, 100);
gfx::Size content_size(200, 200);
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698