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_cras_audio_client.h" | |
21 #include "chromeos/dbus/mock_cros_disks_client.h" | 20 #include "chromeos/dbus/mock_cros_disks_client.h" |
22 #include "chromeos/dbus/mock_cryptohome_client.h" | 21 #include "chromeos/dbus/mock_cryptohome_client.h" |
23 #include "chromeos/dbus/mock_debug_daemon_client.h" | 22 #include "chromeos/dbus/mock_debug_daemon_client.h" |
24 #include "chromeos/dbus/mock_experimental_bluetooth_adapter_client.h" | 23 #include "chromeos/dbus/mock_experimental_bluetooth_adapter_client.h" |
25 #include "chromeos/dbus/mock_experimental_bluetooth_agent_manager_client.h" | 24 #include "chromeos/dbus/mock_experimental_bluetooth_agent_manager_client.h" |
26 #include "chromeos/dbus/mock_experimental_bluetooth_device_client.h" | 25 #include "chromeos/dbus/mock_experimental_bluetooth_device_client.h" |
27 #include "chromeos/dbus/mock_experimental_bluetooth_profile_manager_client.h" | 26 #include "chromeos/dbus/mock_experimental_bluetooth_profile_manager_client.h" |
28 #include "chromeos/dbus/mock_shill_device_client.h" | 27 #include "chromeos/dbus/mock_shill_device_client.h" |
29 #include "chromeos/dbus/mock_shill_ipconfig_client.h" | 28 #include "chromeos/dbus/mock_shill_ipconfig_client.h" |
30 #include "chromeos/dbus/mock_shill_manager_client.h" | 29 #include "chromeos/dbus/mock_shill_manager_client.h" |
(...skipping 18 matching lines...) Expand all Loading... |
49 | 48 |
50 namespace chromeos { | 49 namespace chromeos { |
51 | 50 |
52 MockDBusThreadManager::MockDBusThreadManager() | 51 MockDBusThreadManager::MockDBusThreadManager() |
53 : mock_bluetooth_adapter_client_(new MockBluetoothAdapterClient), | 52 : mock_bluetooth_adapter_client_(new MockBluetoothAdapterClient), |
54 mock_bluetooth_device_client_(new MockBluetoothDeviceClient), | 53 mock_bluetooth_device_client_(new MockBluetoothDeviceClient), |
55 mock_bluetooth_input_client_(new MockBluetoothInputClient), | 54 mock_bluetooth_input_client_(new MockBluetoothInputClient), |
56 mock_bluetooth_manager_client_(new MockBluetoothManagerClient), | 55 mock_bluetooth_manager_client_(new MockBluetoothManagerClient), |
57 mock_bluetooth_node_client_(new MockBluetoothNodeClient), | 56 mock_bluetooth_node_client_(new MockBluetoothNodeClient), |
58 mock_bluetooth_out_of_band_client_(new MockBluetoothOutOfBandClient), | 57 mock_bluetooth_out_of_band_client_(new MockBluetoothOutOfBandClient), |
59 mock_cras_audio_client_(new MockCrasAudioClient), | |
60 mock_cros_disks_client_(new MockCrosDisksClient), | 58 mock_cros_disks_client_(new MockCrosDisksClient), |
61 mock_cryptohome_client_(new MockCryptohomeClient), | 59 mock_cryptohome_client_(new MockCryptohomeClient), |
62 mock_debugdaemon_client_(new MockDebugDaemonClient), | 60 mock_debugdaemon_client_(new MockDebugDaemonClient), |
63 mock_experimental_bluetooth_adapter_client_( | 61 mock_experimental_bluetooth_adapter_client_( |
64 new MockExperimentalBluetoothAdapterClient), | 62 new MockExperimentalBluetoothAdapterClient), |
65 mock_experimental_bluetooth_agent_manager_client_( | 63 mock_experimental_bluetooth_agent_manager_client_( |
66 new MockExperimentalBluetoothAgentManagerClient), | 64 new MockExperimentalBluetoothAgentManagerClient), |
67 mock_experimental_bluetooth_device_client_( | 65 mock_experimental_bluetooth_device_client_( |
68 new MockExperimentalBluetoothDeviceClient), | 66 new MockExperimentalBluetoothDeviceClient), |
69 mock_experimental_bluetooth_profile_manager_client_( | 67 mock_experimental_bluetooth_profile_manager_client_( |
(...skipping 24 matching lines...) Expand all Loading... |
94 EXPECT_CALL(*this, GetBluetoothDeviceClient()) | 92 EXPECT_CALL(*this, GetBluetoothDeviceClient()) |
95 .WillRepeatedly(Return(mock_bluetooth_device_client_.get())); | 93 .WillRepeatedly(Return(mock_bluetooth_device_client_.get())); |
96 EXPECT_CALL(*this, GetBluetoothInputClient()) | 94 EXPECT_CALL(*this, GetBluetoothInputClient()) |
97 .WillRepeatedly(Return(mock_bluetooth_input_client_.get())); | 95 .WillRepeatedly(Return(mock_bluetooth_input_client_.get())); |
98 EXPECT_CALL(*this, GetBluetoothManagerClient()) | 96 EXPECT_CALL(*this, GetBluetoothManagerClient()) |
99 .WillRepeatedly(Return(mock_bluetooth_manager_client())); | 97 .WillRepeatedly(Return(mock_bluetooth_manager_client())); |
100 EXPECT_CALL(*this, GetBluetoothNodeClient()) | 98 EXPECT_CALL(*this, GetBluetoothNodeClient()) |
101 .WillRepeatedly(Return(mock_bluetooth_node_client_.get())); | 99 .WillRepeatedly(Return(mock_bluetooth_node_client_.get())); |
102 EXPECT_CALL(*this, GetBluetoothOutOfBandClient()) | 100 EXPECT_CALL(*this, GetBluetoothOutOfBandClient()) |
103 .WillRepeatedly(Return(mock_bluetooth_out_of_band_client_.get())); | 101 .WillRepeatedly(Return(mock_bluetooth_out_of_band_client_.get())); |
104 EXPECT_CALL(*this, GetCrasAudioClient()) | |
105 .WillRepeatedly(Return(mock_cras_audio_client())); | |
106 EXPECT_CALL(*this, GetCrosDisksClient()) | 102 EXPECT_CALL(*this, GetCrosDisksClient()) |
107 .WillRepeatedly(Return(mock_cros_disks_client())); | 103 .WillRepeatedly(Return(mock_cros_disks_client())); |
108 EXPECT_CALL(*this, GetCryptohomeClient()) | 104 EXPECT_CALL(*this, GetCryptohomeClient()) |
109 .WillRepeatedly(Return(mock_cryptohome_client())); | 105 .WillRepeatedly(Return(mock_cryptohome_client())); |
110 EXPECT_CALL(*this, GetDebugDaemonClient()) | 106 EXPECT_CALL(*this, GetDebugDaemonClient()) |
111 .WillRepeatedly(Return(mock_debugdaemon_client())); | 107 .WillRepeatedly(Return(mock_debugdaemon_client())); |
112 EXPECT_CALL(*this, GetExperimentalBluetoothAdapterClient()) | 108 EXPECT_CALL(*this, GetExperimentalBluetoothAdapterClient()) |
113 .WillRepeatedly(Return(mock_experimental_bluetooth_adapter_client())); | 109 .WillRepeatedly(Return(mock_experimental_bluetooth_adapter_client())); |
114 EXPECT_CALL(*this, GetExperimentalBluetoothAgentManagerClient()) | 110 EXPECT_CALL(*this, GetExperimentalBluetoothAgentManagerClient()) |
115 .WillRepeatedly(Return( | 111 .WillRepeatedly(Return( |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 EXPECT_CALL(*mock_power_manager_client_.get(), NotifyVideoActivity(_, _)) | 173 EXPECT_CALL(*mock_power_manager_client_.get(), NotifyVideoActivity(_, _)) |
178 .Times(AnyNumber()); | 174 .Times(AnyNumber()); |
179 EXPECT_CALL(*mock_power_manager_client_.get(), SetPolicy(_)) | 175 EXPECT_CALL(*mock_power_manager_client_.get(), SetPolicy(_)) |
180 .Times(AnyNumber()); | 176 .Times(AnyNumber()); |
181 power_policy_controller_.reset( | 177 power_policy_controller_.reset( |
182 new PowerPolicyController(this, mock_power_manager_client_.get())); | 178 new PowerPolicyController(this, mock_power_manager_client_.get())); |
183 EXPECT_CALL(*this, GetPowerPolicyController()) | 179 EXPECT_CALL(*this, GetPowerPolicyController()) |
184 .WillRepeatedly(Return(power_policy_controller_.get())); | 180 .WillRepeatedly(Return(power_policy_controller_.get())); |
185 | 181 |
186 // These observers calls are used in ChromeBrowserMainPartsChromeos. | 182 // These observers calls are used in ChromeBrowserMainPartsChromeos. |
187 EXPECT_CALL(*mock_cras_audio_client_.get(), AddObserver(_)) | |
188 .Times(AnyNumber()); | |
189 EXPECT_CALL(*mock_cras_audio_client_.get(), RemoveObserver(_)) | |
190 .Times(AnyNumber()); | |
191 EXPECT_CALL(*mock_cras_audio_client_.get(), HasObserver(_)) | |
192 .Times(AnyNumber()); | |
193 EXPECT_CALL(*mock_session_manager_client_.get(), AddObserver(_)) | 183 EXPECT_CALL(*mock_session_manager_client_.get(), AddObserver(_)) |
194 .Times(AnyNumber()); | 184 .Times(AnyNumber()); |
195 EXPECT_CALL(*mock_session_manager_client_.get(), RemoveObserver(_)) | 185 EXPECT_CALL(*mock_session_manager_client_.get(), RemoveObserver(_)) |
196 .Times(AnyNumber()); | 186 .Times(AnyNumber()); |
197 EXPECT_CALL(*mock_session_manager_client_.get(), HasObserver(_)) | 187 EXPECT_CALL(*mock_session_manager_client_.get(), HasObserver(_)) |
198 .Times(AnyNumber()); | 188 .Times(AnyNumber()); |
199 EXPECT_CALL(*mock_update_engine_client_.get(), AddObserver(_)) | 189 EXPECT_CALL(*mock_update_engine_client_.get(), AddObserver(_)) |
200 .Times(AnyNumber()); | 190 .Times(AnyNumber()); |
201 EXPECT_CALL(*mock_system_clock_client_.get(), AddObserver(_)) | 191 EXPECT_CALL(*mock_system_clock_client_.get(), AddObserver(_)) |
202 .Times(AnyNumber()); | 192 .Times(AnyNumber()); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 observers_.AddObserver(observer); | 281 observers_.AddObserver(observer); |
292 } | 282 } |
293 | 283 |
294 void MockDBusThreadManager::RemoveObserver( | 284 void MockDBusThreadManager::RemoveObserver( |
295 DBusThreadManagerObserver* observer) { | 285 DBusThreadManagerObserver* observer) { |
296 DCHECK(observer); | 286 DCHECK(observer); |
297 observers_.RemoveObserver(observer); | 287 observers_.RemoveObserver(observer); |
298 } | 288 } |
299 | 289 |
300 } // namespace chromeos | 290 } // namespace chromeos |
OLD | NEW |