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

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

Issue 473903002: Avoid auto-resize re-entrancy problems. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 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/core/frame/FrameView.cpp ('k') | Source/web/tests/data/subtree-layout.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/web/tests/data/subtree-layout.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698