| 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 CHROME_BROWSER_CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 10 #include "chrome/browser/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 MockFlimflamIPConfigClient; |
| 29 class MockImageBurnerClient; | 30 class MockImageBurnerClient; |
| 30 class MockIntrospectableClient; | 31 class MockIntrospectableClient; |
| 31 class MockPowerManagerClient; | 32 class MockPowerManagerClient; |
| 32 class MockSessionManagerClient; | 33 class MockSessionManagerClient; |
| 33 class MockSpeechSynthesizerClient; | 34 class MockSpeechSynthesizerClient; |
| 34 class MockUpdateEngineClient; | 35 class MockUpdateEngineClient; |
| 35 | 36 |
| 36 // This class provides a mock DBusThreadManager with mock clients | 37 // This class provides a mock DBusThreadManager with mock clients |
| 37 // installed. You can customize the behaviors of mock clients with | 38 // installed. You can customize the behaviors of mock clients with |
| 38 // mock_foo_client() functions. | 39 // mock_foo_client() functions. |
| 39 class MockDBusThreadManager : public DBusThreadManager { | 40 class MockDBusThreadManager : public DBusThreadManager { |
| 40 public: | 41 public: |
| 41 MockDBusThreadManager(); | 42 MockDBusThreadManager(); |
| 42 virtual ~MockDBusThreadManager(); | 43 virtual ~MockDBusThreadManager(); |
| 43 | 44 |
| 44 MOCK_METHOD0(GetSystemBus, dbus::Bus*(void)); | 45 MOCK_METHOD0(GetSystemBus, dbus::Bus*(void)); |
| 45 MOCK_METHOD0(GetBluetoothAdapterClient, BluetoothAdapterClient*(void)); | 46 MOCK_METHOD0(GetBluetoothAdapterClient, BluetoothAdapterClient*(void)); |
| 46 MOCK_METHOD0(GetBluetoothDeviceClient, BluetoothDeviceClient*(void)); | 47 MOCK_METHOD0(GetBluetoothDeviceClient, BluetoothDeviceClient*(void)); |
| 47 MOCK_METHOD0(GetBluetoothInputClient, BluetoothInputClient*(void)); | 48 MOCK_METHOD0(GetBluetoothInputClient, BluetoothInputClient*(void)); |
| 48 MOCK_METHOD0(GetBluetoothManagerClient, BluetoothManagerClient*(void)); | 49 MOCK_METHOD0(GetBluetoothManagerClient, BluetoothManagerClient*(void)); |
| 49 MOCK_METHOD0(GetBluetoothNodeClient, BluetoothNodeClient*(void)); | 50 MOCK_METHOD0(GetBluetoothNodeClient, BluetoothNodeClient*(void)); |
| 50 MOCK_METHOD0(GetCashewClient, CashewClient*(void)); | 51 MOCK_METHOD0(GetCashewClient, CashewClient*(void)); |
| 51 MOCK_METHOD0(GetCrosDisksClient, CrosDisksClient*(void)); | 52 MOCK_METHOD0(GetCrosDisksClient, CrosDisksClient*(void)); |
| 52 MOCK_METHOD0(GetCryptohomeClient, CryptohomeClient*(void)); | 53 MOCK_METHOD0(GetCryptohomeClient, CryptohomeClient*(void)); |
| 54 MOCK_METHOD0(GetFlimflamIPConfigClient, FlimflamIPConfigClient*(void)); |
| 53 MOCK_METHOD0(GetImageBurnerClient, ImageBurnerClient*(void)); | 55 MOCK_METHOD0(GetImageBurnerClient, ImageBurnerClient*(void)); |
| 54 MOCK_METHOD0(GetIntrospectableClient, IntrospectableClient*(void)); | 56 MOCK_METHOD0(GetIntrospectableClient, IntrospectableClient*(void)); |
| 55 MOCK_METHOD0(GetPowerManagerClient, PowerManagerClient*(void)); | 57 MOCK_METHOD0(GetPowerManagerClient, PowerManagerClient*(void)); |
| 56 MOCK_METHOD0(GetSessionManagerClient, SessionManagerClient*(void)); | 58 MOCK_METHOD0(GetSessionManagerClient, SessionManagerClient*(void)); |
| 57 MOCK_METHOD0(GetSpeechSynthesizerClient, SpeechSynthesizerClient*(void)); | 59 MOCK_METHOD0(GetSpeechSynthesizerClient, SpeechSynthesizerClient*(void)); |
| 58 MOCK_METHOD0(GetUpdateEngineClient, UpdateEngineClient*(void)); | 60 MOCK_METHOD0(GetUpdateEngineClient, UpdateEngineClient*(void)); |
| 59 | 61 |
| 60 MockBluetoothAdapterClient* mock_bluetooth_adapter_client() { | 62 MockBluetoothAdapterClient* mock_bluetooth_adapter_client() { |
| 61 return mock_bluetooth_adapter_client_.get(); | 63 return mock_bluetooth_adapter_client_.get(); |
| 62 } | 64 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 74 } | 76 } |
| 75 MockCashewClient* mock_cashew_client() { | 77 MockCashewClient* mock_cashew_client() { |
| 76 return mock_cashew_client_.get(); | 78 return mock_cashew_client_.get(); |
| 77 } | 79 } |
| 78 MockCrosDisksClient* mock_cros_disks_client() { | 80 MockCrosDisksClient* mock_cros_disks_client() { |
| 79 return mock_cros_disks_client_.get(); | 81 return mock_cros_disks_client_.get(); |
| 80 } | 82 } |
| 81 MockCryptohomeClient* mock_cryptohome_client() { | 83 MockCryptohomeClient* mock_cryptohome_client() { |
| 82 return mock_cryptohome_client_.get(); | 84 return mock_cryptohome_client_.get(); |
| 83 } | 85 } |
| 86 MockFlimflamIPConfigClient* mock_flimflam_ipconfig_client() { |
| 87 return mock_flimflam_ipconfig_client_.get(); |
| 88 } |
| 84 MockImageBurnerClient* mock_image_burner_client() { | 89 MockImageBurnerClient* mock_image_burner_client() { |
| 85 return mock_image_burner_client_.get(); | 90 return mock_image_burner_client_.get(); |
| 86 } | 91 } |
| 87 MockIntrospectableClient* mock_introspectable_client() { | 92 MockIntrospectableClient* mock_introspectable_client() { |
| 88 return mock_introspectable_client_.get(); | 93 return mock_introspectable_client_.get(); |
| 89 } | 94 } |
| 90 MockPowerManagerClient* mock_power_manager_client() { | 95 MockPowerManagerClient* mock_power_manager_client() { |
| 91 return mock_power_manager_client_.get(); | 96 return mock_power_manager_client_.get(); |
| 92 } | 97 } |
| 93 MockSessionManagerClient* mock_session_manager_client() { | 98 MockSessionManagerClient* mock_session_manager_client() { |
| 94 return mock_session_manager_client_.get(); | 99 return mock_session_manager_client_.get(); |
| 95 } | 100 } |
| 96 MockSpeechSynthesizerClient* mock_speech_synthesizer_client() { | 101 MockSpeechSynthesizerClient* mock_speech_synthesizer_client() { |
| 97 return mock_speech_synthesizer_client_.get(); | 102 return mock_speech_synthesizer_client_.get(); |
| 98 } | 103 } |
| 99 MockUpdateEngineClient* mock_update_engine_client() { | 104 MockUpdateEngineClient* mock_update_engine_client() { |
| 100 return mock_update_engine_client_.get(); | 105 return mock_update_engine_client_.get(); |
| 101 } | 106 } |
| 102 | 107 |
| 103 private: | 108 private: |
| 104 scoped_ptr<MockBluetoothAdapterClient> mock_bluetooth_adapter_client_; | 109 scoped_ptr<MockBluetoothAdapterClient> mock_bluetooth_adapter_client_; |
| 105 scoped_ptr<MockBluetoothDeviceClient> mock_bluetooth_device_client_; | 110 scoped_ptr<MockBluetoothDeviceClient> mock_bluetooth_device_client_; |
| 106 scoped_ptr<MockBluetoothInputClient> mock_bluetooth_input_client_; | 111 scoped_ptr<MockBluetoothInputClient> mock_bluetooth_input_client_; |
| 107 scoped_ptr<MockBluetoothManagerClient> mock_bluetooth_manager_client_; | 112 scoped_ptr<MockBluetoothManagerClient> mock_bluetooth_manager_client_; |
| 108 scoped_ptr<MockBluetoothNodeClient> mock_bluetooth_node_client_; | 113 scoped_ptr<MockBluetoothNodeClient> mock_bluetooth_node_client_; |
| 109 scoped_ptr<MockCashewClient> mock_cashew_client_; | 114 scoped_ptr<MockCashewClient> mock_cashew_client_; |
| 110 scoped_ptr<MockCrosDisksClient> mock_cros_disks_client_; | 115 scoped_ptr<MockCrosDisksClient> mock_cros_disks_client_; |
| 111 scoped_ptr<MockCryptohomeClient> mock_cryptohome_client_; | 116 scoped_ptr<MockCryptohomeClient> mock_cryptohome_client_; |
| 117 scoped_ptr<MockFlimflamIPConfigClient> mock_flimflam_ipconfig_client_; |
| 112 scoped_ptr<MockImageBurnerClient> mock_image_burner_client_; | 118 scoped_ptr<MockImageBurnerClient> mock_image_burner_client_; |
| 113 scoped_ptr<MockIntrospectableClient> mock_introspectable_client_; | 119 scoped_ptr<MockIntrospectableClient> mock_introspectable_client_; |
| 114 scoped_ptr<MockPowerManagerClient> mock_power_manager_client_; | 120 scoped_ptr<MockPowerManagerClient> mock_power_manager_client_; |
| 115 scoped_ptr<MockSessionManagerClient> mock_session_manager_client_; | 121 scoped_ptr<MockSessionManagerClient> mock_session_manager_client_; |
| 116 scoped_ptr<MockSpeechSynthesizerClient> mock_speech_synthesizer_client_; | 122 scoped_ptr<MockSpeechSynthesizerClient> mock_speech_synthesizer_client_; |
| 117 scoped_ptr<MockUpdateEngineClient> mock_update_engine_client_; | 123 scoped_ptr<MockUpdateEngineClient> mock_update_engine_client_; |
| 118 | 124 |
| 119 DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManager); | 125 DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManager); |
| 120 }; | 126 }; |
| 121 | 127 |
| 122 } // namespace chromeos | 128 } // namespace chromeos |
| 123 | 129 |
| 124 #endif // CHROME_BROWSER_CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ | 130 #endif // CHROME_BROWSER_CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ |
| OLD | NEW |