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

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

Issue 23691017: [Android WebView] Treat zero values in viewport arguments specially (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed rune's comments Created 7 years, 3 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/WebSettingsImpl.cpp ('k') | Source/web/tests/data/viewport-zero-values.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 0aff89cd3852d81b7ee3cc3806ee06ecfc121a19..00cc71b08f06f7ed36fe49589fcddb5229840434 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -713,6 +713,34 @@ TEST_F(WebFrameTest, WideViewportInitialScaleDoesNotExpandFixedLayoutWidth)
EXPECT_EQ(viewportWidth, webViewImpl->mainFrameImpl()->frameView()->fixedLayoutSize().width());
}
+TEST_F(WebFrameTest, ZeroValuesQuirk)
+{
+ registerMockedHttpURLLoad("viewport-zero-values.html");
+
+ FixedLayoutTestWebViewClient client;
+ client.m_screenInfo.deviceScaleFactor = 1;
+ int viewportWidth = 640;
+ int viewportHeight = 480;
+
+ m_webView = FrameTestHelpers::createWebView(true, 0, &client);
+ m_webView->enableFixedLayoutMode(true);
+ m_webView->settings()->setViewportEnabled(true);
+ m_webView->settings()->setSupportDeprecatedTargetDensityDPI(true);
+ m_webView->settings()->setViewportMetaZeroValuesQuirk(true);
+ FrameTestHelpers::loadFrame(m_webView->mainFrame(), m_baseURL + "viewport-zero-values.html");
+ Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests();
+ m_webView->resize(WebSize(viewportWidth, viewportHeight));
+
+ WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(m_webView);
+ EXPECT_EQ(viewportWidth, webViewImpl->mainFrameImpl()->frameView()->fixedLayoutSize().width());
+ EXPECT_EQ(1.0f, m_webView->pageScaleFactor());
+
+ m_webView->settings()->setUseWideViewport(true);
+ m_webView->layout();
+ EXPECT_EQ(viewportWidth, webViewImpl->mainFrameImpl()->frameView()->fixedLayoutSize().width());
+ EXPECT_EQ(1.0f, m_webView->pageScaleFactor());
+}
+
TEST_F(WebFrameTest, ScaleFactorShouldNotOscillate)
{
registerMockedHttpURLLoad("scale_oscillate.html");
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | Source/web/tests/data/viewport-zero-values.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698