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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 namespace content { | 52 namespace content { |
53 | 53 |
54 // RenderFrameHostTester ------------------------------------------------------ | 54 // RenderFrameHostTester ------------------------------------------------------ |
55 | 55 |
56 // static | 56 // static |
57 RenderFrameHostTester* RenderFrameHostTester::For(RenderFrameHost* host) { | 57 RenderFrameHostTester* RenderFrameHostTester::For(RenderFrameHost* host) { |
58 return static_cast<TestRenderFrameHost*>(host); | 58 return static_cast<TestRenderFrameHost*>(host); |
59 } | 59 } |
60 | 60 |
61 // static | 61 // static |
| 62 bool RenderFrameHostTester::TestOnMessageReceived(RenderFrameHost* rfh, |
| 63 const IPC::Message& msg) { |
| 64 return static_cast<RenderFrameHostImpl*>(rfh)->OnMessageReceived(msg); |
| 65 } |
| 66 |
| 67 // static |
62 void RenderFrameHostTester::CommitPendingLoad( | 68 void RenderFrameHostTester::CommitPendingLoad( |
63 NavigationController* controller) { | 69 NavigationController* controller) { |
64 // This function is currently used by BrowserWithTestWindowTest. It would be | 70 // This function is currently used by BrowserWithTestWindowTest. It would be |
65 // ideal to instead make the users of that class create TestWebContents | 71 // ideal to instead make the users of that class create TestWebContents |
66 // (rather than WebContentsImpl directly). This would allow the implementation | 72 // (rather than WebContentsImpl directly). This would allow the implementation |
67 // of PrepareForCommitIfNecessary() to live directly in | 73 // of PrepareForCommitIfNecessary() to live directly in |
68 // TestWebContents::CommitPendingNavigation() which could then be the only | 74 // TestWebContents::CommitPendingNavigation() which could then be the only |
69 // place to handle this simulation. Unfortunately, it is not trivial to make | 75 // place to handle this simulation. Unfortunately, it is not trivial to make |
70 // that change, so for now we have this extra simulation for | 76 // that change, so for now we have this extra simulation for |
71 // non-TestWebContents. | 77 // non-TestWebContents. |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 336 |
331 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 337 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
332 RenderProcessHostFactory* factory) { | 338 RenderProcessHostFactory* factory) { |
333 if (rvh_test_enabler_) | 339 if (rvh_test_enabler_) |
334 rvh_test_enabler_->rvh_factory_->set_render_process_host_factory(factory); | 340 rvh_test_enabler_->rvh_factory_->set_render_process_host_factory(factory); |
335 else | 341 else |
336 factory_ = factory; | 342 factory_ = factory; |
337 } | 343 } |
338 | 344 |
339 } // namespace content | 345 } // namespace content |
OLD | NEW |