Chromium Code Reviews| 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 c09d4297e59b979b3f5922d119e03393d6ee7607..000079ab3328c35ec417b47325840294a2e2967a 100644 |
| --- a/content/browser/site_per_process_browsertest.cc |
| +++ b/content/browser/site_per_process_browsertest.cc |
| @@ -459,11 +459,16 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CleanupCrossSiteIframe) { |
| EXPECT_EQ(foo_url, observer.last_navigation_url()); |
| // Ensure that we have created a new process for the subframes. |
| + RenderFrameHostImpl* child1_rfh = root->child_at(0)->current_frame_host(); |
| + RenderFrameHostImpl* child2_rfh = root->child_at(1)->current_frame_host(); |
| ASSERT_EQ(2U, root->child_count()); |
| EXPECT_NE(shell()->web_contents()->GetSiteInstance(), |
| - root->child_at(0)->current_frame_host()->GetSiteInstance()); |
| - EXPECT_EQ(root->child_at(0)->current_frame_host()->GetSiteInstance(), |
| - root->child_at(1)->current_frame_host()->GetSiteInstance()); |
| + child1_rfh->GetSiteInstance()); |
| + EXPECT_EQ(child1_rfh->GetSiteInstance(), child2_rfh->GetSiteInstance()); |
| + |
| + int subframe_process = child1_rfh->GetSiteInstance()->GetProcess()->GetID(); |
|
Charlie Reis
2015/05/21 18:48:16
At the risk of spilling to the next line, I think
nasko
2015/05/21 21:28:08
Done.
|
| + int subframe_rvh = child1_rfh->render_view_host()->GetRoutingID(); |
| + EXPECT_TRUE(RenderViewHost::FromID(subframe_process, subframe_rvh)); |
| // Use Javascript in the parent to remove one of the frames and ensure that |
| // the subframe goes away. |
| @@ -477,6 +482,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CleanupCrossSiteIframe) { |
| GURL new_url(embedded_test_server()->GetURL("/title1.html")); |
| NavigateToURL(shell(), new_url); |
| ASSERT_EQ(0U, root->child_count()); |
| + |
| + EXPECT_FALSE(RenderViewHost::FromID(subframe_process, subframe_rvh)); |
|
Charlie Reis
2015/05/21 18:48:16
// Ensure the RVH for the subframe gets cleaned up
nasko
2015/05/21 21:28:08
Done.
|
| } |
| // Ensure that root frames cannot be detached. |