Chromium Code Reviews| Index: Source/web/tests/WebFrameTest.cpp |
| diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp |
| index 8bdd4513fa124eaef83320487080146863deb82d..0b1c3964788c72a558dd6b2d02a6aaaa2d01487a 100644 |
| --- a/Source/web/tests/WebFrameTest.cpp |
| +++ b/Source/web/tests/WebFrameTest.cpp |
| @@ -1371,6 +1371,37 @@ TEST_F(WebFrameTest, WideViewportInitialScaleDoesNotExpandFixedLayoutWidth) |
| EXPECT_EQ(0.5f, webViewHelper.webView()->pageScaleFactor()); |
| } |
| +TEST_F(WebFrameTest, SetForceZeroLayoutHeight) |
| +{ |
| + UseMockScrollbarSettings mockScrollbarSettings; |
| + registerMockedHttpURLLoad("200-by-300.html"); |
| + |
| + FixedLayoutTestWebViewClient client; |
| + client.m_screenInfo.deviceScaleFactor = 1; |
| + int viewportWidth = 640; |
| + int viewportHeight = 480; |
| + |
| + FrameTestHelpers::WebViewHelper webViewHelper; |
| + |
| + webViewHelper.initializeAndLoad(m_baseURL + "200-by-300.html", true, 0, &client, enableViewportSettings); |
| + webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); |
| + webViewHelper.webView()->layout(); |
| + |
| + EXPECT_NE(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height()); |
| + webViewHelper.webViewImpl()->setForceZeroLayoutHeight(true); |
| + EXPECT_TRUE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->needsLayout()); |
| + |
| + EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height()); |
| + |
| + webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight * 2)); |
| + EXPECT_FALSE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->needsLayout()); |
| + EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height()); |
| + |
| + webViewHelper.webView()->resize(WebSize(viewportWidth * 2, viewportHeight)); |
| + webViewHelper.webView()->layout(); |
| + EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height()); |
|
mnaganov (inactive)
2014/07/09 16:13:11
Maybe it makes sense to disable the setting again
mkosiba (inactive)
2014/07/09 17:01:27
Done.
|
| +} |
| + |
| TEST_F(WebFrameTest, WideViewportAndWideContentWithInitialScale) |
| { |
| UseMockScrollbarSettings mockScrollbarSettings; |