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

Side by Side 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: 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/history_entry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/site_per_process_browsertest.h" 5 #include "content/browser/site_per_process_browsertest.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/browser/frame_host/cross_process_frame_connector.h" 10 #include "content/browser/frame_host/cross_process_frame_connector.h"
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 params.transition_type = ui::PAGE_TRANSITION_LINK; 1311 params.transition_type = ui::PAGE_TRANSITION_LINK;
1312 params.frame_tree_node_id = child->frame_tree_node_id(); 1312 params.frame_tree_node_id = child->frame_tree_node_id();
1313 child->navigator()->GetController()->LoadURLWithParams(params); 1313 child->navigator()->GetController()->LoadURLWithParams(params);
1314 nav_observer.Wait(); 1314 nav_observer.Wait();
1315 1315
1316 // Verify that the navigation succeeded and the expected URL was loaded. 1316 // Verify that the navigation succeeded and the expected URL was loaded.
1317 EXPECT_TRUE(observer.last_navigation_succeeded()); 1317 EXPECT_TRUE(observer.last_navigation_succeeded());
1318 EXPECT_EQ(url, observer.last_navigation_url()); 1318 EXPECT_EQ(url, observer.last_navigation_url());
1319 } 1319 }
1320 1320
1321 // Ensure that the renderer does not crash when navigating a frame that has a
1322 // sibling RemoteFrame. See https://crbug.com/426953.
1323 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
1324 NavigateWithSiblingRemoteFrame) {
1325 GURL main_url(embedded_test_server()->GetURL(
alexmos 2015/02/19 00:33:08 Nit: git cl format put the line break after "main_
Charlie Reis 2015/02/19 00:36:52 Thanks. Ran git cl format.
1326 "/frame_tree/page_with_two_frames.html"));
1327 NavigateToURL(shell(), main_url);
1328
1329 // It is safe to obtain the root frame tree node here, as it doesn't change.
1330 FrameTreeNode* root =
1331 static_cast<WebContentsImpl*>(shell()->web_contents())->
1332 GetFrameTree()->root();
1333 TestNavigationObserver observer(shell()->web_contents());
1334
1335 // Make sure the first frame is out of process.
1336 ASSERT_EQ(2U, root->child_count());
1337 FrameTreeNode* node2 = root->child_at(0);
1338 EXPECT_NE(root->current_frame_host()->GetSiteInstance(),
1339 node2->current_frame_host()->GetSiteInstance());
1340
1341 // Make sure the second frame is in the parent's process.
1342 FrameTreeNode* node3 = root->child_at(1);
1343 EXPECT_EQ(root->current_frame_host()->GetSiteInstance(),
1344 node3->current_frame_host()->GetSiteInstance());
1345
1346 // Navigate the second iframe (node3) to a URL in its own process.
1347 GURL title_url = embedded_test_server()->GetURL("/title2.html");
1348 NavigateFrameToURL(node3, title_url);
1349 EXPECT_TRUE(observer.last_navigation_succeeded());
1350 EXPECT_EQ(title_url, observer.last_navigation_url());
1351 EXPECT_EQ(root->current_frame_host()->GetSiteInstance(),
1352 node3->current_frame_host()->GetSiteInstance());
1353 EXPECT_TRUE(node3->current_frame_host()->IsRenderFrameLive());
1354 }
1355
1321 } // namespace content 1356 } // namespace content
OLDNEW
« 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