| 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.h" | 5 #include "chromeos/dbus/mock_dbus_thread_manager.h" |
| 6 | 6 |
| 7 #include "chromeos/dbus/dbus_thread_manager_observer.h" | 7 #include "chromeos/dbus/dbus_thread_manager_observer.h" |
| 8 #include "chromeos/dbus/ibus/mock_ibus_client.h" | 8 #include "chromeos/dbus/ibus/mock_ibus_client.h" |
| 9 #include "chromeos/dbus/ibus/mock_ibus_config_client.h" | 9 #include "chromeos/dbus/ibus/mock_ibus_config_client.h" |
| 10 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h" | 10 #include "chromeos/dbus/ibus/mock_ibus_engine_factory_service.h" |
| 11 #include "chromeos/dbus/ibus/mock_ibus_engine_service.h" | 11 #include "chromeos/dbus/ibus/mock_ibus_engine_service.h" |
| 12 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h" | 12 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h" |
| 13 #include "chromeos/dbus/ibus/mock_ibus_panel_service.h" | 13 #include "chromeos/dbus/ibus/mock_ibus_panel_service.h" |
| 14 #include "chromeos/dbus/mock_bluetooth_adapter_client.h" | 14 #include "chromeos/dbus/mock_bluetooth_adapter_client.h" |
| 15 #include "chromeos/dbus/mock_bluetooth_device_client.h" | 15 #include "chromeos/dbus/mock_bluetooth_device_client.h" |
| 16 #include "chromeos/dbus/mock_bluetooth_input_client.h" | 16 #include "chromeos/dbus/mock_bluetooth_input_client.h" |
| 17 #include "chromeos/dbus/mock_bluetooth_manager_client.h" | 17 #include "chromeos/dbus/mock_bluetooth_manager_client.h" |
| 18 #include "chromeos/dbus/mock_bluetooth_node_client.h" | 18 #include "chromeos/dbus/mock_bluetooth_node_client.h" |
| 19 #include "chromeos/dbus/mock_bluetooth_out_of_band_client.h" | 19 #include "chromeos/dbus/mock_bluetooth_out_of_band_client.h" |
| 20 #include "chromeos/dbus/mock_cros_disks_client.h" | 20 #include "chromeos/dbus/mock_cros_disks_client.h" |
| 21 #include "chromeos/dbus/mock_cryptohome_client.h" | 21 #include "chromeos/dbus/mock_cryptohome_client.h" |
| 22 #include "chromeos/dbus/mock_debug_daemon_client.h" | |
| 23 #include "chromeos/dbus/mock_shill_device_client.h" | 22 #include "chromeos/dbus/mock_shill_device_client.h" |
| 24 #include "chromeos/dbus/mock_shill_ipconfig_client.h" | 23 #include "chromeos/dbus/mock_shill_ipconfig_client.h" |
| 25 #include "chromeos/dbus/mock_shill_manager_client.h" | 24 #include "chromeos/dbus/mock_shill_manager_client.h" |
| 26 #include "chromeos/dbus/mock_shill_profile_client.h" | 25 #include "chromeos/dbus/mock_shill_profile_client.h" |
| 27 #include "chromeos/dbus/mock_shill_service_client.h" | 26 #include "chromeos/dbus/mock_shill_service_client.h" |
| 28 #include "chromeos/dbus/mock_gsm_sms_client.h" | 27 #include "chromeos/dbus/mock_gsm_sms_client.h" |
| 29 #include "chromeos/dbus/mock_image_burner_client.h" | 28 #include "chromeos/dbus/mock_image_burner_client.h" |
| 30 #include "chromeos/dbus/mock_introspectable_client.h" | |
| 31 #include "chromeos/dbus/mock_modem_messaging_client.h" | |
| 32 #include "chromeos/dbus/mock_permission_broker_client.h" | |
| 33 #include "chromeos/dbus/mock_power_manager_client.h" | 29 #include "chromeos/dbus/mock_power_manager_client.h" |
| 34 #include "chromeos/dbus/mock_session_manager_client.h" | 30 #include "chromeos/dbus/mock_session_manager_client.h" |
| 35 #include "chromeos/dbus/mock_sms_client.h" | |
| 36 #include "chromeos/dbus/mock_system_clock_client.h" | 31 #include "chromeos/dbus/mock_system_clock_client.h" |
| 37 #include "chromeos/dbus/mock_update_engine_client.h" | 32 #include "chromeos/dbus/mock_update_engine_client.h" |
| 38 #include "chromeos/dbus/power_policy_controller.h" | 33 #include "chromeos/dbus/power_policy_controller.h" |
| 39 | 34 |
| 40 using ::testing::AnyNumber; | 35 using ::testing::AnyNumber; |
| 41 using ::testing::Return; | 36 using ::testing::Return; |
| 42 using ::testing::ReturnNull; | 37 using ::testing::ReturnNull; |
| 43 using ::testing::_; | 38 using ::testing::_; |
| 44 | 39 |
| 45 namespace chromeos { | 40 namespace chromeos { |
| 46 | 41 |
| 47 MockDBusThreadManager::MockDBusThreadManager() | 42 MockDBusThreadManager::MockDBusThreadManager() |
| 48 : mock_bluetooth_adapter_client_(new MockBluetoothAdapterClient), | 43 : mock_bluetooth_adapter_client_(new MockBluetoothAdapterClient), |
| 49 mock_bluetooth_device_client_(new MockBluetoothDeviceClient), | 44 mock_bluetooth_device_client_(new MockBluetoothDeviceClient), |
| 50 mock_bluetooth_input_client_(new MockBluetoothInputClient), | 45 mock_bluetooth_input_client_(new MockBluetoothInputClient), |
| 51 mock_bluetooth_manager_client_(new MockBluetoothManagerClient), | 46 mock_bluetooth_manager_client_(new MockBluetoothManagerClient), |
| 52 mock_bluetooth_node_client_(new MockBluetoothNodeClient), | 47 mock_bluetooth_node_client_(new MockBluetoothNodeClient), |
| 53 mock_bluetooth_out_of_band_client_(new MockBluetoothOutOfBandClient), | 48 mock_bluetooth_out_of_band_client_(new MockBluetoothOutOfBandClient), |
| 54 mock_cros_disks_client_(new MockCrosDisksClient), | 49 mock_cros_disks_client_(new MockCrosDisksClient), |
| 55 mock_cryptohome_client_(new MockCryptohomeClient), | 50 mock_cryptohome_client_(new MockCryptohomeClient), |
| 56 mock_debugdaemon_client_(new MockDebugDaemonClient), | |
| 57 mock_shill_device_client_(new MockShillDeviceClient), | 51 mock_shill_device_client_(new MockShillDeviceClient), |
| 58 mock_shill_ipconfig_client_(new MockShillIPConfigClient), | 52 mock_shill_ipconfig_client_(new MockShillIPConfigClient), |
| 59 mock_shill_manager_client_(new MockShillManagerClient), | 53 mock_shill_manager_client_(new MockShillManagerClient), |
| 60 mock_shill_profile_client_(new MockShillProfileClient), | 54 mock_shill_profile_client_(new MockShillProfileClient), |
| 61 mock_shill_service_client_(new MockShillServiceClient), | 55 mock_shill_service_client_(new MockShillServiceClient), |
| 62 mock_gsm_sms_client_(new MockGsmSMSClient), | 56 mock_gsm_sms_client_(new MockGsmSMSClient), |
| 63 mock_image_burner_client_(new MockImageBurnerClient), | 57 mock_image_burner_client_(new MockImageBurnerClient), |
| 64 mock_introspectable_client_(new MockIntrospectableClient), | |
| 65 mock_modem_messaging_client_(new MockModemMessagingClient), | |
| 66 mock_permission_broker_client_(new MockPermissionBrokerClient), | |
| 67 mock_power_manager_client_(new MockPowerManagerClient), | 58 mock_power_manager_client_(new MockPowerManagerClient), |
| 68 mock_session_manager_client_(new MockSessionManagerClient), | 59 mock_session_manager_client_(new MockSessionManagerClient), |
| 69 mock_sms_client_(new MockSMSClient), | |
| 70 mock_system_clock_client_(new MockSystemClockClient), | 60 mock_system_clock_client_(new MockSystemClockClient), |
| 71 mock_update_engine_client_(new MockUpdateEngineClient), | 61 mock_update_engine_client_(new MockUpdateEngineClient), |
| 72 mock_ibus_client_(new MockIBusClient), | 62 mock_ibus_client_(new MockIBusClient), |
| 73 mock_ibus_config_client_(new MockIBusConfigClient), | 63 mock_ibus_config_client_(new MockIBusConfigClient), |
| 74 mock_ibus_input_context_client_(new MockIBusInputContextClient), | 64 mock_ibus_input_context_client_(new MockIBusInputContextClient), |
| 75 mock_ibus_engine_service_(new MockIBusEngineService), | 65 mock_ibus_engine_service_(new MockIBusEngineService), |
| 76 mock_ibus_engine_factory_service_(new MockIBusEngineFactoryService), | 66 mock_ibus_engine_factory_service_(new MockIBusEngineFactoryService), |
| 77 mock_ibus_panel_service_(new MockIBusPanelService) { | 67 mock_ibus_panel_service_(new MockIBusPanelService) { |
| 78 EXPECT_CALL(*this, GetBluetoothAdapterClient()) | 68 EXPECT_CALL(*this, GetBluetoothAdapterClient()) |
| 79 .WillRepeatedly(Return(mock_bluetooth_adapter_client_.get())); | 69 .WillRepeatedly(Return(mock_bluetooth_adapter_client_.get())); |
| 80 EXPECT_CALL(*this, GetBluetoothDeviceClient()) | 70 EXPECT_CALL(*this, GetBluetoothDeviceClient()) |
| 81 .WillRepeatedly(Return(mock_bluetooth_device_client_.get())); | 71 .WillRepeatedly(Return(mock_bluetooth_device_client_.get())); |
| 82 EXPECT_CALL(*this, GetBluetoothInputClient()) | 72 EXPECT_CALL(*this, GetBluetoothInputClient()) |
| 83 .WillRepeatedly(Return(mock_bluetooth_input_client_.get())); | 73 .WillRepeatedly(Return(mock_bluetooth_input_client_.get())); |
| 84 EXPECT_CALL(*this, GetBluetoothManagerClient()) | 74 EXPECT_CALL(*this, GetBluetoothManagerClient()) |
| 85 .WillRepeatedly(Return(mock_bluetooth_manager_client())); | 75 .WillRepeatedly(Return(mock_bluetooth_manager_client())); |
| 86 EXPECT_CALL(*this, GetBluetoothNodeClient()) | 76 EXPECT_CALL(*this, GetBluetoothNodeClient()) |
| 87 .WillRepeatedly(Return(mock_bluetooth_node_client_.get())); | 77 .WillRepeatedly(Return(mock_bluetooth_node_client_.get())); |
| 88 EXPECT_CALL(*this, GetBluetoothOutOfBandClient()) | 78 EXPECT_CALL(*this, GetBluetoothOutOfBandClient()) |
| 89 .WillRepeatedly(Return(mock_bluetooth_out_of_band_client_.get())); | 79 .WillRepeatedly(Return(mock_bluetooth_out_of_band_client_.get())); |
| 90 EXPECT_CALL(*this, GetCrosDisksClient()) | 80 EXPECT_CALL(*this, GetCrosDisksClient()) |
| 91 .WillRepeatedly(Return(mock_cros_disks_client())); | 81 .WillRepeatedly(Return(mock_cros_disks_client())); |
| 92 EXPECT_CALL(*this, GetCryptohomeClient()) | 82 EXPECT_CALL(*this, GetCryptohomeClient()) |
| 93 .WillRepeatedly(Return(mock_cryptohome_client())); | 83 .WillRepeatedly(Return(mock_cryptohome_client())); |
| 94 EXPECT_CALL(*this, GetDebugDaemonClient()) | |
| 95 .WillRepeatedly(Return(mock_debugdaemon_client())); | |
| 96 EXPECT_CALL(*this, GetShillDeviceClient()) | 84 EXPECT_CALL(*this, GetShillDeviceClient()) |
| 97 .WillRepeatedly(Return(mock_shill_device_client())); | 85 .WillRepeatedly(Return(mock_shill_device_client())); |
| 98 EXPECT_CALL(*this, GetShillIPConfigClient()) | 86 EXPECT_CALL(*this, GetShillIPConfigClient()) |
| 99 .WillRepeatedly(Return(mock_shill_ipconfig_client())); | 87 .WillRepeatedly(Return(mock_shill_ipconfig_client())); |
| 100 EXPECT_CALL(*this, GetShillManagerClient()) | 88 EXPECT_CALL(*this, GetShillManagerClient()) |
| 101 .WillRepeatedly(Return(mock_shill_manager_client())); | 89 .WillRepeatedly(Return(mock_shill_manager_client())); |
| 102 EXPECT_CALL(*this, GetShillProfileClient()) | 90 EXPECT_CALL(*this, GetShillProfileClient()) |
| 103 .WillRepeatedly(Return(mock_shill_profile_client())); | 91 .WillRepeatedly(Return(mock_shill_profile_client())); |
| 104 EXPECT_CALL(*this, GetShillServiceClient()) | 92 EXPECT_CALL(*this, GetShillServiceClient()) |
| 105 .WillRepeatedly(Return(mock_shill_service_client())); | 93 .WillRepeatedly(Return(mock_shill_service_client())); |
| 106 EXPECT_CALL(*this, GetGsmSMSClient()) | 94 EXPECT_CALL(*this, GetGsmSMSClient()) |
| 107 .WillRepeatedly(Return(mock_gsm_sms_client())); | 95 .WillRepeatedly(Return(mock_gsm_sms_client())); |
| 108 EXPECT_CALL(*this, GetImageBurnerClient()) | 96 EXPECT_CALL(*this, GetImageBurnerClient()) |
| 109 .WillRepeatedly(Return(mock_image_burner_client())); | 97 .WillRepeatedly(Return(mock_image_burner_client())); |
| 110 EXPECT_CALL(*this, GetIntrospectableClient()) | |
| 111 .WillRepeatedly(Return(mock_introspectable_client())); | |
| 112 EXPECT_CALL(*this, GetModemMessagingClient()) | |
| 113 .WillRepeatedly(Return(mock_modem_messaging_client())); | |
| 114 EXPECT_CALL(*this, GetPowerManagerClient()) | 98 EXPECT_CALL(*this, GetPowerManagerClient()) |
| 115 .WillRepeatedly(Return(mock_power_manager_client_.get())); | 99 .WillRepeatedly(Return(mock_power_manager_client_.get())); |
| 116 EXPECT_CALL(*this, GetSessionManagerClient()) | 100 EXPECT_CALL(*this, GetSessionManagerClient()) |
| 117 .WillRepeatedly(Return(mock_session_manager_client_.get())); | 101 .WillRepeatedly(Return(mock_session_manager_client_.get())); |
| 118 EXPECT_CALL(*this, GetSMSClient()) | |
| 119 .WillRepeatedly(Return(mock_sms_client_.get())); | |
| 120 EXPECT_CALL(*this, GetSystemClockClient()) | 102 EXPECT_CALL(*this, GetSystemClockClient()) |
| 121 .WillRepeatedly(Return(mock_system_clock_client())); | 103 .WillRepeatedly(Return(mock_system_clock_client())); |
| 122 EXPECT_CALL(*this, GetUpdateEngineClient()) | 104 EXPECT_CALL(*this, GetUpdateEngineClient()) |
| 123 .WillRepeatedly(Return(mock_update_engine_client_.get())); | 105 .WillRepeatedly(Return(mock_update_engine_client_.get())); |
| 124 EXPECT_CALL(*this, GetIBusClient()) | 106 EXPECT_CALL(*this, GetIBusClient()) |
| 125 .WillRepeatedly(Return(mock_ibus_client_.get())); | 107 .WillRepeatedly(Return(mock_ibus_client_.get())); |
| 126 EXPECT_CALL(*this, GetIBusConfigClient()) | 108 EXPECT_CALL(*this, GetIBusConfigClient()) |
| 127 .WillRepeatedly(Return(mock_ibus_config_client_.get())); | 109 .WillRepeatedly(Return(mock_ibus_config_client_.get())); |
| 128 EXPECT_CALL(*this, GetIBusInputContextClient()) | 110 EXPECT_CALL(*this, GetIBusInputContextClient()) |
| 129 .WillRepeatedly(Return(mock_ibus_input_context_client_.get())); | 111 .WillRepeatedly(Return(mock_ibus_input_context_client_.get())); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 observers_.AddObserver(observer); | 229 observers_.AddObserver(observer); |
| 248 } | 230 } |
| 249 | 231 |
| 250 void MockDBusThreadManager::RemoveObserver( | 232 void MockDBusThreadManager::RemoveObserver( |
| 251 DBusThreadManagerObserver* observer) { | 233 DBusThreadManagerObserver* observer) { |
| 252 DCHECK(observer); | 234 DCHECK(observer); |
| 253 observers_.RemoveObserver(observer); | 235 observers_.RemoveObserver(observer); |
| 254 } | 236 } |
| 255 | 237 |
| 256 } // namespace chromeos | 238 } // namespace chromeos |
| OLD | NEW |