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

Unified Diff: content/browser/frame_host/frame_tree_browsertest.cc

Issue 452673002: Don't leave a RenderFrameProxyHost for the current RenderFrameHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Original 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 | « no previous file | content/browser/frame_host/render_frame_host_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_tree_browsertest.cc
diff --git a/content/browser/frame_host/frame_tree_browsertest.cc b/content/browser/frame_host/frame_tree_browsertest.cc
index 287506c50e61db7450f0a030d3c2daab9901f3c5..d96ee59d10e7784f38e88e264369527ad95acee9 100644
--- a/content/browser/frame_host/frame_tree_browsertest.cc
+++ b/content/browser/frame_host/frame_tree_browsertest.cc
@@ -187,6 +187,10 @@ IN_PROC_BROWSER_TEST_F(CrossProcessFrameTreeBrowserTest,
FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
->GetFrameTree()->root();
+ // There should not be a proxy for the root's own SiteInstance.
+ SiteInstance* root_instance = root->current_frame_host()->GetSiteInstance();
+ EXPECT_FALSE(root->render_manager()->GetRenderFrameProxyHost(root_instance));
Charlie Reis 2014/08/08 17:19:39 Note: This used to fail because we tried to swap f
+
// Load same-site page into iframe.
GURL http_url(test_server()->GetURL("files/title1.html"));
NavigateFrameToURL(root->child_at(0), http_url);
@@ -204,20 +208,24 @@ IN_PROC_BROWSER_TEST_F(CrossProcessFrameTreeBrowserTest,
// Ensure that we have created a new process for the subframe.
ASSERT_EQ(1U, root->child_count());
FrameTreeNode* child = root->child_at(0);
- SiteInstance* site_instance = child->current_frame_host()->GetSiteInstance();
+ SiteInstance* child_instance = child->current_frame_host()->GetSiteInstance();
RenderViewHost* rvh = child->current_frame_host()->render_view_host();
RenderProcessHost* rph = child->current_frame_host()->GetProcess();
EXPECT_NE(shell()->web_contents()->GetRenderViewHost(), rvh);
- EXPECT_NE(shell()->web_contents()->GetSiteInstance(), site_instance);
+ EXPECT_NE(shell()->web_contents()->GetSiteInstance(), child_instance);
EXPECT_NE(shell()->web_contents()->GetRenderProcessHost(), rph);
// Ensure that the root node has a proxy for the child node's SiteInstance.
- EXPECT_TRUE(root->render_manager()->proxy_hosts_[site_instance->GetId()]);
+ EXPECT_TRUE(root->render_manager()->GetRenderFrameProxyHost(child_instance));
// Also ensure that the child has a proxy for the root node's SiteInstance.
- EXPECT_TRUE(child->render_manager()->proxy_hosts_[
- root->current_frame_host()->GetSiteInstance()->GetId()]);
+ EXPECT_TRUE(child->render_manager()->GetRenderFrameProxyHost(root_instance));
+
+ // The nodes should not have proxies for their own SiteInstance.
+ EXPECT_FALSE(root->render_manager()->GetRenderFrameProxyHost(root_instance));
+ EXPECT_FALSE(
+ child->render_manager()->GetRenderFrameProxyHost(child_instance));
}
} // namespace content
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698