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

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

Issue 1895323002: Viewport apply scroll should be on the document element not scrollingElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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 fe584f144b44407b1dc08cddf14aab0ff8269082..7b6d43fb2f35b36e8d19f9a7839a20f0750382c0 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -8136,6 +8136,7 @@ protected:
event.windowX = windowX;
event.windowY = windowY;
event.canScroll = true;
+ event.hasPreciseScrollingDeltas = true;
webViewHelper->webViewImpl()->handleInputEvent(event);
}
@@ -8399,6 +8400,43 @@ TEST_P(WebFrameOverscrollTest, ReportingLatestOverscrollForElasticOverscroll)
Mock::VerifyAndClearExpectations(&client);
}
+TEST_P(WebFrameOverscrollTest, ScrollPageWithBodyExplicitlyOverflowing)
+{
+ RuntimeEnabledFeatures::setScrollTopLeftInteropEnabled(false);
+
+ OverscrollWebViewClient client;
+ registerMockedHttpURLLoad("mouse-wheel-overflow-body.html");
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ webViewHelper.initializeAndLoad(m_baseURL + "mouse-wheel-overflow-body.html", true, 0, &client, configureAndroid);
+ webViewHelper.resize(WebSize(800, 600));
+
+ FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ Document* document = toWebLocalFrameImpl(webViewHelper.webViewImpl()->mainFrame())->frame()->document();
+
+ {
+ EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0);
+ ScrollByWheel(&webViewHelper, 100, 100, 0, -450);
+
+ LayoutBox* layoutBody = toLayoutBox(document->body()->layoutObject());
+ ASSERT_EQ(400, layoutBody->getScrollableArea()->scrollPosition().y());
+ ASSERT_EQ(400, layoutBody->getScrollableArea()->maximumScrollPosition().y());
+
+ Mock::VerifyAndClearExpectations(&client);
+ }
+
+ view->setScrollPosition(DoublePoint(0, 0), ProgrammaticScroll);
+
+ {
+ EXPECT_CALL(client, didOverscroll(WebFloatSize(0, 200), WebFloatSize(0, 200), WebFloatPoint(), WebFloatSize()));
+ ScrollByWheel(&webViewHelper, 100, 100, 0, -300);
+
+ ASSERT_EQ(100, view->getScrollableArea()->scrollPosition().y());
+ ASSERT_EQ(100, view->getScrollableArea()->maximumScrollPosition().y());
+
+ Mock::VerifyAndClearExpectations(&client);
+ }
+}
+
TEST_F(WebFrameTest, OrientationFrameDetach)
{
RuntimeEnabledFeatures::setOrientationEventEnabled(true);

Powered by Google App Engine
This is Rietveld 408576698