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 #ifndef CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ | 5 #ifndef CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ |
6 #define CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ | 6 #define CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chromeos/dbus/dbus_thread_manager.h" | 10 #include "chromeos/dbus/dbus_thread_manager.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 | 12 |
13 namespace dbus { | 13 namespace dbus { |
14 | 14 |
15 class Bus; | 15 class Bus; |
16 | 16 |
17 } // namespace dbus | 17 } // namespace dbus |
18 | 18 |
19 namespace chromeos { | 19 namespace chromeos { |
20 | 20 |
21 class MockBluetoothAdapterClient; | 21 class MockBluetoothAdapterClient; |
22 class MockBluetoothDeviceClient; | 22 class MockBluetoothDeviceClient; |
23 class MockBluetoothInputClient; | 23 class MockBluetoothInputClient; |
24 class MockBluetoothManagerClient; | 24 class MockBluetoothManagerClient; |
25 class MockBluetoothNodeClient; | 25 class MockBluetoothNodeClient; |
26 class MockCashewClient; | 26 class MockCashewClient; |
27 class MockCrosDisksClient; | 27 class MockCrosDisksClient; |
28 class MockCryptohomeClient; | 28 class MockCryptohomeClient; |
29 class MockDebugDaemonClient; | 29 class MockDebugDaemonClient; |
| 30 class MockFlimflamDeviceClient; |
30 class MockFlimflamIPConfigClient; | 31 class MockFlimflamIPConfigClient; |
31 class MockFlimflamManagerClient; | 32 class MockFlimflamManagerClient; |
32 class MockFlimflamNetworkClient; | 33 class MockFlimflamNetworkClient; |
33 class MockFlimflamProfileClient; | 34 class MockFlimflamProfileClient; |
34 class MockImageBurnerClient; | 35 class MockImageBurnerClient; |
35 class MockIntrospectableClient; | 36 class MockIntrospectableClient; |
36 class MockPowerManagerClient; | 37 class MockPowerManagerClient; |
37 class MockSessionManagerClient; | 38 class MockSessionManagerClient; |
38 class MockSpeechSynthesizerClient; | 39 class MockSpeechSynthesizerClient; |
39 class MockUpdateEngineClient; | 40 class MockUpdateEngineClient; |
40 | 41 |
41 // This class provides a mock DBusThreadManager with mock clients | 42 // This class provides a mock DBusThreadManager with mock clients |
42 // installed. You can customize the behaviors of mock clients with | 43 // installed. You can customize the behaviors of mock clients with |
43 // mock_foo_client() functions. | 44 // mock_foo_client() functions. |
44 class MockDBusThreadManager : public DBusThreadManager { | 45 class MockDBusThreadManager : public DBusThreadManager { |
45 public: | 46 public: |
46 MockDBusThreadManager(); | 47 MockDBusThreadManager(); |
47 virtual ~MockDBusThreadManager(); | 48 virtual ~MockDBusThreadManager(); |
48 | 49 |
49 MOCK_METHOD0(GetSystemBus, dbus::Bus*(void)); | 50 MOCK_METHOD0(GetSystemBus, dbus::Bus*(void)); |
50 MOCK_METHOD0(GetBluetoothAdapterClient, BluetoothAdapterClient*(void)); | 51 MOCK_METHOD0(GetBluetoothAdapterClient, BluetoothAdapterClient*(void)); |
51 MOCK_METHOD0(GetBluetoothDeviceClient, BluetoothDeviceClient*(void)); | 52 MOCK_METHOD0(GetBluetoothDeviceClient, BluetoothDeviceClient*(void)); |
52 MOCK_METHOD0(GetBluetoothInputClient, BluetoothInputClient*(void)); | 53 MOCK_METHOD0(GetBluetoothInputClient, BluetoothInputClient*(void)); |
53 MOCK_METHOD0(GetBluetoothManagerClient, BluetoothManagerClient*(void)); | 54 MOCK_METHOD0(GetBluetoothManagerClient, BluetoothManagerClient*(void)); |
54 MOCK_METHOD0(GetBluetoothNodeClient, BluetoothNodeClient*(void)); | 55 MOCK_METHOD0(GetBluetoothNodeClient, BluetoothNodeClient*(void)); |
55 MOCK_METHOD0(GetCashewClient, CashewClient*(void)); | 56 MOCK_METHOD0(GetCashewClient, CashewClient*(void)); |
56 MOCK_METHOD0(GetCrosDisksClient, CrosDisksClient*(void)); | 57 MOCK_METHOD0(GetCrosDisksClient, CrosDisksClient*(void)); |
57 MOCK_METHOD0(GetCryptohomeClient, CryptohomeClient*(void)); | 58 MOCK_METHOD0(GetCryptohomeClient, CryptohomeClient*(void)); |
58 MOCK_METHOD0(GetDebugDaemonClient, DebugDaemonClient*(void)); | 59 MOCK_METHOD0(GetDebugDaemonClient, DebugDaemonClient*(void)); |
| 60 MOCK_METHOD0(GetFlimflamDeviceClient, FlimflamDeviceClient*(void)); |
59 MOCK_METHOD0(GetFlimflamIPConfigClient, FlimflamIPConfigClient*(void)); | 61 MOCK_METHOD0(GetFlimflamIPConfigClient, FlimflamIPConfigClient*(void)); |
60 MOCK_METHOD0(GetFlimflamManagerClient, FlimflamManagerClient*(void)); | 62 MOCK_METHOD0(GetFlimflamManagerClient, FlimflamManagerClient*(void)); |
61 MOCK_METHOD0(GetFlimflamNetworkClient, FlimflamNetworkClient*(void)); | 63 MOCK_METHOD0(GetFlimflamNetworkClient, FlimflamNetworkClient*(void)); |
62 MOCK_METHOD0(GetFlimflamProfileClient, FlimflamProfileClient*(void)); | 64 MOCK_METHOD0(GetFlimflamProfileClient, FlimflamProfileClient*(void)); |
63 MOCK_METHOD0(GetImageBurnerClient, ImageBurnerClient*(void)); | 65 MOCK_METHOD0(GetImageBurnerClient, ImageBurnerClient*(void)); |
64 MOCK_METHOD0(GetIntrospectableClient, IntrospectableClient*(void)); | 66 MOCK_METHOD0(GetIntrospectableClient, IntrospectableClient*(void)); |
65 MOCK_METHOD0(GetPowerManagerClient, PowerManagerClient*(void)); | 67 MOCK_METHOD0(GetPowerManagerClient, PowerManagerClient*(void)); |
66 MOCK_METHOD0(GetSessionManagerClient, SessionManagerClient*(void)); | 68 MOCK_METHOD0(GetSessionManagerClient, SessionManagerClient*(void)); |
67 MOCK_METHOD0(GetSpeechSynthesizerClient, SpeechSynthesizerClient*(void)); | 69 MOCK_METHOD0(GetSpeechSynthesizerClient, SpeechSynthesizerClient*(void)); |
68 MOCK_METHOD0(GetUpdateEngineClient, UpdateEngineClient*(void)); | 70 MOCK_METHOD0(GetUpdateEngineClient, UpdateEngineClient*(void)); |
(...skipping 18 matching lines...) Expand all Loading... |
87 } | 89 } |
88 MockCrosDisksClient* mock_cros_disks_client() { | 90 MockCrosDisksClient* mock_cros_disks_client() { |
89 return mock_cros_disks_client_.get(); | 91 return mock_cros_disks_client_.get(); |
90 } | 92 } |
91 MockCryptohomeClient* mock_cryptohome_client() { | 93 MockCryptohomeClient* mock_cryptohome_client() { |
92 return mock_cryptohome_client_.get(); | 94 return mock_cryptohome_client_.get(); |
93 } | 95 } |
94 MockDebugDaemonClient* mock_debugdaemon_client() { | 96 MockDebugDaemonClient* mock_debugdaemon_client() { |
95 return mock_debugdaemon_client_.get(); | 97 return mock_debugdaemon_client_.get(); |
96 } | 98 } |
| 99 MockFlimflamDeviceClient* mock_flimflam_device_client() { |
| 100 return mock_flimflam_device_client_.get(); |
| 101 } |
97 MockFlimflamIPConfigClient* mock_flimflam_ipconfig_client() { | 102 MockFlimflamIPConfigClient* mock_flimflam_ipconfig_client() { |
98 return mock_flimflam_ipconfig_client_.get(); | 103 return mock_flimflam_ipconfig_client_.get(); |
99 } | 104 } |
100 MockFlimflamManagerClient* mock_flimflam_manager_client() { | 105 MockFlimflamManagerClient* mock_flimflam_manager_client() { |
101 return mock_flimflam_manager_client_.get(); | 106 return mock_flimflam_manager_client_.get(); |
102 } | 107 } |
103 MockFlimflamNetworkClient* mock_flimflam_network_client() { | 108 MockFlimflamNetworkClient* mock_flimflam_network_client() { |
104 return mock_flimflam_network_client_.get(); | 109 return mock_flimflam_network_client_.get(); |
105 } | 110 } |
106 MockFlimflamProfileClient* mock_flimflam_profile_client() { | 111 MockFlimflamProfileClient* mock_flimflam_profile_client() { |
(...skipping 21 matching lines...) Expand all Loading... |
128 private: | 133 private: |
129 scoped_ptr<MockBluetoothAdapterClient> mock_bluetooth_adapter_client_; | 134 scoped_ptr<MockBluetoothAdapterClient> mock_bluetooth_adapter_client_; |
130 scoped_ptr<MockBluetoothDeviceClient> mock_bluetooth_device_client_; | 135 scoped_ptr<MockBluetoothDeviceClient> mock_bluetooth_device_client_; |
131 scoped_ptr<MockBluetoothInputClient> mock_bluetooth_input_client_; | 136 scoped_ptr<MockBluetoothInputClient> mock_bluetooth_input_client_; |
132 scoped_ptr<MockBluetoothManagerClient> mock_bluetooth_manager_client_; | 137 scoped_ptr<MockBluetoothManagerClient> mock_bluetooth_manager_client_; |
133 scoped_ptr<MockBluetoothNodeClient> mock_bluetooth_node_client_; | 138 scoped_ptr<MockBluetoothNodeClient> mock_bluetooth_node_client_; |
134 scoped_ptr<MockCashewClient> mock_cashew_client_; | 139 scoped_ptr<MockCashewClient> mock_cashew_client_; |
135 scoped_ptr<MockCrosDisksClient> mock_cros_disks_client_; | 140 scoped_ptr<MockCrosDisksClient> mock_cros_disks_client_; |
136 scoped_ptr<MockCryptohomeClient> mock_cryptohome_client_; | 141 scoped_ptr<MockCryptohomeClient> mock_cryptohome_client_; |
137 scoped_ptr<MockDebugDaemonClient> mock_debugdaemon_client_; | 142 scoped_ptr<MockDebugDaemonClient> mock_debugdaemon_client_; |
| 143 scoped_ptr<MockFlimflamDeviceClient> mock_flimflam_device_client_; |
138 scoped_ptr<MockFlimflamIPConfigClient> mock_flimflam_ipconfig_client_; | 144 scoped_ptr<MockFlimflamIPConfigClient> mock_flimflam_ipconfig_client_; |
139 scoped_ptr<MockFlimflamManagerClient> mock_flimflam_manager_client_; | 145 scoped_ptr<MockFlimflamManagerClient> mock_flimflam_manager_client_; |
140 scoped_ptr<MockFlimflamNetworkClient> mock_flimflam_network_client_; | 146 scoped_ptr<MockFlimflamNetworkClient> mock_flimflam_network_client_; |
141 scoped_ptr<MockFlimflamProfileClient> mock_flimflam_profile_client_; | 147 scoped_ptr<MockFlimflamProfileClient> mock_flimflam_profile_client_; |
142 scoped_ptr<MockImageBurnerClient> mock_image_burner_client_; | 148 scoped_ptr<MockImageBurnerClient> mock_image_burner_client_; |
143 scoped_ptr<MockIntrospectableClient> mock_introspectable_client_; | 149 scoped_ptr<MockIntrospectableClient> mock_introspectable_client_; |
144 scoped_ptr<MockPowerManagerClient> mock_power_manager_client_; | 150 scoped_ptr<MockPowerManagerClient> mock_power_manager_client_; |
145 scoped_ptr<MockSessionManagerClient> mock_session_manager_client_; | 151 scoped_ptr<MockSessionManagerClient> mock_session_manager_client_; |
146 scoped_ptr<MockSpeechSynthesizerClient> mock_speech_synthesizer_client_; | 152 scoped_ptr<MockSpeechSynthesizerClient> mock_speech_synthesizer_client_; |
147 scoped_ptr<MockUpdateEngineClient> mock_update_engine_client_; | 153 scoped_ptr<MockUpdateEngineClient> mock_update_engine_client_; |
148 | 154 |
149 DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManager); | 155 DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManager); |
150 }; | 156 }; |
151 | 157 |
152 } // namespace chromeos | 158 } // namespace chromeos |
153 | 159 |
154 #endif // CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ | 160 #endif // CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ |
OLD | NEW |