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
3 // found in the LICENSE file.
5 #ifndef CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_
6 #define CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_
10 #include "base/observer_list.h"
11 #include "chromeos/dbus/dbus_thread_manager.h"
12 #include "testing/gmock/include/gmock/gmock.h"
22 class DBusThreadManagerObserver
;
23 class MockBluetoothAdapterClient
;
24 class MockBluetoothDeviceClient
;
25 class MockBluetoothInputClient
;
26 class MockBluetoothManagerClient
;
27 class MockBluetoothNodeClient
;
28 class MockBluetoothOutOfBandClient
;
29 class MockCrosDisksClient
;
30 class MockCryptohomeClient
;
31 class MockDebugDaemonClient
;
32 class MockShillDeviceClient
;
33 class MockShillIPConfigClient
;
34 class MockShillManagerClient
;
35 class MockShillNetworkClient
;
36 class MockShillProfileClient
;
37 class MockShillServiceClient
;
38 class MockGsmSMSClient
;
39 class MockImageBurnerClient
;
40 class MockIntrospectableClient
;
41 class MockModemMessagingClient
;
42 class MockPermissionBrokerClient
;
43 class MockPowerManagerClient
;
44 class MockRootPowerManagerClient
;
45 class MockSessionManagerClient
;
47 class MockSpeechSynthesizerClient
;
48 class MockUpdateEngineClient
;
50 // This class provides a mock DBusThreadManager with mock clients
51 // installed. You can customize the behaviors of mock clients with
52 // mock_foo_client() functions.
53 class MockDBusThreadManager
: public DBusThreadManager
{
55 MockDBusThreadManager();
56 virtual ~MockDBusThreadManager();
58 void AddObserver(DBusThreadManagerObserver
* observer
) OVERRIDE
;
59 void RemoveObserver(DBusThreadManagerObserver
* observer
) OVERRIDE
;
60 MOCK_METHOD1(InitIBusBus
, void(const std::string
& ibus_address
));
61 MOCK_METHOD0(GetSystemBus
, dbus::Bus
*(void));
62 MOCK_METHOD0(GetIBusBus
, dbus::Bus
*(void));
63 MOCK_METHOD0(GetBluetoothAdapterClient
, BluetoothAdapterClient
*(void));
64 MOCK_METHOD0(GetBluetoothDeviceClient
, BluetoothDeviceClient
*(void));
65 MOCK_METHOD0(GetBluetoothInputClient
, BluetoothInputClient
*(void));
66 MOCK_METHOD0(GetBluetoothManagerClient
, BluetoothManagerClient
*(void));
67 MOCK_METHOD0(GetBluetoothNodeClient
, BluetoothNodeClient
*(void));
68 MOCK_METHOD0(GetBluetoothOutOfBandClient
, BluetoothOutOfBandClient
*(void));
69 MOCK_METHOD0(GetCrosDisksClient
, CrosDisksClient
*(void));
70 MOCK_METHOD0(GetCryptohomeClient
, CryptohomeClient
*(void));
71 MOCK_METHOD0(GetDebugDaemonClient
, DebugDaemonClient
*(void));
72 MOCK_METHOD0(GetShillDeviceClient
, ShillDeviceClient
*(void));
73 MOCK_METHOD0(GetShillIPConfigClient
, ShillIPConfigClient
*(void));
74 MOCK_METHOD0(GetShillManagerClient
, ShillManagerClient
*(void));
75 MOCK_METHOD0(GetShillNetworkClient
, ShillNetworkClient
*(void));
76 MOCK_METHOD0(GetShillProfileClient
, ShillProfileClient
*(void));
77 MOCK_METHOD0(GetShillServiceClient
, ShillServiceClient
*(void));
78 MOCK_METHOD0(GetGsmSMSClient
, GsmSMSClient
*(void));
79 MOCK_METHOD0(GetImageBurnerClient
, ImageBurnerClient
*(void));
80 MOCK_METHOD0(GetIntrospectableClient
, IntrospectableClient
*(void));
81 MOCK_METHOD0(GetModemMessagingClient
, ModemMessagingClient
*(void));
82 MOCK_METHOD0(GetPermissionBrokerClient
, PermissionBrokerClient
*(void));
83 MOCK_METHOD0(GetPowerManagerClient
, PowerManagerClient
*(void));
84 MOCK_METHOD0(GetRootPowerManagerClient
, RootPowerManagerClient
*(void));
85 MOCK_METHOD0(GetSessionManagerClient
, SessionManagerClient
*(void));
86 MOCK_METHOD0(GetSMSClient
, SMSClient
*(void));
87 MOCK_METHOD0(GetSpeechSynthesizerClient
, SpeechSynthesizerClient
*(void));
88 MOCK_METHOD0(GetUpdateEngineClient
, UpdateEngineClient
*(void));
89 MOCK_METHOD0(GetIBusClient
, IBusClient
*(void));
90 MOCK_METHOD0(GetIBusConfigClient
, IBusConfigClient
*(void));
91 MOCK_METHOD0(GetIBusInputContextClient
, IBusInputContextClient
*(void));
92 MOCK_METHOD0(GetIBusEngineFactoryService
, IBusEngineFactoryService
*(void));
93 MOCK_METHOD1(GetIBusEngineService
,
94 IBusEngineService
*(const dbus::ObjectPath
& object_path
));
95 MOCK_METHOD1(RemoveIBusEngineService
,
96 void(const dbus::ObjectPath
& object_path
));
97 MOCK_METHOD0(GetIBusPanelService
, ibus::IBusPanelService
*(void));
99 MockBluetoothAdapterClient
* mock_bluetooth_adapter_client() {
100 return mock_bluetooth_adapter_client_
.get();
102 MockBluetoothDeviceClient
* mock_bluetooth_device_client() {
103 return mock_bluetooth_device_client_
.get();
105 MockBluetoothInputClient
* mock_bluetooth_input_client() {
106 return mock_bluetooth_input_client_
.get();
108 MockBluetoothManagerClient
* mock_bluetooth_manager_client() {
109 return mock_bluetooth_manager_client_
.get();
111 MockBluetoothNodeClient
* mock_bluetooth_node_client() {
112 return mock_bluetooth_node_client_
.get();
114 MockBluetoothOutOfBandClient
* mock_bluetooth_out_of_band_client() {
115 return mock_bluetooth_out_of_band_client_
.get();
117 MockCrosDisksClient
* mock_cros_disks_client() {
118 return mock_cros_disks_client_
.get();
120 MockCryptohomeClient
* mock_cryptohome_client() {
121 return mock_cryptohome_client_
.get();
123 MockDebugDaemonClient
* mock_debugdaemon_client() {
124 return mock_debugdaemon_client_
.get();
126 MockShillDeviceClient
* mock_shill_device_client() {
127 return mock_shill_device_client_
.get();
129 MockShillIPConfigClient
* mock_shill_ipconfig_client() {
130 return mock_shill_ipconfig_client_
.get();
132 MockShillManagerClient
* mock_shill_manager_client() {
133 return mock_shill_manager_client_
.get();
135 MockShillNetworkClient
* mock_shill_network_client() {
136 return mock_shill_network_client_
.get();
138 MockShillProfileClient
* mock_shill_profile_client() {
139 return mock_shill_profile_client_
.get();
141 MockShillServiceClient
* mock_shill_service_client() {
142 return mock_shill_service_client_
.get();
144 MockGsmSMSClient
* mock_gsm_sms_client() {
145 return mock_gsm_sms_client_
.get();
147 MockImageBurnerClient
* mock_image_burner_client() {
148 return mock_image_burner_client_
.get();
150 MockIntrospectableClient
* mock_introspectable_client() {
151 return mock_introspectable_client_
.get();
153 MockModemMessagingClient
* mock_modem_messaging_client() {
154 return mock_modem_messaging_client_
.get();
156 MockPermissionBrokerClient
* mock_permission_broker_client() {
157 return mock_permission_broker_client_
.get();
159 MockPowerManagerClient
* mock_power_manager_client() {
160 return mock_power_manager_client_
.get();
162 MockRootPowerManagerClient
* mock_root_power_manager_client() {
163 return mock_root_power_manager_client_
.get();
165 MockSessionManagerClient
* mock_session_manager_client() {
166 return mock_session_manager_client_
.get();
168 MockSMSClient
* mock_sms_client() {
169 return mock_sms_client_
.get();
171 MockSpeechSynthesizerClient
* mock_speech_synthesizer_client() {
172 return mock_speech_synthesizer_client_
.get();
174 MockUpdateEngineClient
* mock_update_engine_client() {
175 return mock_update_engine_client_
.get();
179 scoped_ptr
<MockBluetoothAdapterClient
> mock_bluetooth_adapter_client_
;
180 scoped_ptr
<MockBluetoothDeviceClient
> mock_bluetooth_device_client_
;
181 scoped_ptr
<MockBluetoothInputClient
> mock_bluetooth_input_client_
;
182 scoped_ptr
<MockBluetoothManagerClient
> mock_bluetooth_manager_client_
;
183 scoped_ptr
<MockBluetoothNodeClient
> mock_bluetooth_node_client_
;
184 scoped_ptr
<MockBluetoothOutOfBandClient
> mock_bluetooth_out_of_band_client_
;
185 scoped_ptr
<MockCrosDisksClient
> mock_cros_disks_client_
;
186 scoped_ptr
<MockCryptohomeClient
> mock_cryptohome_client_
;
187 scoped_ptr
<MockDebugDaemonClient
> mock_debugdaemon_client_
;
188 scoped_ptr
<MockShillDeviceClient
> mock_shill_device_client_
;
189 scoped_ptr
<MockShillIPConfigClient
> mock_shill_ipconfig_client_
;
190 scoped_ptr
<MockShillManagerClient
> mock_shill_manager_client_
;
191 scoped_ptr
<MockShillNetworkClient
> mock_shill_network_client_
;
192 scoped_ptr
<MockShillProfileClient
> mock_shill_profile_client_
;
193 scoped_ptr
<MockShillServiceClient
> mock_shill_service_client_
;
194 scoped_ptr
<MockGsmSMSClient
> mock_gsm_sms_client_
;
195 scoped_ptr
<MockImageBurnerClient
> mock_image_burner_client_
;
196 scoped_ptr
<MockIntrospectableClient
> mock_introspectable_client_
;
197 scoped_ptr
<MockModemMessagingClient
> mock_modem_messaging_client_
;
198 scoped_ptr
<MockPermissionBrokerClient
> mock_permission_broker_client_
;
199 scoped_ptr
<MockPowerManagerClient
> mock_power_manager_client_
;
200 scoped_ptr
<MockRootPowerManagerClient
> mock_root_power_manager_client_
;
201 scoped_ptr
<MockSessionManagerClient
> mock_session_manager_client_
;
202 scoped_ptr
<MockSMSClient
> mock_sms_client_
;
203 scoped_ptr
<MockSpeechSynthesizerClient
> mock_speech_synthesizer_client_
;
204 scoped_ptr
<MockUpdateEngineClient
> mock_update_engine_client_
;
206 ObserverList
<DBusThreadManagerObserver
> observers_
;
208 DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManager
);
211 } // namespace chromeos
213 #endif // CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_