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

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

Issue 61593006: Zoom instead of autosizing for desktop sites. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a test. Created 7 years, 1 month 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/PageScaleConstraintsSet.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 93b7ceb6b03faf8c753103139523fc77a0b7c03b..6e0028582097158658b7751e6639ddfedf863aa4 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -2088,6 +2088,28 @@ TEST_F(WebFrameTest, CanOverrideScaleLimits)
EXPECT_EQ(2.0f, webViewHelper.webView()->maximumPageScaleFactor());
}
+TEST_F(WebFrameTest, DeviceScaleAdjustmentReducesLayoutWidth)
+{
+ UseMockScrollbarSettings mockScrollbarSettings;
+
+ registerMockedHttpURLLoad("hello_world.html");
+
+ int viewportWidth = 1280;
+ int viewportHeight = 800;
+ float deviceScaleAdjustment = 1.3f;
+
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ webViewHelper.initializeAndLoad(m_baseURL + "hello_world.html", true);
+ webViewHelper.webView()->settings()->setViewportEnabled(true);
+ webViewHelper.webView()->settings()->setDeviceScaleAdjustment(deviceScaleAdjustment);
+
+ webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
+ webViewHelper.webView()->layout();
+
+ EXPECT_EQ(static_cast<int>(viewportWidth / deviceScaleAdjustment),
+ webViewHelper.webViewImpl()->page()->mainFrame()->view()->layoutSize().width());
+}
+
TEST_F(WebFrameTest, updateOverlayScrollbarLayers)
{
UseMockScrollbarSettings mockScrollbarSettings;
« Source/web/PageScaleConstraintsSet.cpp ('K') | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698