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

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

Issue 23038013: [Android WebView] Avoid expanding layout width to match the old WebView (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created a separate setting 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
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index 3ebaed81af6d3a1ae437d36ed36b99f831c19753..6c7ac239dcf429c1feb5c43adfca0aba8f85becd 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -692,6 +692,27 @@ TEST_F(WebFrameTest, PermanentInitialPageScaleFactorOverridesPageViewportInitial
EXPECT_EQ(enforcedPageScalePactor, m_webView->pageScaleFactor());
}
+TEST_F(WebFrameTest, WideViewportInitialScaleDoesNotExpandFixedLayoutWidth)
+{
+ registerMockedHttpURLLoad("viewport-device-0.5x-initial-scale.html");
+
+ FixedLayoutTestWebViewClient client;
+ client.m_screenInfo.deviceScaleFactor = 1;
+ int viewportWidth = 640;
+ int viewportHeight = 480;
+
+ m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "viewport-device-0.5x-initial-scale.html", true, 0, &client);
+ m_webView->enableFixedLayoutMode(true);
+ m_webView->settings()->setViewportEnabled(true);
+ m_webView->settings()->setUseWideViewport(true);
+ m_webView->settings()->setSupportDeprecatedTargetDensityDPI(true);
+ m_webView->settings()->setExpandLayoutToFillVisualViewport(false);
+ m_webView->resize(WebSize(viewportWidth, viewportHeight));
+
+ WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(m_webView);
+ EXPECT_EQ(viewportWidth, webViewImpl->mainFrameImpl()->frameView()->fixedLayoutSize().width());
+}
+
TEST_F(WebFrameTest, ScaleFactorShouldNotOscillate)
{
registerMockedHttpURLLoad("scale_oscillate.html");

Powered by Google App Engine
This is Rietveld 408576698