Chromium Code Reviews| Index: Source/web/tests/WebFrameTest.cpp |
| diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp |
| index ed37af9ec251f6c0a1fff35466be1896532ba67b..e4d163e4ceda2739939cb020d9908ad29cf3710a 100644 |
| --- a/Source/web/tests/WebFrameTest.cpp |
| +++ b/Source/web/tests/WebFrameTest.cpp |
| @@ -1317,7 +1317,6 @@ TEST_F(WebFrameTest, SetForceZeroLayoutHeightWorksWithWrapContentsMode) |
| EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width()); |
| EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height()); |
| EXPECT_EQ(viewportWidth, compositor->containerLayer()->size().width()); |
| - EXPECT_EQ(0.0, compositor->containerLayer()->size().height()); |
| LocalFrame* frame = webViewHelper.webViewImpl()->mainFrameImpl()->frame(); |
| PinchViewport& pinchViewport = frame->page()->frameHost().pinchViewport(); |
| @@ -1360,6 +1359,34 @@ TEST_F(WebFrameTest, SetForceZeroLayoutHeight) |
| EXPECT_LE(viewportHeight, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height()); |
| } |
| +TEST_F(WebFrameTest, SetForceZeroLayoutHeightWorksWithRelayoutsWhenHeightChanged) |
| +{ |
| + UseMockScrollbarSettings mockScrollbarSettings; |
| + registerMockedHttpURLLoad("button.html"); |
| + |
| + FixedLayoutTestWebViewClient client; |
| + client.m_screenInfo.deviceScaleFactor = 1; |
| + int viewportWidth = 640; |
| + int viewportHeight = 480; |
| + |
| + FrameTestHelpers::WebViewHelper webViewHelper; |
| + |
| + webViewHelper.initializeAndLoad(m_baseURL + "button.html", true, 0, &client, configurePinchVirtualViewport); |
| + webViewHelper.webView()->resize(WebSize(viewportWidth, 0)); |
|
aelias_OOO_until_Jul13
2015/02/12 19:49:17
I don't think we should be setting 0 viewport heig
boliu
2015/02/12 20:04:43
It does happen in reality. Some apps with wrap-con
aelias_OOO_until_Jul13
2015/02/12 20:08:37
OK then, fine to leave as is, thanks for the clari
boliu
2015/02/12 20:10:27
Should add some comments explaining this. No one w
gsennton
2015/02/13 19:11:15
Done.
|
| + webViewHelper.webView()->layout(); |
| + |
| + webViewHelper.webView()->settings()->setForceZeroLayoutHeight(true); |
| + EXPECT_TRUE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->needsLayout()); |
| + |
| + webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); |
| + |
| + IntPoint hitPoint = IntPoint(30, 30); // button size is 100x100 |
| + |
| + RefPtrWillBeRawPtr<Node> hitNode = webViewHelper.webViewImpl()->mainFrameImpl()->frame()->eventHandler().hitTestResultAtPoint(hitPoint, HitTestRequest::ReadOnly | HitTestRequest::Active).innerNode(); |
|
aelias_OOO_until_Jul13
2015/02/12 19:49:17
Could you send down an input event via handleGestu
gsennton
2015/02/13 19:11:15
Done.
|
| + EXPECT_NE(nullptr, hitNode.get()); |
| + EXPECT_EQ(String("BUTTON"), hitNode->nodeName()); |
| +} |
| + |
| TEST_F(WebFrameTest, SetForceZeroLayoutHeightWorksAcrossNavigations) |
| { |
| UseMockScrollbarSettings mockScrollbarSettings; |