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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 913223009: Avoid crash in HistoryNode::CloneAndReplace with out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 5 years, 10 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/history_entry.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 9c9c0f2f05c6805d133c20fe6a0a725a15077d01..d7384299a521a66eaf9f4ddfedc1e8c42564a271 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -1318,4 +1318,39 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteDidStopLoading) {
EXPECT_EQ(url, observer.last_navigation_url());
}
+// Ensure that the renderer does not crash when navigating a frame that has a
+// sibling RemoteFrame. See https://crbug.com/426953.
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
+ NavigateWithSiblingRemoteFrame) {
+ GURL main_url(
+ embedded_test_server()->GetURL("/frame_tree/page_with_two_frames.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();
+ TestNavigationObserver observer(shell()->web_contents());
+
+ // Make sure the first frame is out of process.
+ ASSERT_EQ(2U, root->child_count());
+ FrameTreeNode* node2 = root->child_at(0);
+ EXPECT_NE(root->current_frame_host()->GetSiteInstance(),
+ node2->current_frame_host()->GetSiteInstance());
+
+ // Make sure the second frame is in the parent's process.
+ FrameTreeNode* node3 = root->child_at(1);
+ EXPECT_EQ(root->current_frame_host()->GetSiteInstance(),
+ node3->current_frame_host()->GetSiteInstance());
+
+ // Navigate the second iframe (node3) to a URL in its own process.
+ GURL title_url = embedded_test_server()->GetURL("/title2.html");
+ NavigateFrameToURL(node3, title_url);
+ EXPECT_TRUE(observer.last_navigation_succeeded());
+ EXPECT_EQ(title_url, observer.last_navigation_url());
+ EXPECT_EQ(root->current_frame_host()->GetSiteInstance(),
+ node3->current_frame_host()->GetSiteInstance());
+ EXPECT_TRUE(node3->current_frame_host()->IsRenderFrameLive());
+}
+
} // namespace content
« no previous file with comments | « no previous file | content/renderer/history_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698