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 #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" |
14 #include "chromeos/dbus/fake_cryptohome_client.h" | 17 #include "chromeos/dbus/fake_cryptohome_client.h" |
15 #include "chromeos/dbus/fake_image_burner_client.h" | 18 #include "chromeos/dbus/fake_image_burner_client.h" |
16 #include "chromeos/dbus/fake_old_bluetooth_adapter_client.h" | 19 #include "chromeos/dbus/fake_old_bluetooth_adapter_client.h" |
17 #include "chromeos/dbus/fake_old_bluetooth_device_client.h" | 20 #include "chromeos/dbus/fake_old_bluetooth_device_client.h" |
18 #include "chromeos/dbus/fake_old_bluetooth_manager_client.h" | 21 #include "chromeos/dbus/fake_old_bluetooth_manager_client.h" |
| 22 #include "chromeos/dbus/fake_power_manager_client.h" |
| 23 #include "chromeos/dbus/fake_session_manager_client.h" |
19 #include "chromeos/dbus/fake_shill_manager_client.h" | 24 #include "chromeos/dbus/fake_shill_manager_client.h" |
20 #include "chromeos/dbus/fake_system_clock_client.h" | 25 #include "chromeos/dbus/fake_system_clock_client.h" |
| 26 #include "chromeos/dbus/fake_update_engine_client.h" |
21 #include "chromeos/dbus/ibus/mock_ibus_client.h" | 27 #include "chromeos/dbus/ibus/mock_ibus_client.h" |
22 #include "chromeos/dbus/ibus/mock_ibus_config_client.h" | 28 #include "chromeos/dbus/ibus/mock_ibus_config_client.h" |
23 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h" | 29 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h" |
24 #include "chromeos/dbus/ibus/mock_ibus_engine_service.h" | 30 #include "chromeos/dbus/ibus/mock_ibus_engine_service.h" |
25 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h" | 31 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h" |
26 #include "chromeos/dbus/ibus/mock_ibus_panel_service.h" | 32 #include "chromeos/dbus/ibus/mock_ibus_panel_service.h" |
| 33 #include "chromeos/dbus/power_policy_controller.h" |
27 | 34 |
28 namespace chromeos { | 35 namespace chromeos { |
29 | 36 |
30 MockDBusThreadManagerWithoutGMock::MockDBusThreadManagerWithoutGMock() | 37 MockDBusThreadManagerWithoutGMock::MockDBusThreadManagerWithoutGMock() |
31 : fake_bluetooth_adapter_client_(new FakeBluetoothAdapterClient()), | 38 : fake_bluetooth_adapter_client_(new FakeBluetoothAdapterClient()), |
32 fake_bluetooth_agent_manager_client_(new FakeBluetoothAgentManagerClient()), | 39 fake_bluetooth_agent_manager_client_(new FakeBluetoothAgentManagerClient()), |
33 fake_bluetooth_device_client_(new FakeBluetoothDeviceClient()), | 40 fake_bluetooth_device_client_(new FakeBluetoothDeviceClient()), |
34 fake_bluetooth_input_client_(new FakeBluetoothInputClient()), | 41 fake_bluetooth_input_client_(new FakeBluetoothInputClient()), |
35 fake_bluetooth_profile_manager_client_( | 42 fake_bluetooth_profile_manager_client_( |
36 new FakeBluetoothProfileManagerClient()), | 43 new FakeBluetoothProfileManagerClient()), |
37 fake_cros_disks_client_(new FakeCrosDisksClient), | 44 fake_cros_disks_client_(new FakeCrosDisksClient), |
38 fake_cryptohome_client_(new FakeCryptohomeClient), | 45 fake_cryptohome_client_(new FakeCryptohomeClient), |
39 fake_image_burner_client_(new FakeImageBurnerClient), | 46 fake_image_burner_client_(new FakeImageBurnerClient), |
| 47 fake_session_manager_client_(new FakeSessionManagerClient), |
40 fake_shill_manager_client_(new FakeShillManagerClient), | 48 fake_shill_manager_client_(new FakeShillManagerClient), |
41 fake_system_clock_client_(new FakeSystemClockClient), | 49 fake_system_clock_client_(new FakeSystemClockClient), |
| 50 fake_power_manager_client_(new FakePowerManagerClient), |
| 51 fake_update_engine_client_(new FakeUpdateEngineClient), |
42 fake_old_bluetooth_manager_client_(new FakeOldBluetoothManagerClient), | 52 fake_old_bluetooth_manager_client_(new FakeOldBluetoothManagerClient), |
43 fake_old_bluetooth_adapter_client_(new FakeOldBluetoothAdapterClient), | 53 fake_old_bluetooth_adapter_client_(new FakeOldBluetoothAdapterClient), |
44 fake_old_bluetooth_device_client_(new FakeOldBluetoothDeviceClient), | 54 fake_old_bluetooth_device_client_(new FakeOldBluetoothDeviceClient), |
45 mock_ibus_client_(new MockIBusClient), | 55 mock_ibus_client_(new MockIBusClient), |
46 mock_ibus_config_client_(new MockIBusConfigClient), | 56 mock_ibus_config_client_(new MockIBusConfigClient), |
47 mock_ibus_input_context_client_(new MockIBusInputContextClient), | 57 mock_ibus_input_context_client_(new MockIBusInputContextClient), |
48 mock_ibus_engine_service_(new MockIBusEngineService), | 58 mock_ibus_engine_service_(new MockIBusEngineService), |
49 mock_ibus_engine_factory_service_(new MockIBusEngineFactoryService), | 59 mock_ibus_engine_factory_service_(new MockIBusEngineFactoryService), |
50 mock_ibus_panel_service_(new MockIBusPanelService), | 60 mock_ibus_panel_service_(new MockIBusPanelService), |
51 ibus_bus_(NULL) { | 61 ibus_bus_(NULL) { |
| 62 power_policy_controller_.reset( |
| 63 new PowerPolicyController(this, fake_power_manager_client_.get())); |
52 } | 64 } |
53 | 65 |
54 MockDBusThreadManagerWithoutGMock::~MockDBusThreadManagerWithoutGMock() { | 66 MockDBusThreadManagerWithoutGMock::~MockDBusThreadManagerWithoutGMock() { |
55 FOR_EACH_OBSERVER(DBusThreadManagerObserver, observers_, | 67 FOR_EACH_OBSERVER(DBusThreadManagerObserver, observers_, |
56 OnDBusThreadManagerDestroying(this)); | 68 OnDBusThreadManagerDestroying(this)); |
57 } | 69 } |
58 | 70 |
59 void MockDBusThreadManagerWithoutGMock::AddObserver( | 71 void MockDBusThreadManagerWithoutGMock::AddObserver( |
60 DBusThreadManagerObserver* observer) { | 72 DBusThreadManagerObserver* observer) { |
61 DCHECK(observer); | 73 DCHECK(observer); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 return NULL; | 217 return NULL; |
206 } | 218 } |
207 | 219 |
208 PermissionBrokerClient* | 220 PermissionBrokerClient* |
209 MockDBusThreadManagerWithoutGMock::GetPermissionBrokerClient() { | 221 MockDBusThreadManagerWithoutGMock::GetPermissionBrokerClient() { |
210 NOTIMPLEMENTED(); | 222 NOTIMPLEMENTED(); |
211 return NULL; | 223 return NULL; |
212 } | 224 } |
213 | 225 |
214 PowerManagerClient* MockDBusThreadManagerWithoutGMock::GetPowerManagerClient() { | 226 PowerManagerClient* MockDBusThreadManagerWithoutGMock::GetPowerManagerClient() { |
215 NOTIMPLEMENTED(); | 227 return fake_power_manager_client_.get(); |
216 return NULL; | |
217 } | 228 } |
218 | 229 |
219 PowerPolicyController* | 230 PowerPolicyController* |
220 MockDBusThreadManagerWithoutGMock::GetPowerPolicyController() { | 231 MockDBusThreadManagerWithoutGMock::GetPowerPolicyController() { |
221 NOTIMPLEMENTED(); | 232 return power_policy_controller_.get(); |
222 return NULL; | |
223 } | 233 } |
224 | 234 |
225 SessionManagerClient* | 235 SessionManagerClient* |
226 MockDBusThreadManagerWithoutGMock::GetSessionManagerClient() { | 236 MockDBusThreadManagerWithoutGMock::GetSessionManagerClient() { |
227 NOTIMPLEMENTED(); | 237 return fake_session_manager_client_.get(); |
228 return NULL; | |
229 } | 238 } |
230 | 239 |
231 SMSClient* MockDBusThreadManagerWithoutGMock::GetSMSClient() { | 240 SMSClient* MockDBusThreadManagerWithoutGMock::GetSMSClient() { |
232 NOTIMPLEMENTED(); | 241 NOTIMPLEMENTED(); |
233 return NULL; | 242 return NULL; |
234 } | 243 } |
235 | 244 |
236 SystemClockClient* MockDBusThreadManagerWithoutGMock::GetSystemClockClient() { | 245 SystemClockClient* MockDBusThreadManagerWithoutGMock::GetSystemClockClient() { |
237 return fake_system_clock_client_.get(); | 246 return fake_system_clock_client_.get(); |
238 } | 247 } |
239 | 248 |
240 UpdateEngineClient* MockDBusThreadManagerWithoutGMock::GetUpdateEngineClient() { | 249 UpdateEngineClient* MockDBusThreadManagerWithoutGMock::GetUpdateEngineClient() { |
241 NOTIMPLEMENTED(); | 250 return fake_update_engine_client_.get(); |
242 return NULL; | |
243 } | 251 } |
244 | 252 |
245 BluetoothOutOfBandClient* | 253 BluetoothOutOfBandClient* |
246 MockDBusThreadManagerWithoutGMock::GetBluetoothOutOfBandClient() { | 254 MockDBusThreadManagerWithoutGMock::GetBluetoothOutOfBandClient() { |
247 NOTIMPLEMENTED(); | 255 NOTIMPLEMENTED(); |
248 return NULL; | 256 return NULL; |
249 } | 257 } |
250 | 258 |
251 IBusClient* MockDBusThreadManagerWithoutGMock::GetIBusClient() { | 259 IBusClient* MockDBusThreadManagerWithoutGMock::GetIBusClient() { |
252 return mock_ibus_client_.get(); | 260 return mock_ibus_client_.get(); |
(...skipping 20 matching lines...) Expand all Loading... |
273 | 281 |
274 void MockDBusThreadManagerWithoutGMock::RemoveIBusEngineService( | 282 void MockDBusThreadManagerWithoutGMock::RemoveIBusEngineService( |
275 const dbus::ObjectPath& object_path) { | 283 const dbus::ObjectPath& object_path) { |
276 } | 284 } |
277 | 285 |
278 IBusPanelService* MockDBusThreadManagerWithoutGMock::GetIBusPanelService() { | 286 IBusPanelService* MockDBusThreadManagerWithoutGMock::GetIBusPanelService() { |
279 return mock_ibus_panel_service_.get(); | 287 return mock_ibus_panel_service_.get(); |
280 } | 288 } |
281 | 289 |
282 } // namespace chromeos | 290 } // namespace chromeos |
OLD | NEW |