| 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 "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "content/browser/frame_host/navigation_entry_impl.h" | 9 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 10 #include "content/browser/renderer_host/render_view_host_factory.h" | 10 #include "content/browser/renderer_host/render_view_host_factory.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 | 44 |
| 45 // static | 45 // static |
| 46 RenderFrameHost* RenderFrameHostTester::GetPendingForController( | 46 RenderFrameHost* RenderFrameHostTester::GetPendingForController( |
| 47 NavigationController* controller) { | 47 NavigationController* controller) { |
| 48 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 48 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
| 49 controller->GetWebContents()); | 49 controller->GetWebContents()); |
| 50 return web_contents->GetRenderManagerForTesting()->pending_frame_host(); | 50 return web_contents->GetRenderManagerForTesting()->pending_frame_host(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 // static | |
| 54 bool RenderFrameHostTester::IsRenderFrameHostSwappedOut(RenderFrameHost* rfh) { | |
| 55 return static_cast<RenderFrameHostImpl*>(rfh)->is_swapped_out(); | |
| 56 } | |
| 57 | |
| 58 // RenderViewHostTester ------------------------------------------------------- | 53 // RenderViewHostTester ------------------------------------------------------- |
| 59 | 54 |
| 60 // static | 55 // static |
| 61 RenderViewHostTester* RenderViewHostTester::For(RenderViewHost* host) { | 56 RenderViewHostTester* RenderViewHostTester::For(RenderViewHost* host) { |
| 62 return static_cast<TestRenderViewHost*>(host); | 57 return static_cast<TestRenderViewHost*>(host); |
| 63 } | 58 } |
| 64 | 59 |
| 65 // static | 60 // static |
| 66 bool RenderViewHostTester::TestOnMessageReceived(RenderViewHost* rvh, | 61 bool RenderViewHostTester::TestOnMessageReceived(RenderViewHost* rvh, |
| 67 const IPC::Message& msg) { | 62 const IPC::Message& msg) { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { | 239 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { |
| 245 return new TestBrowserContext(); | 240 return new TestBrowserContext(); |
| 246 } | 241 } |
| 247 | 242 |
| 248 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 243 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
| 249 RenderProcessHostFactory* factory) { | 244 RenderProcessHostFactory* factory) { |
| 250 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 245 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
| 251 } | 246 } |
| 252 | 247 |
| 253 } // namespace content | 248 } // namespace content |
| OLD | NEW |