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 <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/location.h" | |
12 #include "base/single_thread_task_runner.h" | |
13 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
14 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
15 #include "base/thread_task_runner_handle.h" | |
16 #include "content/browser/frame_host/cross_process_frame_connector.h" | 13 #include "content/browser/frame_host/cross_process_frame_connector.h" |
17 #include "content/browser/frame_host/frame_tree.h" | 14 #include "content/browser/frame_host/frame_tree.h" |
18 #include "content/browser/frame_host/navigator.h" | 15 #include "content/browser/frame_host/navigator.h" |
19 #include "content/browser/frame_host/render_frame_proxy_host.h" | 16 #include "content/browser/frame_host/render_frame_proxy_host.h" |
20 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 17 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
21 #include "content/browser/renderer_host/render_view_host_impl.h" | 18 #include "content/browser/renderer_host/render_view_host_impl.h" |
22 #include "content/browser/web_contents/web_contents_impl.h" | 19 #include "content/browser/web_contents/web_contents_impl.h" |
23 #include "content/common/frame_messages.h" | 20 #include "content/common/frame_messages.h" |
24 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
25 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), | 424 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), |
428 child_node->current_frame_host()->GetSiteInstance()); | 425 child_node->current_frame_host()->GetSiteInstance()); |
429 RenderWidgetHostViewBase* rwhv_base = static_cast<RenderWidgetHostViewBase*>( | 426 RenderWidgetHostViewBase* rwhv_base = static_cast<RenderWidgetHostViewBase*>( |
430 child_node->current_frame_host()->GetRenderWidgetHost()->GetView()); | 427 child_node->current_frame_host()->GetRenderWidgetHost()->GetView()); |
431 | 428 |
432 // Wait for OnSwapCompositorFrame message. | 429 // Wait for OnSwapCompositorFrame message. |
433 while (rwhv_base->RendererFrameNumber() <= 0) { | 430 while (rwhv_base->RendererFrameNumber() <= 0) { |
434 // TODO(lazyboy): Find a better way to avoid sleeping like this. See | 431 // TODO(lazyboy): Find a better way to avoid sleeping like this. See |
435 // http://crbug.com/405282 for details. | 432 // http://crbug.com/405282 for details. |
436 base::RunLoop run_loop; | 433 base::RunLoop run_loop; |
437 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 434 base::MessageLoop::current()->PostDelayedTask( |
438 FROM_HERE, run_loop.QuitClosure(), | 435 FROM_HERE, run_loop.QuitClosure(), |
439 base::TimeDelta::FromMilliseconds(10)); | 436 base::TimeDelta::FromMilliseconds(10)); |
440 run_loop.Run(); | 437 run_loop.Run(); |
441 } | 438 } |
442 } | 439 } |
443 | 440 |
444 // Ensure that OOPIFs are deleted after navigating to a new main frame. | 441 // Ensure that OOPIFs are deleted after navigating to a new main frame. |
445 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CleanupCrossSiteIframe) { | 442 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CleanupCrossSiteIframe) { |
446 GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); | 443 GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); |
447 NavigateToURL(shell(), main_url); | 444 NavigateToURL(shell(), main_url); |
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2531 " |--Site A\n" | 2528 " |--Site A\n" |
2532 " +--Site A\n" | 2529 " +--Site A\n" |
2533 " |--Site A\n" | 2530 " |--Site A\n" |
2534 " +--Site A\n" | 2531 " +--Site A\n" |
2535 " +--Site A\n" | 2532 " +--Site A\n" |
2536 "Where A = http://127.0.0.1/", | 2533 "Where A = http://127.0.0.1/", |
2537 DepictFrameTree(root)); | 2534 DepictFrameTree(root)); |
2538 } | 2535 } |
2539 | 2536 |
2540 } // namespace content | 2537 } // namespace content |
OLD | NEW |