| 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 27 matching lines...) Expand all Loading... |
| 38 // static | 38 // static |
| 39 RenderViewHost* RenderViewHostTester::GetPendingForController( | 39 RenderViewHost* RenderViewHostTester::GetPendingForController( |
| 40 NavigationController* controller) { | 40 NavigationController* controller) { |
| 41 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 41 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
| 42 controller->GetWebContents()); | 42 controller->GetWebContents()); |
| 43 return web_contents->GetRenderManagerForTesting()->pending_render_view_host(); | 43 return web_contents->GetRenderManagerForTesting()->pending_render_view_host(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 // static | 46 // static |
| 47 bool RenderViewHostTester::IsRenderViewHostSwappedOut(RenderViewHost* rvh) { | 47 bool RenderViewHostTester::IsRenderViewHostSwappedOut(RenderViewHost* rvh) { |
| 48 return static_cast<RenderViewHostImpl*>(rvh)->is_swapped_out(); | 48 return static_cast<RenderViewHostImpl*>(rvh)->rvh_state() == |
| 49 RenderViewHostImpl::STATE_SWAPPED_OUT; |
| 49 } | 50 } |
| 50 | 51 |
| 51 // static | 52 // static |
| 52 bool RenderViewHostTester::TestOnMessageReceived(RenderViewHost* rvh, | 53 bool RenderViewHostTester::TestOnMessageReceived(RenderViewHost* rvh, |
| 53 const IPC::Message& msg) { | 54 const IPC::Message& msg) { |
| 54 return static_cast<RenderViewHostImpl*>(rvh)->OnMessageReceived(msg); | 55 return static_cast<RenderViewHostImpl*>(rvh)->OnMessageReceived(msg); |
| 55 } | 56 } |
| 56 | 57 |
| 57 // static | 58 // static |
| 58 bool RenderViewHostTester::HasTouchEventHandler(RenderViewHost* rvh) { | 59 bool RenderViewHostTester::HasTouchEventHandler(RenderViewHost* rvh) { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { | 208 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { |
| 208 return new TestBrowserContext(); | 209 return new TestBrowserContext(); |
| 209 } | 210 } |
| 210 | 211 |
| 211 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 212 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
| 212 RenderProcessHostFactory* factory) { | 213 RenderProcessHostFactory* factory) { |
| 213 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 214 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
| 214 } | 215 } |
| 215 | 216 |
| 216 } // namespace content | 217 } // namespace content |
| OLD | NEW |