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

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 600553003: Enable swapping a frame back in to its parent process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remoteToLocal
Patch Set: Created 6 years, 1 month 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
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 "content/browser/frame_host/cross_process_frame_connector.h" 9 #include "content/browser/frame_host/cross_process_frame_connector.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 child->current_frame_host()->GetSiteInstance()); 291 child->current_frame_host()->GetSiteInstance());
292 EXPECT_NE(shell()->web_contents()->GetRenderProcessHost(), 292 EXPECT_NE(shell()->web_contents()->GetRenderProcessHost(),
293 child->current_frame_host()->GetProcess()); 293 child->current_frame_host()->GetProcess());
294 EXPECT_NE(rph, child->current_frame_host()->GetProcess()); 294 EXPECT_NE(rph, child->current_frame_host()->GetProcess());
295 { 295 {
296 std::set<RenderWidgetHostView*> views_set = 296 std::set<RenderWidgetHostView*> views_set =
297 static_cast<WebContentsImpl*>(shell()->web_contents()) 297 static_cast<WebContentsImpl*>(shell()->web_contents())
298 ->GetRenderWidgetHostViewsInTree(); 298 ->GetRenderWidgetHostViewsInTree();
299 EXPECT_EQ(2U, views_set.size()); 299 EXPECT_EQ(2U, views_set.size());
300 } 300 }
301 EXPECT_EQ(proxy_to_parent, child->render_manager()->GetProxyToParent()); 301 EXPECT_NE(proxy_to_parent, child->render_manager()->GetProxyToParent());
nasko 2014/10/27 22:52:54 Hmm, why is that? The proxy object for the parent
Nate Chapin 2014/10/28 19:59:20 I would have thought that the child changing proce
Charlie Reis 2014/10/28 20:10:10 I'll defer to Nasko (or Ken) here, but let's figur
nasko 2014/10/28 21:58:14 When a child frame navigates, it changes process,
Nate Chapin 2014/10/29 20:39:42 Ah, I think I understand this now. The problem has
Charlie Reis 2014/10/29 21:28:32 Nasko: Actually, I think Nate found an interesting
Nate Chapin 2014/10/30 19:00:50 Nasko tells me this should be resolved once https:
302 proxy_to_parent = child->render_manager()->GetProxyToParent();
303 EXPECT_TRUE(proxy_to_parent);
302 EXPECT_TRUE(proxy_to_parent->cross_process_frame_connector()); 304 EXPECT_TRUE(proxy_to_parent->cross_process_frame_connector());
303 EXPECT_EQ( 305 EXPECT_EQ(
304 child->current_frame_host()->render_view_host()->GetView(), 306 child->current_frame_host()->render_view_host()->GetView(),
305 proxy_to_parent->cross_process_frame_connector()->get_view_for_testing()); 307 proxy_to_parent->cross_process_frame_connector()->get_view_for_testing());
306 } 308 }
307 309
308 // It times out on Android, so disabled while investigating. 310 // It times out on Android, so disabled while investigating.
309 // http://crbug.com/399775 311 // http://crbug.com/399775
310 #if defined(OS_ANDROID) 312 #if defined(OS_ANDROID)
311 #define MAYBE_NavigateRemoteFrame DISABLED_NavigateRemoteFrame 313 #define MAYBE_NavigateRemoteFrame DISABLED_NavigateRemoteFrame
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 357
356 // Check again that a new process is created and is different from the 358 // Check again that a new process is created and is different from the
357 // top level one and the previous one. 359 // top level one and the previous one.
358 ASSERT_EQ(2U, root->child_count()); 360 ASSERT_EQ(2U, root->child_count());
359 child = root->child_at(0); 361 child = root->child_at(0);
360 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), 362 EXPECT_NE(shell()->web_contents()->GetSiteInstance(),
361 child->current_frame_host()->GetSiteInstance()); 363 child->current_frame_host()->GetSiteInstance());
362 EXPECT_NE(site_instance, 364 EXPECT_NE(site_instance,
363 child->current_frame_host()->GetSiteInstance()); 365 child->current_frame_host()->GetSiteInstance());
364 366
365 // TODO(japhet): This currently causes an assertion in the renderer process. 367 // TODO(japhet): This currently causes an assertion in the renderer process.
nasko 2014/10/27 22:52:54 The comment is no longer needed if this is indeed
Nate Chapin 2014/10/28 19:59:20 Will update to describe what this block actually d
366 // Enable when the assertion is fixed. 368 // Enable when the assertion is fixed.
367 //NavigateFrameToURL(child, http_url); 369 NavigateFrameToURL(child, http_url);
368 //EXPECT_EQ(http_url, observer.navigation_url()); 370 EXPECT_EQ(http_url, observer.navigation_url());
369 //EXPECT_TRUE(observer.navigation_succeeded()); 371 EXPECT_TRUE(observer.navigation_succeeded());
370 //EXPECT_EQ(shell()->web_contents()->GetSiteInstance(), 372 EXPECT_EQ(shell()->web_contents()->GetSiteInstance(),
371 // child->current_frame_host()->GetSiteInstance()); 373 child->current_frame_host()->GetSiteInstance());
372 } 374 }
373 375
374 // Crash a subframe and ensures its children are cleared from the FrameTree. 376 // Crash a subframe and ensures its children are cleared from the FrameTree.
375 // See http://crbug.com/338508. 377 // See http://crbug.com/338508.
376 // TODO(creis): Disabled for flakiness; see http://crbug.com/405582. 378 // TODO(creis): Disabled for flakiness; see http://crbug.com/405582.
377 // TODO(creis): Enable this on Android when we can kill the process there. 379 // TODO(creis): Enable this on Android when we can kill the process there.
378 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, DISABLED_CrashSubframe) { 380 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, DISABLED_CrashSubframe) {
379 GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); 381 GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html"));
380 NavigateToURL(shell(), main_url); 382 NavigateToURL(shell(), main_url);
381 383
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 } 765 }
764 766
765 navigation_observer.Wait(); 767 navigation_observer.Wait();
766 EXPECT_EQ(cross_site_url, observer.navigation_url()); 768 EXPECT_EQ(cross_site_url, observer.navigation_url());
767 EXPECT_TRUE(observer.navigation_succeeded()); 769 EXPECT_TRUE(observer.navigation_succeeded());
768 EXPECT_EQ(0U, child->child_count()); 770 EXPECT_EQ(0U, child->child_count());
769 } 771 }
770 } 772 }
771 773
772 } // namespace content 774 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698