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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 2496233003: Destroy the old RenderWidgetHostView when swapping out a main frame. (Closed)
Patch Set: Created 4 years, 1 month 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
Index: content/browser/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index 19f96d6a93448a19c60bdc20d14236fde6258d66..500c88772cd90b0fdacd08e946d2ee245c7834cf 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -8562,4 +8562,30 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
}
+// This tests that we don't hide the RenderViewHost when reusing the
+// RenderViewHost for a subframe. See https://crbug.com/638375.
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ReusedRenderViewNotHidden) {
+ GURL a_url(embedded_test_server()->GetURL("a.com", "/title1.html"));
+ GURL b_url_a_subframe(embedded_test_server()->GetURL(
+ "b.com", "/cross_site_iframe_factory.html?b(a)"));
+
+ EXPECT_TRUE(NavigateToURL(shell(), a_url));
+
+ // Open a popup in a.com.
+ Shell* popup = OpenPopup(shell(), a_url, "popup");
+
+ // Navigate this popup to b.com with an a.com subframe.
+ EXPECT_TRUE(NavigateToURL(popup, b_url_a_subframe));
+
+ FrameTreeNode* root = static_cast<WebContentsImpl*>(popup->web_contents())
+ ->GetFrameTree()
+ ->root();
+ FrameTreeNode* child_node = root->child_at(0);
+
+ EXPECT_FALSE(child_node->current_frame_host()
+ ->render_view_host()
+ ->GetWidget()
+ ->is_hidden());
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698