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

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: remove unnecessary include. Created 7 years, 8 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_session_manager_client.h"
14 #include "chromeos/dbus/fake_shill_manager_client.h" 19 #include "chromeos/dbus/fake_shill_manager_client.h"
20 #include "chromeos/dbus/fake_update_engine_client.h"
15 #include "chromeos/dbus/ibus/mock_ibus_client.h" 21 #include "chromeos/dbus/ibus/mock_ibus_client.h"
16 #include "chromeos/dbus/ibus/mock_ibus_config_client.h" 22 #include "chromeos/dbus/ibus/mock_ibus_config_client.h"
17 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h" 23 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h"
18 #include "chromeos/dbus/ibus/mock_ibus_engine_service.h" 24 #include "chromeos/dbus/ibus/mock_ibus_engine_service.h"
19 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h" 25 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h"
20 #include "chromeos/dbus/ibus/mock_ibus_panel_service.h" 26 #include "chromeos/dbus/ibus/mock_ibus_panel_service.h"
27 #include "chromeos/dbus/power_policy_controller.h"
21 #include "dbus/fake_bus.h" 28 #include "dbus/fake_bus.h"
22 29
23 namespace chromeos { 30 namespace chromeos {
24 31
25 MockDBusThreadManagerWithoutGMock::MockDBusThreadManagerWithoutGMock() 32 MockDBusThreadManagerWithoutGMock::MockDBusThreadManagerWithoutGMock()
26 : fake_bluetooth_adapter_client_(new FakeBluetoothAdapterClient()), 33 : fake_bluetooth_adapter_client_(new FakeBluetoothAdapterClient()),
27 fake_bluetooth_agent_manager_client_(new FakeBluetoothAgentManagerClient()), 34 fake_bluetooth_agent_manager_client_(new FakeBluetoothAgentManagerClient()),
28 fake_bluetooth_device_client_(new FakeBluetoothDeviceClient()), 35 fake_bluetooth_device_client_(new FakeBluetoothDeviceClient()),
29 fake_bluetooth_input_client_(new FakeBluetoothInputClient()), 36 fake_bluetooth_input_client_(new FakeBluetoothInputClient()),
30 fake_bluetooth_profile_manager_client_( 37 fake_bluetooth_profile_manager_client_(
31 new FakeBluetoothProfileManagerClient()), 38 new FakeBluetoothProfileManagerClient()),
32 fake_cros_disks_client_(new FakeCrosDisksClient), 39 fake_cros_disks_client_(new FakeCrosDisksClient),
40 fake_power_manager_client_(new FakePowerManagerClient),
41 fake_session_manager_client_(new FakeSessionManagerClient),
33 fake_shill_manager_client_(new FakeShillManagerClient), 42 fake_shill_manager_client_(new FakeShillManagerClient),
43 fake_update_engine_client_(new FakeUpdateEngineClient),
34 mock_ibus_client_(new MockIBusClient), 44 mock_ibus_client_(new MockIBusClient),
35 mock_ibus_config_client_(new MockIBusConfigClient), 45 mock_ibus_config_client_(new MockIBusConfigClient),
36 mock_ibus_input_context_client_(new MockIBusInputContextClient), 46 mock_ibus_input_context_client_(new MockIBusInputContextClient),
37 mock_ibus_engine_service_(new MockIBusEngineService), 47 mock_ibus_engine_service_(new MockIBusEngineService),
38 mock_ibus_engine_factory_service_(new MockIBusEngineFactoryService), 48 mock_ibus_engine_factory_service_(new MockIBusEngineFactoryService),
39 mock_ibus_panel_service_(new MockIBusPanelService), 49 mock_ibus_panel_service_(new MockIBusPanelService),
50 stub_bluetooth_manager_client_(
51 BluetoothManagerClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL)),
satorux1 2013/04/26 04:44:40 please do: new FakeBluetoothManagerClient
52 stub_bluetooth_adapter_client_(
53 BluetoothAdapterClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL,
54 stub_bluetooth_manager_client_.get())),
55 stub_bluetooth_device_client_(
56 BluetoothDeviceClient::Create(STUB_DBUS_CLIENT_IMPLEMENTATION, NULL,
57 stub_bluetooth_adapter_client_.get())),
40 ibus_bus_(NULL) { 58 ibus_bus_(NULL) {
59 power_policy_controller_.reset(
60 new PowerPolicyController(this, fake_power_manager_client_.get()));
41 } 61 }
42 62
43 MockDBusThreadManagerWithoutGMock::~MockDBusThreadManagerWithoutGMock() { 63 MockDBusThreadManagerWithoutGMock::~MockDBusThreadManagerWithoutGMock() {
44 FOR_EACH_OBSERVER(DBusThreadManagerObserver, observers_, 64 FOR_EACH_OBSERVER(DBusThreadManagerObserver, observers_,
45 OnDBusThreadManagerDestroying(this)); 65 OnDBusThreadManagerDestroying(this));
46 } 66 }
47 67
48 void MockDBusThreadManagerWithoutGMock::AddObserver( 68 void MockDBusThreadManagerWithoutGMock::AddObserver(
49 DBusThreadManagerObserver* observer) { 69 DBusThreadManagerObserver* observer) {
50 DCHECK(observer); 70 DCHECK(observer);
(...skipping 16 matching lines...) Expand all
67 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetSystemBus() { 87 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetSystemBus() {
68 return NULL; 88 return NULL;
69 } 89 }
70 90
71 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetIBusBus() { 91 dbus::Bus* MockDBusThreadManagerWithoutGMock::GetIBusBus() {
72 return ibus_bus_; 92 return ibus_bus_;
73 } 93 }
74 94
75 BluetoothAdapterClient* 95 BluetoothAdapterClient*
76 MockDBusThreadManagerWithoutGMock::GetBluetoothAdapterClient() { 96 MockDBusThreadManagerWithoutGMock::GetBluetoothAdapterClient() {
77 NOTIMPLEMENTED(); 97 return stub_bluetooth_adapter_client_.get();
78 return NULL;
79 } 98 }
80 99
81 BluetoothDeviceClient* 100 BluetoothDeviceClient*
82 MockDBusThreadManagerWithoutGMock::GetBluetoothDeviceClient() { 101 MockDBusThreadManagerWithoutGMock::GetBluetoothDeviceClient() {
83 NOTIMPLEMENTED(); 102 return stub_bluetooth_device_client_.get();
84 return NULL;
85 } 103 }
86 104
87 BluetoothInputClient* 105 BluetoothInputClient*
88 MockDBusThreadManagerWithoutGMock::GetBluetoothInputClient() { 106 MockDBusThreadManagerWithoutGMock::GetBluetoothInputClient() {
89 NOTIMPLEMENTED(); 107 NOTIMPLEMENTED();
90 return NULL; 108 return NULL;
91 } 109 }
92 110
93 BluetoothManagerClient* 111 BluetoothManagerClient*
94 MockDBusThreadManagerWithoutGMock::GetBluetoothManagerClient() { 112 MockDBusThreadManagerWithoutGMock::GetBluetoothManagerClient() {
95 NOTIMPLEMENTED(); 113 return stub_bluetooth_manager_client_.get();
96 return NULL;
97 } 114 }
98 115
99 BluetoothNodeClient* 116 BluetoothNodeClient*
100 MockDBusThreadManagerWithoutGMock::GetBluetoothNodeClient() { 117 MockDBusThreadManagerWithoutGMock::GetBluetoothNodeClient() {
101 NOTIMPLEMENTED(); 118 NOTIMPLEMENTED();
102 return NULL; 119 return NULL;
103 } 120 }
104 121
105 CrasAudioClient* MockDBusThreadManagerWithoutGMock::GetCrasAudioClient() { 122 CrasAudioClient* MockDBusThreadManagerWithoutGMock::GetCrasAudioClient() {
106 NOTIMPLEMENTED(); 123 NOTIMPLEMENTED();
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 return NULL; 216 return NULL;
200 } 217 }
201 218
202 PermissionBrokerClient* 219 PermissionBrokerClient*
203 MockDBusThreadManagerWithoutGMock::GetPermissionBrokerClient() { 220 MockDBusThreadManagerWithoutGMock::GetPermissionBrokerClient() {
204 NOTIMPLEMENTED(); 221 NOTIMPLEMENTED();
205 return NULL; 222 return NULL;
206 } 223 }
207 224
208 PowerManagerClient* MockDBusThreadManagerWithoutGMock::GetPowerManagerClient() { 225 PowerManagerClient* MockDBusThreadManagerWithoutGMock::GetPowerManagerClient() {
209 NOTIMPLEMENTED(); 226 return fake_power_manager_client_.get();
210 return NULL;
211 } 227 }
212 228
213 PowerPolicyController* 229 PowerPolicyController*
214 MockDBusThreadManagerWithoutGMock::GetPowerPolicyController() { 230 MockDBusThreadManagerWithoutGMock::GetPowerPolicyController() {
215 NOTIMPLEMENTED(); 231 return power_policy_controller_.get();
216 return NULL;
217 } 232 }
218 233
219 SessionManagerClient* 234 SessionManagerClient*
220 MockDBusThreadManagerWithoutGMock::GetSessionManagerClient() { 235 MockDBusThreadManagerWithoutGMock::GetSessionManagerClient() {
221 NOTIMPLEMENTED(); 236 return fake_session_manager_client_.get();
222 return NULL;
223 } 237 }
224 238
225 SMSClient* MockDBusThreadManagerWithoutGMock::GetSMSClient() { 239 SMSClient* MockDBusThreadManagerWithoutGMock::GetSMSClient() {
226 NOTIMPLEMENTED(); 240 NOTIMPLEMENTED();
227 return NULL; 241 return NULL;
228 } 242 }
229 243
230 SystemClockClient* MockDBusThreadManagerWithoutGMock::GetSystemClockClient() { 244 SystemClockClient* MockDBusThreadManagerWithoutGMock::GetSystemClockClient() {
231 NOTIMPLEMENTED(); 245 NOTIMPLEMENTED();
232 return NULL; 246 return NULL;
233 } 247 }
234 248
235 UpdateEngineClient* MockDBusThreadManagerWithoutGMock::GetUpdateEngineClient() { 249 UpdateEngineClient* MockDBusThreadManagerWithoutGMock::GetUpdateEngineClient() {
236 NOTIMPLEMENTED(); 250 return fake_update_engine_client_.get();
237 return NULL;
238 } 251 }
239 252
240 BluetoothOutOfBandClient* 253 BluetoothOutOfBandClient*
241 MockDBusThreadManagerWithoutGMock::GetBluetoothOutOfBandClient() { 254 MockDBusThreadManagerWithoutGMock::GetBluetoothOutOfBandClient() {
242 NOTIMPLEMENTED(); 255 NOTIMPLEMENTED();
243 return NULL; 256 return NULL;
244 } 257 }
245 258
246 IBusClient* MockDBusThreadManagerWithoutGMock::GetIBusClient() { 259 IBusClient* MockDBusThreadManagerWithoutGMock::GetIBusClient() {
247 return mock_ibus_client_.get(); 260 return mock_ibus_client_.get();
(...skipping 20 matching lines...) Expand all
268 281
269 void MockDBusThreadManagerWithoutGMock::RemoveIBusEngineService( 282 void MockDBusThreadManagerWithoutGMock::RemoveIBusEngineService(
270 const dbus::ObjectPath& object_path) { 283 const dbus::ObjectPath& object_path) {
271 } 284 }
272 285
273 IBusPanelService* MockDBusThreadManagerWithoutGMock::GetIBusPanelService() { 286 IBusPanelService* MockDBusThreadManagerWithoutGMock::GetIBusPanelService() {
274 return mock_ibus_panel_service_.get(); 287 return mock_ibus_panel_service_.get();
275 } 288 }
276 289
277 } // namespace chromeos 290 } // 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