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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 1106673002: Swap the main frame in --site-per-process mode too. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 5 years, 7 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/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ca329520745dd2e6e75fcee9ddfa7d987544aa61..3f6c993a90a44c7938d1ebb4bcd98870c50841a3 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -2312,4 +2312,38 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, RFPHDestruction) {
DepictFrameTree(root));
}
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
nasko 2015/05/06 22:57:44 nit: It will be useful to add a description of wha
dcheng 2015/05/07 22:30:13 Done.
+ OpenCrossSiteWindowWithFrames) {
+ ASSERT_EQ(1u, Shell::windows().size());
+ Shell* main_window = Shell::windows()[0];
+
+ // Navigate the main window.
+ GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html"));
+ NavigateToURL(main_window, main_url);
+ EXPECT_EQ(main_window->web_contents()->GetLastCommittedURL(), main_url);
+
+ // Load a cross-site page into a new window.
+ GURL cross_url =
+ embedded_test_server()->GetURL("foo.com", "/site_per_process_main.html");
+ std::string script = "window.open('" + cross_url.spec() + "')";
+ EXPECT_TRUE(ExecuteScript(main_window->web_contents(), script));
+ ASSERT_EQ(2u, Shell::windows().size());
+ Shell* cross_window = Shell::windows()[1];
+ WaitForLoadStop(cross_window->web_contents());
+ EXPECT_EQ(cross_window->web_contents()->GetLastCommittedURL(), cross_url);
+
+ // Make sure the main window is still live. To create a synchronization point
+ // and ensure that the renderer has processed all the messages for updating
+ // the frame tree, execute a simple bit of JS first.
+ EXPECT_TRUE(ExecuteScript(main_window->web_contents(), "true"));
+ EXPECT_TRUE(static_cast<WebContentsImpl*>(main_window->web_contents())
+ ->GetMainFrame()
+ ->IsRenderFrameLive());
+ // And check the cross-site window too.
+ EXPECT_TRUE(ExecuteScript(cross_window->web_contents(), "true"));
+ EXPECT_TRUE(static_cast<WebContentsImpl*>(cross_window->web_contents())
+ ->GetMainFrame()
+ ->IsRenderFrameLive());
+}
+
} // namespace content
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698