| 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 ba09ca08d699cd6a043bb12b3990c583cc0e23b0..88831093ed5dc42fb315382d9ceb055a3807a8f2 100644
|
| --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| @@ -10141,11 +10141,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&));
|
| };
|
|
|
| class WebFrameOverscrollTest
|
| @@ -10206,38 +10207,42 @@ TEST_P(WebFrameOverscrollTest,
|
| // scrollUpdate.
|
| ScrollBegin(&web_view_helper);
|
| 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);
|
| }
|
| @@ -10255,7 +10260,7 @@ TEST_P(WebFrameOverscrollTest,
|
| ScrollBegin(&web_view_helper);
|
|
|
| // 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);
|
|
|
| @@ -10264,7 +10269,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);
|
| @@ -10274,18 +10280,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);
|
| }
|
| @@ -10302,7 +10309,7 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerDivOverScroll) {
|
| ScrollBegin(&web_view_helper);
|
|
|
| // 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);
|
|
|
| @@ -10311,7 +10318,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);
|
| }
|
| @@ -10328,7 +10336,7 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerIFrameOverScroll) {
|
|
|
| ScrollBegin(&web_view_helper);
|
| // 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.
|
| @@ -10344,7 +10352,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);
|
|
|
| @@ -10366,29 +10375,33 @@ TEST_P(WebFrameOverscrollTest, ScaledPageRootLayerOverscrolled) {
|
| // we go back to viewport coordinates it becomes (99, 99).
|
| ScrollBegin(&web_view_helper);
|
| 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);
|
| }
|
| @@ -10405,49 +10418,52 @@ TEST_P(WebFrameOverscrollTest, NoOverscrollForSmallvalues) {
|
| ScrollBegin(&web_view_helper);
|
| 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);
|
| }
|
|
|