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

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: Addressed aelias' comments 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
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/data/viewport-device-0.5x-initial-scale.html » ('j') | 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 37d4f7efab0f4638a0e830bf2ac87dbef1ef4ed7..ac286310824f7aab537247353d4c31196fbf8f86 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()->setViewportMetaLayoutSizeQuirk(true);
+ 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");
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/data/viewport-device-0.5x-initial-scale.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698