OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 |
| 13 namespace chromeos { |
| 14 |
| 15 class MockBluetoothManagerClient; |
| 16 class MockBluetoothAdapterClient; |
| 17 class MockPowerManagerClient; |
| 18 class MockSensorsClient; |
| 19 class MockSessionManagerClient; |
| 20 class MockSpeechSynthesizerClient; |
| 21 |
| 22 // This class provides a mock DBusThreadManager with mock clients |
| 23 // installed. You can customize the behaviors of mock clients with |
| 24 // mock_foo_client() functions. |
| 25 class MockDBusThreadManager : public DBusThreadManager { |
| 26 public: |
| 27 MockDBusThreadManager(); |
| 28 virtual ~MockDBusThreadManager(); |
| 29 |
| 30 MOCK_METHOD0(bluetooth_adapter_client, BluetoothAdapterClient*(void)); |
| 31 MOCK_METHOD0(bluetooth_manager_client, BluetoothManagerClient*(void)); |
| 32 MOCK_METHOD0(power_manager_client, PowerManagerClient*(void)); |
| 33 MOCK_METHOD0(sensors_client, SensorsClient*(void)); |
| 34 MOCK_METHOD0(session_manager_client, SessionManagerClient*(void)); |
| 35 MOCK_METHOD1(set_session_manager_client_for_testing, |
| 36 void(SessionManagerClient*)); |
| 37 MOCK_METHOD0(speech_synthesizer_client, SpeechSynthesizerClient*(void)); |
| 38 |
| 39 MockBluetoothAdapterClient* mock_bluetooth_adapter_client() { |
| 40 return mock_bluetooth_adapter_client_.get(); |
| 41 } |
| 42 MockBluetoothManagerClient* mock_bluetooth_manager_client() { |
| 43 return mock_bluetooth_manager_client_.get(); |
| 44 } |
| 45 MockPowerManagerClient* mock_power_manager_client() { |
| 46 return mock_power_manager_client_.get(); |
| 47 } |
| 48 MockSensorsClient* mock_sensors_client() { |
| 49 return mock_sensors_client_.get(); |
| 50 } |
| 51 MockSessionManagerClient* mock_session_manager_client() { |
| 52 return mock_session_manager_client_.get(); |
| 53 } |
| 54 MockSpeechSynthesizerClient* mock_speech_synthesizer_client() { |
| 55 return mock_speech_synthesizer_client_.get(); |
| 56 } |
| 57 |
| 58 private: |
| 59 scoped_ptr<MockBluetoothAdapterClient> mock_bluetooth_adapter_client_; |
| 60 scoped_ptr<MockBluetoothManagerClient> mock_bluetooth_manager_client_; |
| 61 scoped_ptr<MockPowerManagerClient> mock_power_manager_client_; |
| 62 scoped_ptr<MockSensorsClient> mock_sensors_client_; |
| 63 scoped_ptr<MockSessionManagerClient> mock_session_manager_client_; |
| 64 scoped_ptr<MockSpeechSynthesizerClient> mock_speech_synthesizer_client_; |
| 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManager); |
| 67 }; |
| 68 |
| 69 } // namespace chromeos |
| 70 |
| 71 #endif // CHROME_BROWSER_CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ |
OLD | NEW |