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 "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "content/browser/frame_host/navigation_entry_impl.h" | 8 #include "content/browser/frame_host/navigation_entry_impl.h" |
9 #include "content/browser/renderer_host/render_view_host_factory.h" | 9 #include "content/browser/renderer_host/render_view_host_factory.h" |
10 #include "content/browser/renderer_host/render_widget_host_impl.h" | 10 #include "content/browser/renderer_host/render_widget_host_impl.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 RenderViewHost* RenderViewHostTestHarness::pending_rvh() { | 95 RenderViewHost* RenderViewHostTestHarness::pending_rvh() { |
96 return static_cast<TestWebContents*>(web_contents())-> | 96 return static_cast<TestWebContents*>(web_contents())-> |
97 GetRenderManagerForTesting()->pending_render_view_host(); | 97 GetRenderManagerForTesting()->pending_render_view_host(); |
98 } | 98 } |
99 | 99 |
100 RenderViewHost* RenderViewHostTestHarness::active_rvh() { | 100 RenderViewHost* RenderViewHostTestHarness::active_rvh() { |
101 return pending_rvh() ? pending_rvh() : rvh(); | 101 return pending_rvh() ? pending_rvh() : rvh(); |
102 } | 102 } |
103 | 103 |
| 104 RenderFrameHost* RenderViewHostTestHarness::main_rfh() { |
| 105 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
| 106 this->web_contents()); |
| 107 return web_contents->GetFrameTree()->GetMainFrame(); |
| 108 } |
| 109 |
104 BrowserContext* RenderViewHostTestHarness::browser_context() { | 110 BrowserContext* RenderViewHostTestHarness::browser_context() { |
105 return browser_context_.get(); | 111 return browser_context_.get(); |
106 } | 112 } |
107 | 113 |
108 MockRenderProcessHost* RenderViewHostTestHarness::process() { | 114 MockRenderProcessHost* RenderViewHostTestHarness::process() { |
109 return static_cast<MockRenderProcessHost*>(active_rvh()->GetProcess()); | 115 return static_cast<MockRenderProcessHost*>(active_rvh()->GetProcess()); |
110 } | 116 } |
111 | 117 |
112 void RenderViewHostTestHarness::DeleteContents() { | 118 void RenderViewHostTestHarness::DeleteContents() { |
113 SetContents(NULL); | 119 SetContents(NULL); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { | 206 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { |
201 return new TestBrowserContext(); | 207 return new TestBrowserContext(); |
202 } | 208 } |
203 | 209 |
204 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 210 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
205 RenderProcessHostFactory* factory) { | 211 RenderProcessHostFactory* factory) { |
206 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 212 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
207 } | 213 } |
208 | 214 |
209 } // namespace content | 215 } // namespace content |
OLD | NEW |