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

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

Issue 1163433003: Remove WebViewImpl helper methods for setting scroll offset. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index 592b348d5827a214bbc3bb0be0ed1a7d82ad6f85..32b27557c229bad4ad8868b091af60bffe348e2f 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -2160,7 +2160,7 @@ protected:
{
webViewHelper.webViewImpl()->resize(WebSize(viewportSize.width, viewportSize.height));
webViewHelper.webViewImpl()->setPageScaleFactor(initialPageScaleFactor);
- webViewHelper.webViewImpl()->setMainFrameScrollOffset(WebPoint(scrollOffset.width, scrollOffset.height));
+ webViewHelper.webViewImpl()->mainFrame()->setScrollOffset(scrollOffset);
webViewHelper.webViewImpl()->layout();
const WebSize expectedScrollOffset = webViewHelper.webViewImpl()->mainFrame()->scrollOffset();
webViewHelper.webViewImpl()->resize(WebSize(viewportSize.width, viewportSize.height * 0.8f));
@@ -2320,7 +2320,7 @@ TEST_F(WebFrameTest, updateOverlayScrollbarLayers)
void setScaleAndScrollAndLayout(WebViewImpl* webView, WebPoint scroll, float scale)
{
webView->setPageScaleFactor(scale);
- webView->setMainFrameScrollOffset(WebPoint(scroll.x, scroll.y));
+ webView->mainFrame()->setScrollOffset(WebSize(scroll.x, scroll.y));
webView->layout();
}
@@ -4684,7 +4684,7 @@ TEST_F(WebFrameTest, DisambiguationPopupPinchViewport)
webViewHelper.webView()->resize(WebSize(100, 200));
// Scroll main frame to the bottom of the document
- webViewImpl->setMainFrameScrollOffset(WebPoint(0, 400));
+ webViewImpl->mainFrame()->setScrollOffset(WebSize(0, 400));
EXPECT_POINT_EQ(IntPoint(0, 400), frame->view()->scrollPosition());
webViewImpl->setPageScaleFactor(2.0);
@@ -6117,7 +6117,7 @@ TEST_F(WebFrameTest, FrameViewScrollAccountsForTopControls)
webView->setPageScaleFactor(2.0f);
webView->layout();
- webView->setMainFrameScrollOffset(WebPoint(0, 2000));
+ webView->mainFrame()->setScrollOffset(WebSize(0, 2000));
EXPECT_POINT_EQ(IntPoint(0, 1900), IntPoint(frameView->scrollOffset()));
// Simulate the top controls showing by 20px, thus shrinking the viewport
@@ -6127,7 +6127,7 @@ TEST_F(WebFrameTest, FrameViewScrollAccountsForTopControls)
// Show more, make sure the scroll actually gets clamped.
webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.0f, 20.0f / topControlsHeight);
- webView->setMainFrameScrollOffset(WebPoint(0, 2000));
+ webView->mainFrame()->setScrollOffset(WebSize(0, 2000));
EXPECT_POINT_EQ(IntPoint(0, 1940), IntPoint(frameView->scrollOffset()));
// Hide until there's 10px showing.

Powered by Google App Engine
This is Rietveld 408576698