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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 218883005: Fix another inappropriate overscroll glow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed complier error Created 6 years, 9 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/trees/layer_tree_host_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 c20d08f3bd762447a57b10748a1ebbdd138e49be..f1c10ca4cd55b2bf25683d5846ed650c76c39e05 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -3188,10 +3188,7 @@ TEST_F(LayerTreeHostImplTest, OverscrollAlways) {
EXPECT_EQ(gfx::Vector2dF(), host_impl_->current_fling_velocity());
}
-TEST_F(LayerTreeHostImplTest, UnnecessaryGlowEffectCallsWhileScrollingUp) {
- // Edge glow effect should be applicable only upon reaching Edges
- // of the content. unnecessary glow effect calls shouldn't be
- // called while scrolling up without reaching the edge of the content.
+TEST_F(LayerTreeHostImplTest, NoOverscrollWhenNotAtEdge) {
gfx::Size surface_size(100, 100);
gfx::Size content_size(200, 200);
scoped_ptr<LayerImpl> root_clip =
@@ -3212,6 +3209,9 @@ TEST_F(LayerTreeHostImplTest, UnnecessaryGlowEffectCallsWhileScrollingUp) {
host_impl_->active_tree()->DidBecomeActive();
DrawFrame();
{
+ // Edge glow effect should be applicable only upon reaching Edges
+ // of the content. unnecessary glow effect calls shouldn't be
+ // called while scrolling up without reaching the edge of the content.
EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, 100));
@@ -3221,6 +3221,20 @@ TEST_F(LayerTreeHostImplTest, UnnecessaryGlowEffectCallsWhileScrollingUp) {
EXPECT_EQ(gfx::Vector2dF().ToString(),
host_impl_->accumulated_root_overscroll().ToString());
host_impl_->ScrollEnd();
+ // unusedrootDelta should be subtracted from applied delta so that
+ // unwanted glow effect calls are not called.
+ EXPECT_EQ(InputHandler::ScrollStarted,
+ host_impl_->ScrollBegin(gfx::Point(0, 0),
+ InputHandler::NonBubblingGesture));
+ EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin());
+ host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, 20));
+ EXPECT_EQ(gfx::Vector2dF(0.000000f, 17.699997f).ToString(),
+ host_impl_->accumulated_root_overscroll().ToString());
+
+ host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0.02f, -0.01f));
+ EXPECT_EQ(gfx::Vector2dF(0.000000f, 17.699997f).ToString(),
+ host_impl_->accumulated_root_overscroll().ToString());
+ host_impl_->ScrollEnd();
}
}
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698