| 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/test/test_renderer_host.h" | 5 #include "content/test/test_renderer_host.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/render_view_host_factory.h" | 7 #include "content/browser/renderer_host/render_view_host_factory.h" |
| 8 #include "content/browser/renderer_host/test_render_view_host.h" | 8 #include "content/browser/renderer_host/test_render_view_host.h" |
| 9 #include "content/browser/site_instance_impl.h" | 9 #include "content/browser/site_instance_impl.h" |
| 10 #include "content/browser/tab_contents/navigation_entry_impl.h" | 10 #include "content/browser/tab_contents/navigation_entry_impl.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 TabContents* tab_contents = static_cast<TabContents*>( | 100 TabContents* tab_contents = static_cast<TabContents*>( |
| 101 controller->GetWebContents()); | 101 controller->GetWebContents()); |
| 102 return tab_contents->GetRenderManagerForTesting()->pending_render_view_host(); | 102 return tab_contents->GetRenderManagerForTesting()->pending_render_view_host(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 // static | 105 // static |
| 106 bool RenderViewHostTester::IsRenderViewHostSwappedOut(RenderViewHost* rvh) { | 106 bool RenderViewHostTester::IsRenderViewHostSwappedOut(RenderViewHost* rvh) { |
| 107 return static_cast<RenderViewHostImpl*>(rvh)->is_swapped_out(); | 107 return static_cast<RenderViewHostImpl*>(rvh)->is_swapped_out(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 // static |
| 111 bool RenderViewHostTester::TestOnMessageReceived(RenderViewHost* rvh, |
| 112 const IPC::Message& msg) { |
| 113 return static_cast<RenderViewHostImpl*>(rvh)->OnMessageReceived(msg); |
| 114 } |
| 115 |
| 110 RenderViewHostTestEnabler::RenderViewHostTestEnabler() | 116 RenderViewHostTestEnabler::RenderViewHostTestEnabler() |
| 111 : rph_factory_(new MockRenderProcessHostFactory()), | 117 : rph_factory_(new MockRenderProcessHostFactory()), |
| 112 rvh_factory_(new TestRenderViewHostFactory(rph_factory_.get())) { | 118 rvh_factory_(new TestRenderViewHostFactory(rph_factory_.get())) { |
| 113 } | 119 } |
| 114 | 120 |
| 115 RenderViewHostTestEnabler::~RenderViewHostTestEnabler() { | 121 RenderViewHostTestEnabler::~RenderViewHostTestEnabler() { |
| 116 } | 122 } |
| 117 | 123 |
| 118 RenderViewHostTestHarness::RenderViewHostTestHarness() | 124 RenderViewHostTestHarness::RenderViewHostTestHarness() |
| 119 : contents_(NULL) { | 125 : contents_(NULL) { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); | 213 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); |
| 208 message_loop_.RunAllPending(); | 214 message_loop_.RunAllPending(); |
| 209 } | 215 } |
| 210 | 216 |
| 211 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 217 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
| 212 RenderProcessHostFactory* factory) { | 218 RenderProcessHostFactory* factory) { |
| 213 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 219 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
| 214 } | 220 } |
| 215 | 221 |
| 216 } // namespace content | 222 } // namespace content |
| OLD | NEW |