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_FAKE_DBUS_THREAD_MANAGER_H_
6 #define CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_
10 #include "base/logging.h"
11 #include "base/observer_list.h"
12 #include "chromeos/chromeos_export.h"
13 #include "chromeos/dbus/dbus_thread_manager.h"
22 class DBusThreadManagerObserver
;
24 // This class provides a fake implementation of DBusThreadManager, which
25 // hosts fake D-Bus clients.
26 class CHROMEOS_EXPORT FakeDBusThreadManager
: public DBusThreadManager
{
28 FakeDBusThreadManager();
29 virtual ~FakeDBusThreadManager();
31 // Creates and sets all fake DBusClients and the PowerPolicyController.
32 void SetFakeClients();
34 // Creates and sets all fake Shill DBusClients.
35 void SetFakeShillClients();
37 void SetBluetoothAdapterClient(scoped_ptr
<BluetoothAdapterClient
> client
);
38 void SetBluetoothAgentManagerClient(
39 scoped_ptr
<BluetoothAgentManagerClient
> client
);
40 void SetBluetoothDeviceClient(scoped_ptr
<BluetoothDeviceClient
> client
);
41 void SetBluetoothInputClient(scoped_ptr
<BluetoothInputClient
> client
);
42 void SetBluetoothProfileManagerClient(
43 scoped_ptr
<BluetoothProfileManagerClient
> client
);
44 void SetCrasAudioClient(scoped_ptr
<CrasAudioClient
> client
);
45 void SetCrosDisksClient(scoped_ptr
<CrosDisksClient
> client
);
46 void SetCryptohomeClient(scoped_ptr
<CryptohomeClient
> client
);
47 void SetDebugDaemonClient(scoped_ptr
<DebugDaemonClient
> client
);
48 void SetShillDeviceClient(scoped_ptr
<ShillDeviceClient
> client
);
49 void SetShillIPConfigClient(scoped_ptr
<ShillIPConfigClient
> client
);
50 void SetShillManagerClient(scoped_ptr
<ShillManagerClient
> client
);
51 void SetShillServiceClient(scoped_ptr
<ShillServiceClient
> client
);
52 void SetShillProfileClient(scoped_ptr
<ShillProfileClient
> client
);
53 void SetGsmSMSClient(scoped_ptr
<GsmSMSClient
> client
);
54 void SetImageBurnerClient(scoped_ptr
<ImageBurnerClient
> client
);
55 void SetIntrospectableClient(scoped_ptr
<IntrospectableClient
> client
);
56 void SetModemMessagingClient(scoped_ptr
<ModemMessagingClient
> client
);
57 void SetNfcAdapterClient(scoped_ptr
<NfcAdapterClient
> client
);
58 void SetNfcDeviceClient(scoped_ptr
<NfcDeviceClient
> client
);
59 void SetNfcManagerClient(scoped_ptr
<NfcManagerClient
> client
);
60 void SetNfcRecordClient(scoped_ptr
<NfcRecordClient
> client
);
61 void SetNfcTagClient(scoped_ptr
<NfcTagClient
> client
);
62 void SetPermissionBrokerClient(scoped_ptr
<PermissionBrokerClient
> client
);
63 void SetPowerManagerClient(scoped_ptr
<PowerManagerClient
> client
);
64 void SetPowerPolicyController(scoped_ptr
<PowerPolicyController
> client
);
65 void SetSessionManagerClient(scoped_ptr
<SessionManagerClient
> client
);
66 void SetSMSClient(scoped_ptr
<SMSClient
> client
);
67 void SetSystemClockClient(scoped_ptr
<SystemClockClient
> client
);
68 void SetUpdateEngineClient(scoped_ptr
<UpdateEngineClient
> client
);
70 virtual void AddObserver(DBusThreadManagerObserver
* observer
) OVERRIDE
;
71 virtual void RemoveObserver(DBusThreadManagerObserver
* observer
) OVERRIDE
;
72 virtual dbus::Bus
* GetSystemBus() OVERRIDE
;
74 virtual BluetoothAdapterClient
* GetBluetoothAdapterClient() OVERRIDE
;
75 virtual BluetoothAgentManagerClient
*
76 GetBluetoothAgentManagerClient() OVERRIDE
;
77 virtual BluetoothDeviceClient
* GetBluetoothDeviceClient() OVERRIDE
;
78 virtual BluetoothInputClient
* GetBluetoothInputClient() OVERRIDE
;
79 virtual BluetoothProfileManagerClient
*
80 GetBluetoothProfileManagerClient() OVERRIDE
;
81 virtual CrasAudioClient
* GetCrasAudioClient() OVERRIDE
;
82 virtual CrosDisksClient
* GetCrosDisksClient() OVERRIDE
;
83 virtual CryptohomeClient
* GetCryptohomeClient() OVERRIDE
;
84 virtual DebugDaemonClient
* GetDebugDaemonClient() OVERRIDE
;
85 virtual ShillDeviceClient
* GetShillDeviceClient() OVERRIDE
;
86 virtual ShillIPConfigClient
* GetShillIPConfigClient() OVERRIDE
;
87 virtual ShillManagerClient
* GetShillManagerClient() OVERRIDE
;
88 virtual ShillProfileClient
* GetShillProfileClient() OVERRIDE
;
89 virtual ShillServiceClient
* GetShillServiceClient() OVERRIDE
;
90 virtual GsmSMSClient
* GetGsmSMSClient() OVERRIDE
;
91 virtual ImageBurnerClient
* GetImageBurnerClient() OVERRIDE
;
92 virtual IntrospectableClient
* GetIntrospectableClient() OVERRIDE
;
93 virtual ModemMessagingClient
* GetModemMessagingClient() OVERRIDE
;
94 virtual NfcAdapterClient
* GetNfcAdapterClient() OVERRIDE
;
95 virtual NfcDeviceClient
* GetNfcDeviceClient() OVERRIDE
;
96 virtual NfcManagerClient
* GetNfcManagerClient() OVERRIDE
;
97 virtual NfcRecordClient
* GetNfcRecordClient() OVERRIDE
;
98 virtual NfcTagClient
* GetNfcTagClient() OVERRIDE
;
99 virtual PermissionBrokerClient
* GetPermissionBrokerClient() OVERRIDE
;
100 virtual PowerManagerClient
* GetPowerManagerClient() OVERRIDE
;
101 virtual PowerPolicyController
* GetPowerPolicyController() OVERRIDE
;
102 virtual SessionManagerClient
* GetSessionManagerClient() OVERRIDE
;
103 virtual SMSClient
* GetSMSClient() OVERRIDE
;
104 virtual SystemClockClient
* GetSystemClockClient() OVERRIDE
;
105 virtual UpdateEngineClient
* GetUpdateEngineClient() OVERRIDE
;
108 // Note: Keep this before other members so they can call AddObserver() in
110 ObserverList
<DBusThreadManagerObserver
> observers_
;
112 scoped_ptr
<BluetoothAdapterClient
> bluetooth_adapter_client_
;
113 scoped_ptr
<BluetoothAgentManagerClient
> bluetooth_agent_manager_client_
;
114 scoped_ptr
<BluetoothDeviceClient
> bluetooth_device_client_
;
115 scoped_ptr
<BluetoothInputClient
> bluetooth_input_client_
;
116 scoped_ptr
<BluetoothProfileManagerClient
> bluetooth_profile_manager_client_
;
117 scoped_ptr
<CrasAudioClient
> cras_audio_client_
;
118 scoped_ptr
<CrosDisksClient
> cros_disks_client_
;
119 scoped_ptr
<CryptohomeClient
> cryptohome_client_
;
120 scoped_ptr
<DebugDaemonClient
> debug_daemon_client_
;
121 scoped_ptr
<ShillDeviceClient
> shill_device_client_
;
122 scoped_ptr
<ShillIPConfigClient
> shill_ipconfig_client_
;
123 scoped_ptr
<ShillManagerClient
> shill_manager_client_
;
124 scoped_ptr
<ShillServiceClient
> shill_service_client_
;
125 scoped_ptr
<ShillProfileClient
> shill_profile_client_
;
126 scoped_ptr
<GsmSMSClient
> gsm_sms_client_
;
127 scoped_ptr
<ImageBurnerClient
> image_burner_client_
;
128 scoped_ptr
<IntrospectableClient
> introspectable_client_
;
129 scoped_ptr
<ModemMessagingClient
> modem_messaging_client_
;
130 scoped_ptr
<NfcAdapterClient
> nfc_adapter_client_
;
131 scoped_ptr
<NfcDeviceClient
> nfc_device_client_
;
132 scoped_ptr
<NfcManagerClient
> nfc_manager_client_
;
133 scoped_ptr
<NfcRecordClient
> nfc_record_client_
;
134 scoped_ptr
<NfcTagClient
> nfc_tag_client_
;
135 scoped_ptr
<PermissionBrokerClient
> permission_broker_client_
;
136 scoped_ptr
<SystemClockClient
> system_clock_client_
;
137 scoped_ptr
<PowerManagerClient
> power_manager_client_
;
138 scoped_ptr
<SessionManagerClient
> session_manager_client_
;
139 scoped_ptr
<SMSClient
> sms_client_
;
140 scoped_ptr
<UpdateEngineClient
> update_engine_client_
;
142 scoped_ptr
<PowerPolicyController
> power_policy_controller_
;
144 DISALLOW_COPY_AND_ASSIGN(FakeDBusThreadManager
);
147 } // namespace chromeos
149 #endif // CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_