Chromium Code Reviews| Index: Source/web/tests/WebFrameTest.cpp |
| diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp |
| index 5b8801e5dc68ac00aadbd56d6300c716224067e5..f4a0ccc510abb971faa43647af83e12d3bb4a8ee 100644 |
| --- a/Source/web/tests/WebFrameTest.cpp |
| +++ b/Source/web/tests/WebFrameTest.cpp |
| @@ -7688,7 +7688,7 @@ public: |
| class WebFrameOverscrollTest : public WebFrameTest { |
| protected: |
| - WebGestureEvent generateEvent(WebInputEvent::Type type, int deltaX = 0, int deltaY = 0) |
| + WebGestureEvent generateEvent(WebInputEvent::Type type, float deltaX = 0, float deltaY = 0) |
| { |
| WebGestureEvent event; |
| event.type = type; |
| @@ -7923,6 +7923,37 @@ TEST_F(WebFrameOverscrollTest, ScaledPageRootLayerOverscrolled) |
| Mock::VerifyAndClearExpectations(&client); |
| } |
| +TEST_F(WebFrameOverscrollTest, NoOverscrollForResidualvalues) |
|
majidvp
2015/07/09 15:02:46
s/Residualvalues/SmallValues/
MuVen
2015/07/09 17:51:35
Done.
|
| +{ |
| + OverscrollWebViewClient client; |
| + registerMockedHttpURLLoad("overscroll/overscroll.html"); |
| + FrameTestHelpers::WebViewHelper webViewHelper; |
| + webViewHelper.initializeAndLoad(m_baseURL + "overscroll/overscroll.html", true, 0, &client, configureAndroid); |
| + |
| + ScrollBegin(&webViewHelper); |
| + EXPECT_CALL(client, didOverscroll(WebFloatSize(0, -10.001), WebFloatSize(0, -10.001), WebFloatPoint(100, 100), WebFloatSize())); |
| + ScrollUpdate(&webViewHelper, 0, 10.001); |
| + Mock::VerifyAndClearExpectations(&client); |
| + |
| + // ForResidual values overscrollDelta should be nullified and didOverscroll shouldn't be called. |
|
majidvp
2015/07/09 15:02:46
s/ForResidual/For residual/
s/nullified/reset/
MuVen
2015/07/09 17:51:35
Done.
|
| + EXPECT_CALL(client, didOverscroll(WebFloatSize(), WebFloatSize(), WebFloatPoint(100, 100), WebFloatSize())).Times(0); |
|
majidvp
2015/07/09 15:02:46
I think these call expectations are busted. Essent
MuVen
2015/07/09 17:51:35
Done.
|
| + ScrollUpdate(&webViewHelper, 0, 0.001); |
| + Mock::VerifyAndClearExpectations(&client); |
| + |
| + EXPECT_CALL(client, didOverscroll(WebFloatSize(), WebFloatSize(), WebFloatPoint(100, 100), WebFloatSize())).Times(0); |
| + ScrollUpdate(&webViewHelper, 0.001, 0.001); |
| + Mock::VerifyAndClearExpectations(&client); |
| + |
| + EXPECT_CALL(client, didOverscroll(WebFloatSize(), WebFloatSize(), WebFloatPoint(100, 100), WebFloatSize())).Times(0); |
| + ScrollUpdate(&webViewHelper, 0.001, 0); |
|
majidvp
2015/07/09 15:02:46
Please use the threshold value (0.1) and a negativ
MuVen
2015/07/09 17:51:35
used threshold value(0.9) as
if (std::abs(unusedD
|
| + Mock::VerifyAndClearExpectations(&client); |
| + |
| + // Overscroll is not reported. |
| + EXPECT_CALL(client, didOverscroll(WebFloatSize(), WebFloatSize(), WebFloatPoint(33, 33), WebFloatSize())).Times(0); |
| + ScrollEnd(&webViewHelper); |
| + Mock::VerifyAndClearExpectations(&client); |
| +} |
| + |
| TEST_F(WebFrameOverscrollTest, ReportingLatestOverscrollForElasticOverscroll) |
| { |
| OverscrollWebViewClient client; |