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

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

Issue 1291343008: Fix crash in WebViewImpl::contentsPreferredMinimumSize (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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/web/WebViewImpl.cpp ('k') | no next file » | 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 d56dcf82a7a4f119c8a05eff5418dd33325dbfa3..87d2cf54fd1d92d024163b0aa4da4796d29e5b18 100644
--- a/Source/web/tests/WebViewTest.cpp
+++ b/Source/web/tests/WebViewTest.cpp
@@ -2622,6 +2622,25 @@ TEST_F(WebViewTest, PreferredSize)
EXPECT_EQ(2, size.height);
}
+TEST_F(WebViewTest, PreferredSizeDirtyLayout)
+{
+ std::string url = m_baseURL + "specify_size.html?100px:100px";
+ URLTestHelpers::registerMockedURLLoad(toKURL(url), "specify_size.html");
+ WebView* webView = m_webViewHelper.initializeAndLoad(url, true);
+ WebElement documentElement = webView->mainFrame()->document().documentElement();
+
+ WebSize size = webView->contentsPreferredMinimumSize();
+ EXPECT_EQ(100, size.width);
+ EXPECT_EQ(100, size.height);
+
+ bool setStyle = documentElement.setAttribute("style", "display: none");
+ EXPECT_TRUE(setStyle);
+
+ size = webView->contentsPreferredMinimumSize();
+ EXPECT_EQ(0, size.width);
+ EXPECT_EQ(0, size.height);
+}
+
class UnhandledTapWebViewClient : public FrameTestHelpers::TestWebViewClient {
public:
void showUnhandledTapUIIfNeeded(const WebPoint& tappedPosition, const WebNode& tappedNode, bool pageChanged) override
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698