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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2884423003: Use scroll-boundary-behavior to control overscroll-refresh/glow on android. (Closed)
Patch Set: rebase Created 3 years, 5 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: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index e8f90ed0bb27b91267d70d1f64c68752451bdd78..211c8e9cc6299e33f3e49fe281c485558f65beef 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -9876,11 +9876,12 @@ TEST_P(ParameterizedWebFrameTest, SuspendedPageLoadWithRemoteMainFrame) {
class OverscrollWebViewClient : public FrameTestHelpers::TestWebViewClient {
public:
- MOCK_METHOD4(DidOverscroll,
+ MOCK_METHOD5(DidOverscroll,
void(const WebFloatSize&,
const WebFloatSize&,
const WebFloatPoint&,
- const WebFloatSize&));
+ const WebFloatSize&,
+ const WebScrollBoundaryBehavior&));
};
typedef std::pair<bool, blink::WebGestureDevice> WebFrameOverscrollTestParam;
@@ -9957,38 +9958,42 @@ TEST_P(WebFrameOverscrollTest,
// scrollUpdate.
ScrollBegin(&web_view_helper, -300, -316);
EXPECT_CALL(client, DidOverscroll(WebFloatSize(8, 16), WebFloatSize(8, 16),
- WebFloatPoint(100, 100), WebFloatSize()));
+ WebFloatPoint(100, 100), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, -308, -316);
Mock::VerifyAndClearExpectations(&client);
EXPECT_CALL(client, DidOverscroll(WebFloatSize(0, 13), WebFloatSize(8, 29),
- WebFloatPoint(100, 100), WebFloatSize()));
+ WebFloatPoint(100, 100), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, 0, -13);
Mock::VerifyAndClearExpectations(&client);
EXPECT_CALL(client, DidOverscroll(WebFloatSize(20, 13), WebFloatSize(28, 42),
- WebFloatPoint(100, 100), WebFloatSize()));
+ WebFloatPoint(100, 100), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, -20, -13);
Mock::VerifyAndClearExpectations(&client);
// Overscroll is not reported.
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollUpdate(&web_view_helper, 0, 1);
Mock::VerifyAndClearExpectations(&client);
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollUpdate(&web_view_helper, 1, 0);
Mock::VerifyAndClearExpectations(&client);
// Overscroll is reported.
EXPECT_CALL(client,
DidOverscroll(WebFloatSize(0, -701), WebFloatSize(0, -701),
- WebFloatPoint(100, 100), WebFloatSize()));
+ WebFloatPoint(100, 100), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, 0, 1000);
Mock::VerifyAndClearExpectations(&client);
// Overscroll is not reported.
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollEnd(&web_view_helper);
Mock::VerifyAndClearExpectations(&client);
}
@@ -10006,7 +10011,7 @@ TEST_P(WebFrameOverscrollTest,
ScrollBegin(&web_view_helper, 0, -316);
// Scroll the Div to the end.
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollUpdate(&web_view_helper, 0, -316);
Mock::VerifyAndClearExpectations(&client);
@@ -10015,7 +10020,8 @@ TEST_P(WebFrameOverscrollTest,
// Now On Scrolling DIV, scroll is bubbled and root layer is over-scrolled.
EXPECT_CALL(client, DidOverscroll(WebFloatSize(0, 100), WebFloatSize(0, 100),
- WebFloatPoint(100, 100), WebFloatSize()));
+ WebFloatPoint(100, 100), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, 0, -100);
ScrollUpdate(&web_view_helper, 0, -100);
Mock::VerifyAndClearExpectations(&client);
@@ -10025,18 +10031,19 @@ TEST_P(WebFrameOverscrollTest,
// the bug, crbug.com/589320.
// Page scrolls vertically, but over-scrolls horizontally.
// EXPECT_CALL(client, didOverscroll(WebFloatSize(-100, 0), WebFloatSize(-100,
- // 0), WebFloatPoint(100, 100), WebFloatSize()));
+ // 0), WebFloatPoint(100, 100), WebFloatSize(), WebScrollBoundaryBehavior()));
// ScrollUpdate(&webViewHelper, 100, 50);
// Mock::VerifyAndClearExpectations(&client);
// Scrolling up, Overscroll is not reported.
- // EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0);
+ // EXPECT_CALL(client, didOverscroll(_, _, _, _, _)).Times(0);
// ScrollUpdate(&webViewHelper, 0, -50);
// Mock::VerifyAndClearExpectations(&client);
// Page scrolls horizontally, but over-scrolls vertically.
// EXPECT_CALL(client, didOverscroll(WebFloatSize(0, 100), WebFloatSize(0,
- // 100), WebFloatPoint(100, 100), WebFloatSize()));
+ // 100), WebFloatPoint(100, 100), WebFloatSize(),
+ // WebScrollBoundaryBehavior()));
// ScrollUpdate(&webViewHelper, -100, -100);
// Mock::VerifyAndClearExpectations(&client);
}
@@ -10053,7 +10060,7 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerDivOverScroll) {
ScrollBegin(&web_view_helper, 0, -316);
// Scroll the Div to the end.
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollUpdate(&web_view_helper, 0, -316);
Mock::VerifyAndClearExpectations(&client);
@@ -10062,7 +10069,8 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerDivOverScroll) {
// Now On Scrolling DIV, scroll is bubbled and root layer is over-scrolled.
EXPECT_CALL(client, DidOverscroll(WebFloatSize(0, 50), WebFloatSize(0, 50),
- WebFloatPoint(100, 100), WebFloatSize()));
+ WebFloatPoint(100, 100), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, 0, -150);
Mock::VerifyAndClearExpectations(&client);
}
@@ -10079,7 +10087,7 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerIFrameOverScroll) {
ScrollBegin(&web_view_helper, 0, -320);
// Scroll the IFrame to the end.
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
// This scroll will fully scroll the iframe but will be consumed before being
// counted as overscroll.
@@ -10095,7 +10103,8 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerIFrameOverScroll) {
// Now On Scrolling IFrame, scroll is bubbled and root layer is over-scrolled.
EXPECT_CALL(client, DidOverscroll(WebFloatSize(0, 50), WebFloatSize(0, 50),
- WebFloatPoint(100, 100), WebFloatSize()));
+ WebFloatPoint(100, 100), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, 0, -150);
Mock::VerifyAndClearExpectations(&client);
@@ -10117,29 +10126,33 @@ TEST_P(WebFrameOverscrollTest, ScaledPageRootLayerOverscrolled) {
// we go back to viewport coordinates it becomes (99, 99).
ScrollBegin(&web_view_helper, 0, 30);
EXPECT_CALL(client, DidOverscroll(WebFloatSize(0, -30), WebFloatSize(0, -30),
- WebFloatPoint(99, 99), WebFloatSize()));
+ WebFloatPoint(99, 99), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, 0, 30);
Mock::VerifyAndClearExpectations(&client);
EXPECT_CALL(client, DidOverscroll(WebFloatSize(0, -30), WebFloatSize(0, -60),
- WebFloatPoint(99, 99), WebFloatSize()));
+ WebFloatPoint(99, 99), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, 0, 30);
Mock::VerifyAndClearExpectations(&client);
EXPECT_CALL(client,
DidOverscroll(WebFloatSize(-30, -30), WebFloatSize(-30, -90),
- WebFloatPoint(99, 99), WebFloatSize()));
+ WebFloatPoint(99, 99), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, 30, 30);
Mock::VerifyAndClearExpectations(&client);
EXPECT_CALL(client,
DidOverscroll(WebFloatSize(-30, 0), WebFloatSize(-60, -90),
- WebFloatPoint(99, 99), WebFloatSize()));
+ WebFloatPoint(99, 99), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, 30, 0);
Mock::VerifyAndClearExpectations(&client);
// Overscroll is not reported.
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollEnd(&web_view_helper);
Mock::VerifyAndClearExpectations(&client);
}
@@ -10156,49 +10169,52 @@ TEST_P(WebFrameOverscrollTest, NoOverscrollForSmallvalues) {
ScrollBegin(&web_view_helper, 10, 10);
EXPECT_CALL(client,
DidOverscroll(WebFloatSize(-10, -10), WebFloatSize(-10, -10),
- WebFloatPoint(100, 100), WebFloatSize()));
+ WebFloatPoint(100, 100), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, 10, 10);
Mock::VerifyAndClearExpectations(&client);
EXPECT_CALL(client,
DidOverscroll(WebFloatSize(0, -0.10), WebFloatSize(-10, -10.10),
- WebFloatPoint(100, 100), WebFloatSize()));
+ WebFloatPoint(100, 100), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, 0, 0.10);
Mock::VerifyAndClearExpectations(&client);
EXPECT_CALL(client, DidOverscroll(WebFloatSize(-0.10, 0),
WebFloatSize(-10.10, -10.10),
- WebFloatPoint(100, 100), WebFloatSize()));
+ WebFloatPoint(100, 100), WebFloatSize(),
+ WebScrollBoundaryBehavior()));
ScrollUpdate(&web_view_helper, 0.10, 0);
Mock::VerifyAndClearExpectations(&client);
// For residual values overscrollDelta should be reset and didOverscroll
// shouldn't be called.
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollUpdate(&web_view_helper, 0, 0.09);
Mock::VerifyAndClearExpectations(&client);
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollUpdate(&web_view_helper, 0.09, 0.09);
Mock::VerifyAndClearExpectations(&client);
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollUpdate(&web_view_helper, 0.09, 0);
Mock::VerifyAndClearExpectations(&client);
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollUpdate(&web_view_helper, 0, -0.09);
Mock::VerifyAndClearExpectations(&client);
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollUpdate(&web_view_helper, -0.09, -0.09);
Mock::VerifyAndClearExpectations(&client);
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollUpdate(&web_view_helper, -0.09, 0);
Mock::VerifyAndClearExpectations(&client);
- EXPECT_CALL(client, DidOverscroll(_, _, _, _)).Times(0);
+ EXPECT_CALL(client, DidOverscroll(_, _, _, _, _)).Times(0);
ScrollEnd(&web_view_helper);
Mock::VerifyAndClearExpectations(&client);
}

Powered by Google App Engine
This is Rietveld 408576698