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 #ifndef CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ |
6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 29 matching lines...) Expand all Loading... | |
40 virtual void RemoveRoute(int32 routing_id) OVERRIDE; | 40 virtual void RemoveRoute(int32 routing_id) OVERRIDE; |
41 virtual void AddObserver(RenderProcessHostObserver* observer) OVERRIDE; | 41 virtual void AddObserver(RenderProcessHostObserver* observer) OVERRIDE; |
42 virtual void RemoveObserver(RenderProcessHostObserver* observer) OVERRIDE; | 42 virtual void RemoveObserver(RenderProcessHostObserver* observer) OVERRIDE; |
43 virtual bool WaitForBackingStoreMsg(int render_widget_id, | 43 virtual bool WaitForBackingStoreMsg(int render_widget_id, |
44 const base::TimeDelta& max_delay, | 44 const base::TimeDelta& max_delay, |
45 IPC::Message* msg) OVERRIDE; | 45 IPC::Message* msg) OVERRIDE; |
46 virtual void ReceivedBadMessage() OVERRIDE; | 46 virtual void ReceivedBadMessage() OVERRIDE; |
47 virtual void WidgetRestored() OVERRIDE; | 47 virtual void WidgetRestored() OVERRIDE; |
48 virtual void WidgetHidden() OVERRIDE; | 48 virtual void WidgetHidden() OVERRIDE; |
49 virtual int VisibleWidgetCount() const OVERRIDE; | 49 virtual int VisibleWidgetCount() const OVERRIDE; |
50 virtual bool IsGuest() const OVERRIDE; | 50 virtual bool IsIsolatedGuest() const OVERRIDE; |
51 virtual StoragePartition* GetStoragePartition() const OVERRIDE; | 51 virtual StoragePartition* GetStoragePartition() const OVERRIDE; |
52 virtual void AddWord(const base::string16& word); | 52 virtual void AddWord(const base::string16& word); |
53 virtual bool FastShutdownIfPossible() OVERRIDE; | 53 virtual bool FastShutdownIfPossible() OVERRIDE; |
54 virtual bool FastShutdownStarted() const OVERRIDE; | 54 virtual bool FastShutdownStarted() const OVERRIDE; |
55 virtual void DumpHandles() OVERRIDE; | 55 virtual void DumpHandles() OVERRIDE; |
56 virtual base::ProcessHandle GetHandle() const OVERRIDE; | 56 virtual base::ProcessHandle GetHandle() const OVERRIDE; |
57 virtual int GetID() const OVERRIDE; | 57 virtual int GetID() const OVERRIDE; |
58 virtual bool HasConnection() const OVERRIDE; | 58 virtual bool HasConnection() const OVERRIDE; |
59 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; | 59 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; |
60 virtual bool IgnoreInputEvents() const OVERRIDE; | 60 virtual bool IgnoreInputEvents() const OVERRIDE; |
(...skipping 29 matching lines...) Expand all Loading... | |
90 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 90 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
91 | 91 |
92 // Attaches the factory object so we can remove this object in its destructor | 92 // Attaches the factory object so we can remove this object in its destructor |
93 // and prevent MockRenderProcessHostFacotry from deleting it. | 93 // and prevent MockRenderProcessHostFacotry from deleting it. |
94 void SetFactory(const MockRenderProcessHostFactory* factory) { | 94 void SetFactory(const MockRenderProcessHostFactory* factory) { |
95 factory_ = factory; | 95 factory_ = factory; |
96 } | 96 } |
97 | 97 |
98 int GetActiveViewCount(); | 98 int GetActiveViewCount(); |
99 | 99 |
100 void SetIsGuest(bool is_guest) { | 100 void SetIsIsolatedGuest(bool is_guest) { |
lazyboy
2014/05/27 19:22:22
Since this is direct setter, should be set_is_isol
Fady Samuel
2014/05/27 21:56:34
It looks like this isn't even used. I've removed i
| |
101 is_guest_ = is_guest; | 101 is_isolated_guest_ = is_guest; |
102 } | 102 } |
103 | 103 |
104 private: | 104 private: |
105 // Stores IPC messages that would have been sent to the renderer. | 105 // Stores IPC messages that would have been sent to the renderer. |
106 IPC::TestSink sink_; | 106 IPC::TestSink sink_; |
107 int bad_msg_count_; | 107 int bad_msg_count_; |
108 const MockRenderProcessHostFactory* factory_; | 108 const MockRenderProcessHostFactory* factory_; |
109 int id_; | 109 int id_; |
110 BrowserContext* browser_context_; | 110 BrowserContext* browser_context_; |
111 ObserverList<RenderProcessHostObserver> observers_; | 111 ObserverList<RenderProcessHostObserver> observers_; |
112 | 112 |
113 IDMap<RenderWidgetHost> render_widget_hosts_; | 113 IDMap<RenderWidgetHost> render_widget_hosts_; |
114 int prev_routing_id_; | 114 int prev_routing_id_; |
115 IDMap<IPC::Listener> listeners_; | 115 IDMap<IPC::Listener> listeners_; |
116 bool fast_shutdown_started_; | 116 bool fast_shutdown_started_; |
117 bool deletion_callback_called_; | 117 bool deletion_callback_called_; |
118 bool is_guest_; | 118 bool is_isolated_guest_; |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHost); | 120 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHost); |
121 }; | 121 }; |
122 | 122 |
123 class MockRenderProcessHostFactory : public RenderProcessHostFactory { | 123 class MockRenderProcessHostFactory : public RenderProcessHostFactory { |
124 public: | 124 public: |
125 MockRenderProcessHostFactory(); | 125 MockRenderProcessHostFactory(); |
126 virtual ~MockRenderProcessHostFactory(); | 126 virtual ~MockRenderProcessHostFactory(); |
127 | 127 |
128 virtual RenderProcessHost* CreateRenderProcessHost( | 128 virtual RenderProcessHost* CreateRenderProcessHost( |
(...skipping 10 matching lines...) Expand all Loading... | |
139 // for deleting all MockRenderProcessHosts that have not deleted by a test in | 139 // for deleting all MockRenderProcessHosts that have not deleted by a test in |
140 // the destructor and prevent them from being leaked. | 140 // the destructor and prevent them from being leaked. |
141 mutable ScopedVector<MockRenderProcessHost> processes_; | 141 mutable ScopedVector<MockRenderProcessHost> processes_; |
142 | 142 |
143 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); | 143 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); |
144 }; | 144 }; |
145 | 145 |
146 } // namespace content | 146 } // namespace content |
147 | 147 |
148 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ | 148 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ |
OLD | NEW |