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

Unified Diff: ui/android/overscroll_refresh_unittest.cc

Issue 2884423003: Use scroll-boundary-behavior to control overscroll-refresh/glow on android. (Closed)
Patch Set: Rebase Created 3 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
« no previous file with comments | « ui/android/overscroll_refresh.cc ('k') | ui/events/blink/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/overscroll_refresh_unittest.cc
diff --git a/ui/android/overscroll_refresh_unittest.cc b/ui/android/overscroll_refresh_unittest.cc
index c133d759a8e3a8f272bd575e7ef1fc9dec999439..f31b85f45049e68fffd7253c79f307aca6e9c382 100644
--- a/ui/android/overscroll_refresh_unittest.cc
+++ b/ui/android/overscroll_refresh_unittest.cc
@@ -86,7 +86,7 @@ TEST_F(OverscrollRefreshTest, Basic) {
EXPECT_TRUE(effect.IsAwaitingScrollUpdateAck());
// The unconsumed, overscrolling scroll will trigger the effect.
- effect.OnScrollUpdateAck(false);
+ effect.OnOverscrolled();
EXPECT_TRUE(effect.IsActive());
EXPECT_FALSE(effect.IsAwaitingScrollUpdateAck());
EXPECT_TRUE(GetAndResetPullStarted());
@@ -124,7 +124,7 @@ TEST_F(OverscrollRefreshTest, NotTriggeredIfInitialYOffsetIsNotZero) {
ASSERT_FALSE(effect.WillHandleScrollUpdate(gfx::Vector2dF(0, 10)));
EXPECT_FALSE(effect.IsActive());
EXPECT_FALSE(effect.IsAwaitingScrollUpdateAck());
- effect.OnScrollUpdateAck(false);
+ effect.OnOverscrolled();
EXPECT_FALSE(effect.IsActive());
EXPECT_FALSE(effect.IsAwaitingScrollUpdateAck());
EXPECT_FALSE(effect.WillHandleScrollUpdate(gfx::Vector2dF(0, 500)));
@@ -145,7 +145,7 @@ TEST_F(OverscrollRefreshTest, NotTriggeredIfOverflowYHidden) {
ASSERT_FALSE(effect.WillHandleScrollUpdate(gfx::Vector2dF(0, 10)));
EXPECT_FALSE(effect.IsActive());
EXPECT_FALSE(effect.IsAwaitingScrollUpdateAck());
- effect.OnScrollUpdateAck(false);
+ effect.OnOverscrolled();
EXPECT_FALSE(effect.IsActive());
EXPECT_FALSE(effect.IsAwaitingScrollUpdateAck());
EXPECT_FALSE(effect.WillHandleScrollUpdate(gfx::Vector2dF(0, 500)));
@@ -164,7 +164,7 @@ TEST_F(OverscrollRefreshTest, NotTriggeredIfInitialScrollDownward) {
EXPECT_FALSE(effect.IsActive());
EXPECT_FALSE(effect.IsAwaitingScrollUpdateAck());
- effect.OnScrollUpdateAck(false);
+ effect.OnOverscrolled();
EXPECT_FALSE(effect.IsActive());
EXPECT_FALSE(effect.IsAwaitingScrollUpdateAck());
EXPECT_FALSE(effect.WillHandleScrollUpdate(gfx::Vector2dF(0, 500)));
@@ -180,11 +180,12 @@ TEST_F(OverscrollRefreshTest, NotTriggeredIfInitialScrollOrTouchConsumed) {
// Consumption of the initial touchmove or scroll should prevent future
// activation.
- effect.OnScrollUpdateAck(true);
+ effect.Reset();
+ effect.OnOverscrolled();
EXPECT_FALSE(effect.IsActive());
EXPECT_FALSE(effect.IsAwaitingScrollUpdateAck());
EXPECT_FALSE(effect.WillHandleScrollUpdate(gfx::Vector2dF(0, 500)));
- effect.OnScrollUpdateAck(false);
+ effect.OnOverscrolled();
EXPECT_FALSE(effect.IsActive());
EXPECT_FALSE(effect.IsAwaitingScrollUpdateAck());
EXPECT_FALSE(effect.WillHandleScrollUpdate(gfx::Vector2dF(0, 500)));
@@ -198,7 +199,7 @@ TEST_F(OverscrollRefreshTest, NotTriggeredIfFlungDownward) {
effect.OnScrollBegin();
ASSERT_FALSE(effect.WillHandleScrollUpdate(gfx::Vector2dF(0, 10)));
ASSERT_TRUE(effect.IsAwaitingScrollUpdateAck());
- effect.OnScrollUpdateAck(false);
+ effect.OnOverscrolled();
ASSERT_TRUE(effect.IsActive());
EXPECT_TRUE(GetAndResetPullStarted());
@@ -213,7 +214,7 @@ TEST_F(OverscrollRefreshTest, NotTriggeredIfReleasedWithoutActivation) {
effect.OnScrollBegin();
ASSERT_FALSE(effect.WillHandleScrollUpdate(gfx::Vector2dF(0, 10)));
ASSERT_TRUE(effect.IsAwaitingScrollUpdateAck());
- effect.OnScrollUpdateAck(false);
+ effect.OnOverscrolled();
ASSERT_TRUE(effect.IsActive());
EXPECT_TRUE(GetAndResetPullStarted());
@@ -229,7 +230,7 @@ TEST_F(OverscrollRefreshTest, NotTriggeredIfReset) {
effect.OnScrollBegin();
ASSERT_FALSE(effect.WillHandleScrollUpdate(gfx::Vector2dF(0, 10)));
ASSERT_TRUE(effect.IsAwaitingScrollUpdateAck());
- effect.OnScrollUpdateAck(false);
+ effect.OnOverscrolled();
ASSERT_TRUE(effect.IsActive());
EXPECT_TRUE(GetAndResetPullStarted());
« no previous file with comments | « ui/android/overscroll_refresh.cc ('k') | ui/events/blink/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698