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..ced931c262aec5fbc1905fcfe8b14970b3a5fac2 100644 |
--- a/content/browser/site_per_process_browsertest.cc |
+++ b/content/browser/site_per_process_browsertest.cc |
@@ -2312,4 +2312,35 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, RFPHDestruction) { |
DepictFrameTree(root)); |
} |
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, |
+ 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. |
dcheng
2015/05/05 21:58:08
It seems like there should be a better way to do t
|
+ EXPECT_TRUE(ExecuteScript(main_window->web_contents(), "true")); |
+ FrameTreeNode* root = |
+ static_cast<WebContentsImpl*>(main_window->web_contents()) |
+ ->GetFrameTree() |
+ ->root(); |
+ EXPECT_TRUE(root->current_frame_host()->IsRenderFrameLive()); |
dcheng
2015/05/05 21:58:08
Should I do this for the cross-site window too?
nasko
2015/05/06 21:55:24
I don't think it will hurt. Also, why not use WebC
dcheng
2015/05/06 22:52:27
Done.
No real reason other than I didn't know abo
|
+} |
+ |
} // namespace content |