Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: chromeos/dbus/mock_dbus_thread_manager_without_gmock.cc

Issue 14392007: dbus: Use stubs for some clients and utils for MockDBusThreadManagerWithoutGMock (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/dbus/mock_dbus_thread_manager_without_gmock.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chromeos/dbus/mock_dbus_thread_manager_without_gmock.h" 5 #include "chromeos/dbus/mock_dbus_thread_manager_without_gmock.h"
6 6
7 #include "chromeos/dbus/bluetooth_adapter_client.h"
8 #include "chromeos/dbus/bluetooth_device_client.h"
9 #include "chromeos/dbus/bluetooth_manager_client.h"
7 #include "chromeos/dbus/dbus_thread_manager_observer.h" 10 #include "chromeos/dbus/dbus_thread_manager_observer.h"
8 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" 11 #include "chromeos/dbus/fake_bluetooth_adapter_client.h"
9 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" 12 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h"
10 #include "chromeos/dbus/fake_bluetooth_device_client.h" 13 #include "chromeos/dbus/fake_bluetooth_device_client.h"
11 #include "chromeos/dbus/fake_bluetooth_input_client.h" 14 #include "chromeos/dbus/fake_bluetooth_input_client.h"
12 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h" 15 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h"
13 #include "chromeos/dbus/fake_cros_disks_client.h" 16 #include "chromeos/dbus/fake_cros_disks_client.h"
17 #include "chromeos/dbus/fake_power_manager_client.h"
18 #include "chromeos/dbus/fake_update_engine_client.h"
14 #include "chromeos/dbus/ibus/mock_ibus_client.h" 19 #include "chromeos/dbus/ibus/mock_ibus_client.h"
15 #include "chromeos/dbus/ibus/mock_ibus_config_client.h" 20 #include "chromeos/dbus/ibus/mock_ibus_config_client.h"
16 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h" 21 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h"
17 #include "chromeos/dbus/ibus/mock_ibus_engine_service.h" 22 #include "chromeos/dbus/ibus/mock_ibus_engine_service.h"
18 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h" 23 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h"
19 #include "chromeos/dbus/ibus/mock_ibus_panel_service.h" 24 #include "chromeos/dbus/ibus/mock_ibus_panel_service.h"
25 #include "chromeos/dbus/image_burner_client.h"
26 #include "chromeos/dbus/power_policy_controller.h"
27 #include "chromeos/dbus/session_manager_client.h"
28 #include "chromeos/dbus/system_clock_client.h"
20 29
21 namespace chromeos { 30 namespace chromeos {
22 31
23 MockDBusThreadManagerWithoutGMock::MockDBusThreadManagerWithoutGMock() 32 MockDBusThreadManagerWithoutGMock::MockDBusThreadManagerWithoutGMock()
24 : fake_bluetooth_adapter_client_(new FakeBluetoothAdapterClient()), 33 : fake_bluetooth_adapter_client_(new FakeBluetoothAdapterClient()),
25 fake_bluetooth_agent_manager_client_(new FakeBluetoothAgentManagerClient()), 34 fake_bluetooth_agent_manager_client_(new FakeBluetoothAgentManagerClient()),
26 fake_bluetooth_device_client_(new FakeBluetoothDeviceClient()), 35 fake_bluetooth_device_client_(new FakeBluetoothDeviceClient()),
27 fake_bluetooth_input_client_(new FakeBluetoothInputClient()), 36 fake_bluetooth_input_client_(new FakeBluetoothInputClient()),
28 fake_bluetooth_profile_manager_client_( 37 fake_bluetooth_profile_manager_client_(
29 new FakeBluetoothProfileManagerClient()), 38 new FakeBluetoothProfileManagerClient()),
30 fake_cros_disks_client_(new FakeCrosDisksClient), 39 fake_cros_disks_client_(new FakeCrosDisksClient),
40 fake_power_manager_client_(new FakePowerManagerClient),
41 fake_update_engine_client_(new FakeUpdateEngineClient),
31 mock_ibus_client_(new MockIBusClient), 42 mock_ibus_client_(new MockIBusClient),
43 mock_ibus_config_client_(new MockIBusConfigClient),
32 mock_ibus_input_context_client_(new MockIBusInputContextClient), 44 mock_ibus_input_context_client_(new MockIBusInputContextClient),
45 mock_ibus_panel_service_(new MockIBusPanelService),
46 stub_bluetooth_manager_client_(
47 BluetoothManagerClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL)),
48 stub_bluetooth_adapter_client_(
49 BluetoothAdapterClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL,
50 stub_bluetooth_manager_client_.get())),
51 stub_bluetooth_device_client_(
52 BluetoothDeviceClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL,
53 stub_bluetooth_adapter_client_.get())),
54 stub_image_burner_client_(
55 ImageBurnerClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL)),
56 stub_session_manager_client_(
57 SessionManagerClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL)),
58 stub_system_clock_client_(
59 SystemClockClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL)),
satorux1 2013/04/25 07:42:03 using stubs sounds may be questionable. for now, c
Haruki Sato 2013/04/25 07:51:47 Do you mean we can add them when necessary? or Are
satorux1 2013/04/25 07:57:03 For the new bluetooth code, keybuk@ stopped provid
33 ibus_bus_(NULL) { 60 ibus_bus_(NULL) {
61 power_policy_controller_.reset(
62 new PowerPolicyController(this, fake_power_manager_client_.get()));
34 } 63 }
35 64
36 MockDBusThreadManagerWithoutGMock::~MockDBusThreadManagerWithoutGMock() { 65 MockDBusThreadManagerWithoutGMock::~MockDBusThreadManagerWithoutGMock() {
37 FOR_EACH_OBSERVER(DBusThreadManagerObserver, observers_, 66 FOR_EACH_OBSERVER(DBusThreadManagerObserver, observers_,
38 OnDBusThreadManagerDestroying(this)); 67 OnDBusThreadManagerDestroying(this));
39 } 68 }
40 69
41 void MockDBusThreadManagerWithoutGMock::AddObserver( 70 void MockDBusThreadManagerWithoutGMock::AddObserver(
42 DBusThreadManagerObserver* observer) { 71 DBusThreadManagerObserver* observer) {
43 DCHECK(observer); 72 DCHECK(observer);
(...skipping 16 matching lines...) Expand all
60 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetSystemBus() { 89 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetSystemBus() {
61 return NULL; 90 return NULL;
62 } 91 }
63 92
64 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetIBusBus() { 93 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetIBusBus() {
65 return ibus_bus_; 94 return ibus_bus_;
66 } 95 }
67 96
68 BluetoothAdapterClient* 97 BluetoothAdapterClient*
69 MockDBusThreadManagerWithoutGMock::GetBluetoothAdapterClient() { 98 MockDBusThreadManagerWithoutGMock::GetBluetoothAdapterClient() {
70 NOTIMPLEMENTED(); 99 return stub_bluetooth_adapter_client_.get();
71 return NULL;
72 } 100 }
73 101
74 BluetoothDeviceClient* 102 BluetoothDeviceClient*
75 MockDBusThreadManagerWithoutGMock::GetBluetoothDeviceClient() { 103 MockDBusThreadManagerWithoutGMock::GetBluetoothDeviceClient() {
76 NOTIMPLEMENTED(); 104 return stub_bluetooth_device_client_.get();
77 return NULL;
78 } 105 }
79 106
80 BluetoothInputClient* 107 BluetoothInputClient*
81 MockDBusThreadManagerWithoutGMock::GetBluetoothInputClient() { 108 MockDBusThreadManagerWithoutGMock::GetBluetoothInputClient() {
82 NOTIMPLEMENTED(); 109 NOTIMPLEMENTED();
83 return NULL; 110 return NULL;
84 } 111 }
85 112
86 BluetoothManagerClient* 113 BluetoothManagerClient*
87 MockDBusThreadManagerWithoutGMock::GetBluetoothManagerClient() { 114 MockDBusThreadManagerWithoutGMock::GetBluetoothManagerClient() {
88 NOTIMPLEMENTED(); 115 return stub_bluetooth_manager_client_.get();
89 return NULL;
90 } 116 }
91 117
92 BluetoothNodeClient* 118 BluetoothNodeClient*
93 MockDBusThreadManagerWithoutGMock::GetBluetoothNodeClient() { 119 MockDBusThreadManagerWithoutGMock::GetBluetoothNodeClient() {
94 NOTIMPLEMENTED(); 120 NOTIMPLEMENTED();
95 return NULL; 121 return NULL;
96 } 122 }
97 123
98 CrasAudioClient* MockDBusThreadManagerWithoutGMock::GetCrasAudioClient() { 124 CrasAudioClient* MockDBusThreadManagerWithoutGMock::GetCrasAudioClient() {
99 NOTIMPLEMENTED(); 125 NOTIMPLEMENTED();
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 NOTIMPLEMENTED(); 196 NOTIMPLEMENTED();
171 return NULL; 197 return NULL;
172 } 198 }
173 199
174 GsmSMSClient* MockDBusThreadManagerWithoutGMock::GetGsmSMSClient() { 200 GsmSMSClient* MockDBusThreadManagerWithoutGMock::GetGsmSMSClient() {
175 NOTIMPLEMENTED(); 201 NOTIMPLEMENTED();
176 return NULL; 202 return NULL;
177 } 203 }
178 204
179 ImageBurnerClient* MockDBusThreadManagerWithoutGMock::GetImageBurnerClient() { 205 ImageBurnerClient* MockDBusThreadManagerWithoutGMock::GetImageBurnerClient() {
180 NOTIMPLEMENTED(); 206 return stub_image_burner_client_.get();
181 return NULL;
182 } 207 }
183 208
184 IntrospectableClient* 209 IntrospectableClient*
185 MockDBusThreadManagerWithoutGMock::GetIntrospectableClient() { 210 MockDBusThreadManagerWithoutGMock::GetIntrospectableClient() {
186 NOTIMPLEMENTED(); 211 NOTIMPLEMENTED();
187 return NULL; 212 return NULL;
188 } 213 }
189 214
190 ModemMessagingClient* 215 ModemMessagingClient*
191 MockDBusThreadManagerWithoutGMock::GetModemMessagingClient() { 216 MockDBusThreadManagerWithoutGMock::GetModemMessagingClient() {
192 NOTIMPLEMENTED(); 217 NOTIMPLEMENTED();
193 return NULL; 218 return NULL;
194 } 219 }
195 220
196 PermissionBrokerClient* 221 PermissionBrokerClient*
197 MockDBusThreadManagerWithoutGMock::GetPermissionBrokerClient() { 222 MockDBusThreadManagerWithoutGMock::GetPermissionBrokerClient() {
198 NOTIMPLEMENTED(); 223 NOTIMPLEMENTED();
199 return NULL; 224 return NULL;
200 } 225 }
201 226
202 PowerManagerClient* MockDBusThreadManagerWithoutGMock::GetPowerManagerClient() { 227 PowerManagerClient* MockDBusThreadManagerWithoutGMock::GetPowerManagerClient() {
203 NOTIMPLEMENTED(); 228 return fake_power_manager_client_.get();
204 return NULL;
205 } 229 }
206 230
207 PowerPolicyController* 231 PowerPolicyController*
208 MockDBusThreadManagerWithoutGMock::GetPowerPolicyController() { 232 MockDBusThreadManagerWithoutGMock::GetPowerPolicyController() {
209 NOTIMPLEMENTED(); 233 return power_policy_controller_.get();
210 return NULL;
211 } 234 }
212 235
213 SessionManagerClient* 236 SessionManagerClient*
214 MockDBusThreadManagerWithoutGMock::GetSessionManagerClient() { 237 MockDBusThreadManagerWithoutGMock::GetSessionManagerClient() {
215 NOTIMPLEMENTED(); 238 return stub_session_manager_client_.get();
216 return NULL;
217 } 239 }
218 240
219 SMSClient* MockDBusThreadManagerWithoutGMock::GetSMSClient() { 241 SMSClient* MockDBusThreadManagerWithoutGMock::GetSMSClient() {
220 NOTIMPLEMENTED(); 242 NOTIMPLEMENTED();
221 return NULL; 243 return NULL;
222 } 244 }
223 245
224 SystemClockClient* MockDBusThreadManagerWithoutGMock::GetSystemClockClient() { 246 SystemClockClient* MockDBusThreadManagerWithoutGMock::GetSystemClockClient() {
225 NOTIMPLEMENTED(); 247 return stub_system_clock_client_.get();
226 return NULL;
227 } 248 }
228 249
229 UpdateEngineClient* MockDBusThreadManagerWithoutGMock::GetUpdateEngineClient() { 250 UpdateEngineClient* MockDBusThreadManagerWithoutGMock::GetUpdateEngineClient() {
230 NOTIMPLEMENTED(); 251 return fake_update_engine_client_.get();
231 return NULL;
232 } 252 }
233 253
234 BluetoothOutOfBandClient* 254 BluetoothOutOfBandClient*
235 MockDBusThreadManagerWithoutGMock::GetBluetoothOutOfBandClient() { 255 MockDBusThreadManagerWithoutGMock::GetBluetoothOutOfBandClient() {
236 NOTIMPLEMENTED(); 256 NOTIMPLEMENTED();
237 return NULL; 257 return NULL;
238 } 258 }
239 259
240 IBusClient* MockDBusThreadManagerWithoutGMock::GetIBusClient() { 260 IBusClient* MockDBusThreadManagerWithoutGMock::GetIBusClient() {
241 return mock_ibus_client_.get(); 261 return mock_ibus_client_.get();
(...skipping 20 matching lines...) Expand all
262 282
263 void MockDBusThreadManagerWithoutGMock::RemoveIBusEngineService( 283 void MockDBusThreadManagerWithoutGMock::RemoveIBusEngineService(
264 const dbus::ObjectPath& object_path) { 284 const dbus::ObjectPath& object_path) {
265 } 285 }
266 286
267 IBusPanelService* MockDBusThreadManagerWithoutGMock::GetIBusPanelService() { 287 IBusPanelService* MockDBusThreadManagerWithoutGMock::GetIBusPanelService() {
268 return mock_ibus_panel_service_.get(); 288 return mock_ibus_panel_service_.get();
269 } 289 }
270 290
271 } // namespace chromeos 291 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/mock_dbus_thread_manager_without_gmock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698