Index: Source/web/tests/WebViewTest.cpp |
diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp |
index d65334e020cdb1fec98de81cfb0fa0cb0f08cfda..704e8538e605856511989c6f3c17e9bbb71c3da4 100644 |
--- a/Source/web/tests/WebViewTest.cpp |
+++ b/Source/web/tests/WebViewTest.cpp |
@@ -82,6 +82,7 @@ |
#include <gtest/gtest.h> |
using namespace blink; |
+using blink::FrameTestHelpers::loadFrame; |
using blink::FrameTestHelpers::runPendingTasks; |
using blink::URLTestHelpers::toKURL; |
@@ -2170,4 +2171,20 @@ TEST_F(WebViewTest, CompareSelectAllToContentAsText) |
EXPECT_EQ(expected, actual); |
} |
+TEST_F(WebViewTest, AutoResizeSubtreeLayout) |
+{ |
+ std::string url = m_baseURL + "subtree-layout.html"; |
+ URLTestHelpers::registerMockedURLLoad(toKURL(url), "subtree-layout.html"); |
+ WebView* webView = m_webViewHelper.initialize(true); |
+ |
+ webView->enableAutoResizeMode(WebSize(200, 200), WebSize(200, 200)); |
+ loadFrame(webView->mainFrame(), url); |
+ |
+ blink::FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frameView(); |
+ |
+ // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. This EXPECT is |
+ // merely a dummy. The real test is that we don't trigger asserts in debug builds. |
+ EXPECT_FALSE(frameView->needsLayout()); |
+}; |
+ |
} // namespace |