Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 chromeos { | 13 namespace chromeos { |
| 14 | 14 |
| 15 class MockBluetoothManagerClient; | 15 class MockBluetoothManagerClient; |
| 16 class MockBluetoothAdapterClient; | 16 class MockBluetoothAdapterClient; |
| 17 class MockCrosDisksClient; | |
| 17 class MockPowerManagerClient; | 18 class MockPowerManagerClient; |
| 18 class MockSensorsClient; | 19 class MockSensorsClient; |
| 19 class MockSessionManagerClient; | 20 class MockSessionManagerClient; |
| 20 class MockSpeechSynthesizerClient; | 21 class MockSpeechSynthesizerClient; |
| 21 | 22 |
| 22 // This class provides a mock DBusThreadManager with mock clients | 23 // This class provides a mock DBusThreadManager with mock clients |
| 23 // installed. You can customize the behaviors of mock clients with | 24 // installed. You can customize the behaviors of mock clients with |
| 24 // mock_foo_client() functions. | 25 // mock_foo_client() functions. |
| 25 class MockDBusThreadManager : public DBusThreadManager { | 26 class MockDBusThreadManager : public DBusThreadManager { |
| 26 public: | 27 public: |
| 27 MockDBusThreadManager(); | 28 MockDBusThreadManager(); |
| 28 virtual ~MockDBusThreadManager(); | 29 virtual ~MockDBusThreadManager(); |
| 29 | 30 |
| 30 MOCK_METHOD0(GetBluetoothAdapterClient, BluetoothAdapterClient*(void)); | 31 MOCK_METHOD0(GetBluetoothAdapterClient, BluetoothAdapterClient*(void)); |
| 31 MOCK_METHOD0(GetBluetoothManagerClient, BluetoothManagerClient*(void)); | 32 MOCK_METHOD0(GetBluetoothManagerClient, BluetoothManagerClient*(void)); |
| 33 MOCK_METHOD0(GetCrosDisksClient, CrosDisksClient*(void)); | |
| 32 MOCK_METHOD0(GetPowerManagerClient, PowerManagerClient*(void)); | 34 MOCK_METHOD0(GetPowerManagerClient, PowerManagerClient*(void)); |
| 33 MOCK_METHOD0(GetSensorsClient, SensorsClient*(void)); | 35 MOCK_METHOD0(GetSensorsClient, SensorsClient*(void)); |
| 34 MOCK_METHOD0(GetSessionManagerClient, SessionManagerClient*(void)); | 36 MOCK_METHOD0(GetSessionManagerClient, SessionManagerClient*(void)); |
| 35 MOCK_METHOD0(GetSpeechSynthesizerClient, SpeechSynthesizerClient*(void)); | 37 MOCK_METHOD0(GetSpeechSynthesizerClient, SpeechSynthesizerClient*(void)); |
| 36 | 38 |
| 37 MockBluetoothAdapterClient* mock_bluetooth_adapter_client() { | 39 MockBluetoothAdapterClient* mock_bluetooth_adapter_client() { |
| 38 return mock_bluetooth_adapter_client_.get(); | 40 return mock_bluetooth_adapter_client_.get(); |
| 39 } | 41 } |
| 40 MockBluetoothManagerClient* mock_bluetooth_manager_client() { | 42 MockBluetoothManagerClient* mock_bluetooth_manager_client() { |
| 41 return mock_bluetooth_manager_client_.get(); | 43 return mock_bluetooth_manager_client_.get(); |
| 42 } | 44 } |
| 45 MockCrosDisksClient* mock_cros_disks_client() { | |
| 46 return mock_cros_disks_client_.get(); | |
| 47 } | |
| 43 MockPowerManagerClient* mock_power_manager_client() { | 48 MockPowerManagerClient* mock_power_manager_client() { |
| 44 return mock_power_manager_client_.get(); | 49 return mock_power_manager_client_.get(); |
| 45 } | 50 } |
| 46 MockSensorsClient* mock_sensors_client() { | 51 MockSensorsClient* mock_sensors_client() { |
| 47 return mock_sensors_client_.get(); | 52 return mock_sensors_client_.get(); |
| 48 } | 53 } |
| 49 MockSessionManagerClient* mock_session_manager_client() { | 54 MockSessionManagerClient* mock_session_manager_client() { |
| 50 return mock_session_manager_client_.get(); | 55 return mock_session_manager_client_.get(); |
| 51 } | 56 } |
| 52 MockSpeechSynthesizerClient* mock_speech_synthesizer_client() { | 57 MockSpeechSynthesizerClient* mock_speech_synthesizer_client() { |
| 53 return mock_speech_synthesizer_client_.get(); | 58 return mock_speech_synthesizer_client_.get(); |
| 54 } | 59 } |
| 55 | 60 |
| 56 private: | 61 private: |
| 57 scoped_ptr<MockBluetoothAdapterClient> mock_bluetooth_adapter_client_; | 62 scoped_ptr<MockBluetoothAdapterClient> mock_bluetooth_adapter_client_; |
| 58 scoped_ptr<MockBluetoothManagerClient> mock_bluetooth_manager_client_; | 63 scoped_ptr<MockBluetoothManagerClient> mock_bluetooth_manager_client_; |
| 64 scoped_ptr<MockCrosDisksClient> mock_cros_disks_client_; | |
| 59 scoped_ptr<MockPowerManagerClient> mock_power_manager_client_; | 65 scoped_ptr<MockPowerManagerClient> mock_power_manager_client_; |
| 60 scoped_ptr<MockSensorsClient> mock_sensors_client_; | 66 scoped_ptr<MockSensorsClient> mock_sensors_client_; |
| 61 scoped_ptr<MockSessionManagerClient> mock_session_manager_client_; | 67 scoped_ptr<MockSessionManagerClient> mock_session_manager_client_; |
| 62 scoped_ptr<MockSpeechSynthesizerClient> mock_speech_synthesizer_client_; | 68 scoped_ptr<MockSpeechSynthesizerClient> mock_speech_synthesizer_client_; |
| 63 | 69 |
| 64 DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManager); | 70 DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManager); |
| 65 }; | 71 }; |
| 66 | 72 |
| 67 } // namespace chromeos | 73 } // namespace chromeos |
| 68 | 74 |
| 75 | |
|
satorux1
2011/11/11 00:43:55
Please remove the two blank lines at the end.
hashimoto
2011/11/11 08:00:53
Done.
| |
| 69 #endif // CHROME_BROWSER_CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ | 76 #endif // CHROME_BROWSER_CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ |
| OLD | NEW |