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