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

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

Issue 23461009: Scale to legibleScale if double tap would barely zoom in from zoomed out state. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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/web/WebViewImpl.cpp ('K') | « Source/web/WebViewImpl.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 3ebaed81af6d3a1ae437d36ed36b99f831c19753..193fbe4f149992d4762f935c7af10748a4681039 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -1182,40 +1182,36 @@ TEST_F(WebFrameTest, DivAutoZoomParamsTest)
WebRect tallBlockBounds;
float scale;
WebPoint scroll;
- bool doubleTapShouldZoomOut;
// Test double-tap zooming into wide div.
wideBlockBounds = webViewImpl()->computeBlockBounds(doubleTapPointWide, false);
- webViewImpl()->computeScaleAndScrollForBlockRect(wideBlockBounds, touchPointPadding, scale, scroll, doubleTapShouldZoomOut);
+ webViewImpl()->computeScaleAndScrollForBlockRect(wideBlockBounds, touchPointPadding, scale, scroll);
// The div should horizontally fill the screen (modulo margins), and
// vertically centered (modulo integer rounding).
EXPECT_NEAR(viewportWidth / (float) wideDiv.width, scale, 0.1);
EXPECT_NEAR(wideDiv.x, scroll.x, 20);
EXPECT_EQ(0, scroll.y);
- EXPECT_FALSE(doubleTapShouldZoomOut);
setScaleAndScrollAndLayout(webViewImpl(), scroll, scale);
// Test zoom out back to minimum scale.
wideBlockBounds = webViewImpl()->computeBlockBounds(doubleTapPointWide, false);
- webViewImpl()->computeScaleAndScrollForBlockRect(wideBlockBounds, touchPointPadding, scale, scroll, doubleTapShouldZoomOut);
- EXPECT_TRUE(doubleTapShouldZoomOut);
+ webViewImpl()->computeScaleAndScrollForBlockRect(wideBlockBounds, touchPointPadding, scale, scroll);
scale = webViewImpl()->minimumPageScaleFactor();
setScaleAndScrollAndLayout(webViewImpl(), WebPoint(0, 0), scale);
// Test double-tap zooming into tall div.
tallBlockBounds = webViewImpl()->computeBlockBounds(doubleTapPointTall, false);
- webViewImpl()->computeScaleAndScrollForBlockRect(tallBlockBounds, touchPointPadding, scale, scroll, doubleTapShouldZoomOut);
+ webViewImpl()->computeScaleAndScrollForBlockRect(tallBlockBounds, touchPointPadding, scale, scroll);
// The div should start at the top left of the viewport.
EXPECT_NEAR(viewportWidth / (float) tallDiv.width, scale, 0.1);
EXPECT_NEAR(tallDiv.x, scroll.x, 20);
EXPECT_NEAR(tallDiv.y, scroll.y, 20);
- EXPECT_FALSE(doubleTapShouldZoomOut);
// Test for Non-doubletap scaling
// Test zooming into div.
- webViewImpl()->computeScaleAndScrollForBlockRect(webViewImpl()->computeBlockBounds(WebRect(250, 250, 10, 10), true), 0, scale, scroll, doubleTapShouldZoomOut);
+ webViewImpl()->computeScaleAndScrollForBlockRect(webViewImpl()->computeBlockBounds(WebRect(250, 250, 10, 10), true), 0, scale, scroll);
EXPECT_NEAR(viewportWidth / (float) wideDiv.width, scale, 0.1);
}
« Source/web/WebViewImpl.cpp ('K') | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698