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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 136173004: Early terminate flings when scrolling impossible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | 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..977f3db2c0f4ad6176a3c800c577156354bd6b36 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -3012,19 +3012,16 @@ TEST_F(LayerTreeHostImplTest, OverscrollRoot) {
host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f);
DrawFrame();
EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
- EXPECT_EQ(gfx::Vector2dF(), host_impl_->current_fling_velocity());
// In-bounds scrolling does not affect overscroll.
EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
- EXPECT_EQ(gfx::Vector2dF(), host_impl_->current_fling_velocity());
// Overscroll events are reflected immediately.
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 50));
EXPECT_EQ(gfx::Vector2dF(0, 10), host_impl_->accumulated_root_overscroll());
- EXPECT_EQ(gfx::Vector2dF(), host_impl_->current_fling_velocity());
// In-bounds scrolling resets accumulated overscroll for the scrolled axes.
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, -50));
@@ -3052,15 +3049,6 @@ TEST_F(LayerTreeHostImplTest, OverscrollRoot) {
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, -20));
EXPECT_EQ(gfx::Vector2dF(0, -10), host_impl_->accumulated_root_overscroll());
host_impl_->ScrollEnd();
-
- EXPECT_EQ(InputHandler::ScrollStarted,
- host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
- // Fling velocity is reflected immediately.
- host_impl_->NotifyCurrentFlingVelocity(gfx::Vector2dF(10, 0));
- EXPECT_EQ(gfx::Vector2dF(10, 0), host_impl_->current_fling_velocity());
- host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, -20));
- EXPECT_EQ(gfx::Vector2dF(0, -20), host_impl_->accumulated_root_overscroll());
- EXPECT_EQ(gfx::Vector2dF(10, 0), host_impl_->current_fling_velocity());
}
@@ -3113,10 +3101,8 @@ TEST_F(LayerTreeHostImplTest, OverscrollChildWithoutBubbling) {
host_impl_->ScrollEnd();
// After scrolling the parent, another scroll on the opposite direction
- // should scroll the child, resetting the fling velocity.
+ // should scroll the child.
scroll_delta = gfx::Vector2d(0, 70);
- host_impl_->NotifyCurrentFlingVelocity(gfx::Vector2dF(10, 0));
- EXPECT_EQ(gfx::Vector2dF(10, 0), host_impl_->current_fling_velocity());
EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(5, 5),
InputHandler::NonBubblingGesture));
@@ -3124,7 +3110,6 @@ TEST_F(LayerTreeHostImplTest, OverscrollChildWithoutBubbling) {
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child_layer);
EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
- EXPECT_EQ(gfx::Vector2dF(), host_impl_->current_fling_velocity());
host_impl_->ScrollEnd();
}
}
@@ -3178,14 +3163,12 @@ TEST_F(LayerTreeHostImplTest, OverscrollAlways) {
host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f);
DrawFrame();
EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
- EXPECT_EQ(gfx::Vector2dF(), host_impl_->current_fling_velocity());
// Even though the layer can't scroll the overscroll still happens.
EXPECT_EQ(InputHandler::ScrollStarted,
host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
EXPECT_EQ(gfx::Vector2dF(0, 10), host_impl_->accumulated_root_overscroll());
- EXPECT_EQ(gfx::Vector2dF(), host_impl_->current_fling_velocity());
}
TEST_F(LayerTreeHostImplTest, UnnecessaryGlowEffectCallsWhileScrollingUp) {
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698