| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "chrome/browser/renderer_host/render_process_host.h" | 9 #include "chrome/browser/renderer_host/render_process_host.h" |
| 10 #include "chrome/common/ipc_test_sink.h" | 10 #include "chrome/common/ipc_test_sink.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 virtual bool FastShutdownIfPossible(); | 37 virtual bool FastShutdownIfPossible(); |
| 38 | 38 |
| 39 // IPC::Channel::Sender via RenderProcessHost. | 39 // IPC::Channel::Sender via RenderProcessHost. |
| 40 virtual bool Send(IPC::Message* msg); | 40 virtual bool Send(IPC::Message* msg); |
| 41 | 41 |
| 42 // IPC::Channel::Listener via RenderProcessHost. | 42 // IPC::Channel::Listener via RenderProcessHost. |
| 43 virtual void OnMessageReceived(const IPC::Message& msg); | 43 virtual void OnMessageReceived(const IPC::Message& msg); |
| 44 virtual void OnChannelConnected(int32 peer_pid); | 44 virtual void OnChannelConnected(int32 peer_pid); |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // RenderProcessHost implementation (protected portion). | |
| 48 virtual void Unregister(); | |
| 49 | |
| 50 // Stores IPC messages that would have been sent to the renderer. | 47 // Stores IPC messages that would have been sent to the renderer. |
| 51 IPC::TestSink sink_; | 48 IPC::TestSink sink_; |
| 52 | 49 |
| 53 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHost); | 50 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHost); |
| 54 }; | 51 }; |
| 55 | 52 |
| 53 class MockRenderProcessHostFactory : public RenderProcessHostFactory { |
| 54 public: |
| 55 virtual ~MockRenderProcessHostFactory() {} |
| 56 virtual RenderProcessHost* CreateRenderProcessHost( |
| 57 Profile* profile) const { |
| 58 return new MockRenderProcessHost(profile); |
| 59 } |
| 60 }; |
| 61 |
| 56 #endif // CHROME_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ | 62 #endif // CHROME_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ |
| OLD | NEW |