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

Side by Side 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: Update 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.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 <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after
2305 " Site A\n" 2305 " Site A\n"
2306 " |--Site A\n" 2306 " |--Site A\n"
2307 " +--Site A\n" 2307 " +--Site A\n"
2308 " |--Site A\n" 2308 " |--Site A\n"
2309 " +--Site A\n" 2309 " +--Site A\n"
2310 " +--Site A\n" 2310 " +--Site A\n"
2311 "Where A = http://127.0.0.1/", 2311 "Where A = http://127.0.0.1/",
2312 DepictFrameTree(root)); 2312 DepictFrameTree(root));
2313 } 2313 }
2314 2314
2315 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
2316 OpenCrossSiteWindowWithFrames) {
2317 ASSERT_EQ(1u, Shell::windows().size());
2318 Shell* main_window = Shell::windows()[0];
2319
2320 // Navigate the main window.
2321 GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html"));
2322 NavigateToURL(main_window, main_url);
2323 EXPECT_EQ(main_window->web_contents()->GetLastCommittedURL(), main_url);
2324
2325 // Load a cross-site page into a new window.
2326 GURL cross_url =
2327 embedded_test_server()->GetURL("foo.com", "/site_per_process_main.html");
2328 std::string script = "window.open('" + cross_url.spec() + "')";
2329 EXPECT_TRUE(ExecuteScript(main_window->web_contents(), script));
2330 ASSERT_EQ(2u, Shell::windows().size());
2331 Shell* cross_window = Shell::windows()[1];
2332 WaitForLoadStop(cross_window->web_contents());
2333 EXPECT_EQ(cross_window->web_contents()->GetLastCommittedURL(), cross_url);
2334
2335 // Make sure the main window is still live. To create a synchronization point
2336 // and ensure that the renderer has processed all the messages for updating
2337 // 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
2338 EXPECT_TRUE(ExecuteScript(main_window->web_contents(), "true"));
2339 FrameTreeNode* root =
2340 static_cast<WebContentsImpl*>(main_window->web_contents())
2341 ->GetFrameTree()
2342 ->root();
2343 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
2344 }
2345
2315 } // namespace content 2346 } // namespace content
OLDNEW
« 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