| OLD | NEW |
| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 child->current_frame_host()->GetSiteInstance()); | 286 child->current_frame_host()->GetSiteInstance()); |
| 287 EXPECT_NE(shell()->web_contents()->GetRenderProcessHost(), | 287 EXPECT_NE(shell()->web_contents()->GetRenderProcessHost(), |
| 288 child->current_frame_host()->GetProcess()); | 288 child->current_frame_host()->GetProcess()); |
| 289 EXPECT_NE(rph, child->current_frame_host()->GetProcess()); | 289 EXPECT_NE(rph, child->current_frame_host()->GetProcess()); |
| 290 { | 290 { |
| 291 std::set<RenderWidgetHostView*> views_set = | 291 std::set<RenderWidgetHostView*> views_set = |
| 292 static_cast<WebContentsImpl*>(shell()->web_contents()) | 292 static_cast<WebContentsImpl*>(shell()->web_contents()) |
| 293 ->GetRenderWidgetHostViewsInTree(); | 293 ->GetRenderWidgetHostViewsInTree(); |
| 294 EXPECT_EQ(2U, views_set.size()); | 294 EXPECT_EQ(2U, views_set.size()); |
| 295 } | 295 } |
| 296 EXPECT_EQ(proxy_to_parent, child->render_manager()->GetProxyToParent()); | 296 EXPECT_NE(proxy_to_parent, child->render_manager()->GetProxyToParent()); |
| 297 proxy_to_parent = child->render_manager()->GetProxyToParent(); |
| 298 EXPECT_TRUE(proxy_to_parent); |
| 297 EXPECT_TRUE(proxy_to_parent->cross_process_frame_connector()); | 299 EXPECT_TRUE(proxy_to_parent->cross_process_frame_connector()); |
| 298 EXPECT_EQ( | 300 EXPECT_EQ( |
| 299 child->current_frame_host()->render_view_host()->GetView(), | 301 child->current_frame_host()->render_view_host()->GetView(), |
| 300 proxy_to_parent->cross_process_frame_connector()->get_view_for_testing()); | 302 proxy_to_parent->cross_process_frame_connector()->get_view_for_testing()); |
| 301 } | 303 } |
| 302 | 304 |
| 303 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, NavigateRemoteFrame) { | 305 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, NavigateRemoteFrame) { |
| 304 GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); | 306 GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); |
| 305 NavigateToURL(shell(), main_url); | 307 NavigateToURL(shell(), main_url); |
| 306 | 308 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 | 345 |
| 344 // Check again that a new process is created and is different from the | 346 // Check again that a new process is created and is different from the |
| 345 // top level one and the previous one. | 347 // top level one and the previous one. |
| 346 ASSERT_EQ(2U, root->child_count()); | 348 ASSERT_EQ(2U, root->child_count()); |
| 347 child = root->child_at(0); | 349 child = root->child_at(0); |
| 348 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), | 350 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), |
| 349 child->current_frame_host()->GetSiteInstance()); | 351 child->current_frame_host()->GetSiteInstance()); |
| 350 EXPECT_NE(site_instance, | 352 EXPECT_NE(site_instance, |
| 351 child->current_frame_host()->GetSiteInstance()); | 353 child->current_frame_host()->GetSiteInstance()); |
| 352 | 354 |
| 353 // TODO(japhet): This currently causes an assertion in the renderer process. | 355 // Navigate back to the parent's origin and ensure we return to the |
| 354 // Enable when the assertion is fixed. | 356 // parent's process. |
| 355 //NavigateFrameToURL(child, http_url); | 357 NavigateFrameToURL(child, http_url); |
| 356 //EXPECT_EQ(http_url, observer.navigation_url()); | 358 EXPECT_EQ(http_url, observer.navigation_url()); |
| 357 //EXPECT_TRUE(observer.navigation_succeeded()); | 359 EXPECT_TRUE(observer.navigation_succeeded()); |
| 358 //EXPECT_EQ(shell()->web_contents()->GetSiteInstance(), | 360 EXPECT_EQ(shell()->web_contents()->GetSiteInstance(), |
| 359 // child->current_frame_host()->GetSiteInstance()); | 361 child->current_frame_host()->GetSiteInstance()); |
| 360 } | 362 } |
| 361 | 363 |
| 362 // Crash a subframe and ensures its children are cleared from the FrameTree. | 364 // Crash a subframe and ensures its children are cleared from the FrameTree. |
| 363 // See http://crbug.com/338508. | 365 // See http://crbug.com/338508. |
| 364 // TODO(creis): Disabled for flakiness; see http://crbug.com/405582. | 366 // TODO(creis): Disabled for flakiness; see http://crbug.com/405582. |
| 365 // TODO(creis): Enable this on Android when we can kill the process there. | 367 // TODO(creis): Enable this on Android when we can kill the process there. |
| 366 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, DISABLED_CrashSubframe) { | 368 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, DISABLED_CrashSubframe) { |
| 367 GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); | 369 GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); |
| 368 NavigateToURL(shell(), main_url); | 370 NavigateToURL(shell(), main_url); |
| 369 | 371 |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 } | 751 } |
| 750 | 752 |
| 751 navigation_observer.Wait(); | 753 navigation_observer.Wait(); |
| 752 EXPECT_EQ(cross_site_url, observer.navigation_url()); | 754 EXPECT_EQ(cross_site_url, observer.navigation_url()); |
| 753 EXPECT_TRUE(observer.navigation_succeeded()); | 755 EXPECT_TRUE(observer.navigation_succeeded()); |
| 754 EXPECT_EQ(0U, child->child_count()); | 756 EXPECT_EQ(0U, child->child_count()); |
| 755 } | 757 } |
| 756 } | 758 } |
| 757 | 759 |
| 758 } // namespace content | 760 } // namespace content |
| OLD | NEW |