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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 782093002: Ensure that before creating proxy of site A, RVH of site A is initialized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Create new RVH instead of re-using + Add test Created 6 years 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 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.
« content/browser/frame_host/frame_tree.cc ('K') | « content/browser/frame_host/frame_tree.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698