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 af10e3eecb5356c00b344c734801224d8a3c860c..78ad391c45d9593d8b7ce3a10525c3aba6395d35 100644 |
| --- a/content/browser/site_per_process_browsertest.cc |
| +++ b/content/browser/site_per_process_browsertest.cc |
| @@ -395,6 +395,44 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, NavigateRemoteFrame) { |
| child->current_frame_host()->GetSiteInstance()); |
| } |
| +IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, |
|
nasko
2014/12/12 22:25:01
nit: Add a comment about what this case is testing
lazyboy
2014/12/23 22:03:11
Done.
|
| + NavigateRemoteFrameToAKilledSiteInstance) { |
|
Charlie Reis
2014/12/12 19:18:31
nit: ToAKilledSiteInstance -> ToKilledProcess
lazyboy
2014/12/23 22:03:11
Done.
|
| + GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); |
| + NavigateToURL(shell(), main_url); |
| + |
| + // It is safe to obtain the root frame tree node here, as it doesn't change. |
| + FrameTreeNode* root = |
| + static_cast<WebContentsImpl*>(shell()->web_contents())-> |
| + GetFrameTree()->root(); |
| + |
| + SitePerProcessWebContentsObserver observer(shell()->web_contents()); |
| + |
| + FrameTreeNode* first_child = root->child_at(0); |
|
Charlie Reis
2014/12/12 19:18:31
Before this, we should ASSERT_EQ(2U, root->child_c
lazyboy
2014/12/23 22:03:11
Done.
|
| + // Load cross-site page into first iframe. |
| + GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html"); |
| + NavigateFrameToURL(first_child, url); |
| + EXPECT_TRUE(observer.navigation_succeeded()); |
| + EXPECT_EQ(url, observer.navigation_url()); |
| + |
| + // Kill that cross-site renderer. |
| + RenderProcessHost* child_process = |
| + first_child->current_frame_host()->GetProcess(); |
| + { |
|
Charlie Reis
2014/12/12 19:18:31
nit: No need for brace here if we're only doing on
lazyboy
2014/12/23 22:03:11
Done.
|
| + RenderProcessHostWatcher crash_observer( |
| + child_process, |
| + RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); |
| + child_process->Shutdown(0, false); |
| + crash_observer.Wait(); |
| + } |
| + |
| + // Now navigate the second iframe to the same site as the first_child. |
| + FrameTreeNode* second_child = root->child_at(1); |
| + url = embedded_test_server()->GetURL("foo.com", "/title1.html"); |
|
nasko
2014/12/12 22:25:01
nit: It seems strange to navigate to title2 first
lazyboy
2014/12/23 22:03:11
Done.
|
| + NavigateFrameToURL(second_child, url); |
| + EXPECT_TRUE(observer.navigation_succeeded()); |
| + EXPECT_EQ(url, observer.navigation_url()); |
| +} |
| + |
| // Crash a subframe and ensures its children are cleared from the FrameTree. |
| // See http://crbug.com/338508. |
| // TODO(creis): Disabled for flakiness; see http://crbug.com/405582. |