OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 64 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
65 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 65 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
66 | 66 |
67 // Attaches the factory object so we can remove this object in its destructor | 67 // Attaches the factory object so we can remove this object in its destructor |
68 // and prevent MockRenderProcessHostFacotry from deleting it. | 68 // and prevent MockRenderProcessHostFacotry from deleting it. |
69 void SetFactory(const MockRenderProcessHostFactory* factory) { | 69 void SetFactory(const MockRenderProcessHostFactory* factory) { |
70 factory_ = factory; | 70 factory_ = factory; |
71 } | 71 } |
72 | 72 |
73 private: | 73 private: |
| 74 virtual bool IsSuitableHost(const GURL& site_url) OVERRIDE; |
| 75 |
74 // Stores IPC messages that would have been sent to the renderer. | 76 // Stores IPC messages that would have been sent to the renderer. |
75 IPC::TestSink sink_; | 77 IPC::TestSink sink_; |
76 TransportDIB* transport_dib_; | 78 TransportDIB* transport_dib_; |
77 int bad_msg_count_; | 79 int bad_msg_count_; |
78 const MockRenderProcessHostFactory* factory_; | 80 const MockRenderProcessHostFactory* factory_; |
79 | 81 |
80 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHost); | 82 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHost); |
81 }; | 83 }; |
82 | 84 |
83 class MockRenderProcessHostFactory : public RenderProcessHostFactory { | 85 class MockRenderProcessHostFactory : public RenderProcessHostFactory { |
(...skipping 12 matching lines...) Expand all Loading... |
96 private: | 98 private: |
97 // A list of MockRenderProcessHosts created by this object. This list is used | 99 // A list of MockRenderProcessHosts created by this object. This list is used |
98 // for deleting all MockRenderProcessHosts that have not deleted by a test in | 100 // for deleting all MockRenderProcessHosts that have not deleted by a test in |
99 // the destructor and prevent them from being leaked. | 101 // the destructor and prevent them from being leaked. |
100 mutable ScopedVector<MockRenderProcessHost> processes_; | 102 mutable ScopedVector<MockRenderProcessHost> processes_; |
101 | 103 |
102 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); | 104 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); |
103 }; | 105 }; |
104 | 106 |
105 #endif // CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ | 107 #endif // CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ |
OLD | NEW |