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

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

Issue 1214673006: Reset unusedDelta on Onverscroll for residual values. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« Source/core/input/EventHandler.cpp ('K') | « Source/core/input/EventHandler.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« Source/core/input/EventHandler.cpp ('K') | « Source/core/input/EventHandler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698