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/public/test/test_renderer_host.h" | 5 #include "content/public/test/test_renderer_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " | 11 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " |
12 #include "content/browser/frame_host/navigation_entry_impl.h" | 12 #include "content/browser/frame_host/navigation_entry_impl.h" |
13 #include "content/browser/renderer_host/render_view_host_factory.h" | 13 #include "content/browser/renderer_host/render_view_host_factory.h" |
14 #include "content/browser/renderer_host/render_widget_host_impl.h" | 14 #include "content/browser/renderer_host/render_widget_host_impl.h" |
15 #include "content/browser/site_instance_impl.h" | 15 #include "content/browser/site_instance_impl.h" |
16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
18 #include "content/public/common/browser_side_navigation_policy.h" | 18 #include "content/public/common/browser_side_navigation_policy.h" |
19 #include "content/public/test/browser_side_navigation_test_utils.h" | |
19 #include "content/public/test/mock_render_process_host.h" | 20 #include "content/public/test/mock_render_process_host.h" |
20 #include "content/public/test/test_browser_context.h" | 21 #include "content/public/test/test_browser_context.h" |
21 #include "content/test/browser_side_navigation_test_utils.h" | |
22 #include "content/test/content_browser_sanity_checker.h" | 22 #include "content/test/content_browser_sanity_checker.h" |
23 #include "content/test/test_render_frame_host.h" | 23 #include "content/test/test_render_frame_host.h" |
24 #include "content/test/test_render_frame_host_factory.h" | 24 #include "content/test/test_render_frame_host_factory.h" |
25 #include "content/test/test_render_view_host.h" | 25 #include "content/test/test_render_view_host.h" |
26 #include "content/test/test_render_view_host_factory.h" | 26 #include "content/test/test_render_view_host_factory.h" |
27 #include "content/test/test_web_contents.h" | 27 #include "content/test/test_web_contents.h" |
28 #include "ui/base/material_design/material_design_controller.h" | 28 #include "ui/base/material_design/material_design_controller.h" |
29 #include "ui/base/test/material_design_controller_test_api.h" | 29 #include "ui/base/test/material_design_controller_test_api.h" |
30 | 30 |
31 #if defined(OS_ANDROID) | 31 #if defined(OS_ANDROID) |
(...skipping 17 matching lines...) Expand all Loading... | |
49 namespace content { | 49 namespace content { |
50 | 50 |
51 // RenderFrameHostTester ------------------------------------------------------ | 51 // RenderFrameHostTester ------------------------------------------------------ |
52 | 52 |
53 // static | 53 // static |
54 RenderFrameHostTester* RenderFrameHostTester::For(RenderFrameHost* host) { | 54 RenderFrameHostTester* RenderFrameHostTester::For(RenderFrameHost* host) { |
55 return static_cast<TestRenderFrameHost*>(host); | 55 return static_cast<TestRenderFrameHost*>(host); |
56 } | 56 } |
57 | 57 |
58 // static | 58 // static |
59 RenderFrameHost* RenderFrameHostTester::GetPendingForController( | 59 RenderFrameHost* RenderFrameHostTester::GetPendingForController( |
nasko
2016/08/31 18:39:05
Considering that only browser_with_test_window_tes
scottmg
2016/08/31 19:01:46
Ah, I didn't notice it was the only user.
I'm not
scottmg
2016/08/31 19:40:34
Did ... something like that. (maybe?)
| |
60 NavigationController* controller) { | 60 NavigationController* controller) { |
61 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 61 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
62 controller->GetWebContents()); | 62 controller->GetWebContents()); |
63 if (IsBrowserSideNavigationEnabled()) { | |
64 return web_contents->GetRenderManagerForTesting() | |
65 ->speculative_render_frame_host_.get(); | |
66 } | |
63 return web_contents->GetRenderManagerForTesting()->pending_frame_host(); | 67 return web_contents->GetRenderManagerForTesting()->pending_frame_host(); |
64 } | 68 } |
65 | 69 |
66 // RenderViewHostTester ------------------------------------------------------- | 70 // RenderViewHostTester ------------------------------------------------------- |
67 | 71 |
68 // static | 72 // static |
69 RenderViewHostTester* RenderViewHostTester::For(RenderViewHost* host) { | 73 RenderViewHostTester* RenderViewHostTester::For(RenderViewHost* host) { |
70 return static_cast<TestRenderViewHost*>(host); | 74 return static_cast<TestRenderViewHost*>(host); |
71 } | 75 } |
72 | 76 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
278 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { | 282 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { |
279 return new TestBrowserContext(); | 283 return new TestBrowserContext(); |
280 } | 284 } |
281 | 285 |
282 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 286 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
283 RenderProcessHostFactory* factory) { | 287 RenderProcessHostFactory* factory) { |
284 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 288 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
285 } | 289 } |
286 | 290 |
287 } // namespace content | 291 } // namespace content |
OLD | NEW |