| 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 "base/observer_list.h" | 10 #include "base/observer_list.h" |
| 11 #include "chromeos/dbus/dbus_thread_manager.h" | 11 #include "chromeos/dbus/dbus_thread_manager.h" |
| 12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
| 13 | 13 |
| 14 namespace dbus { | 14 namespace dbus { |
| 15 | 15 |
| 16 class Bus; | 16 class Bus; |
| 17 | 17 |
| 18 } // namespace dbus | 18 } // namespace dbus |
| 19 | 19 |
| 20 namespace chromeos { | 20 namespace chromeos { |
| 21 | 21 |
| 22 class DBusThreadManagerObserver; | 22 class DBusThreadManagerObserver; |
| 23 class FakeBluetoothAdapterClient; | 23 class FakeBluetoothAdapterClient; |
| 24 class FakeBluetoothAgentManagerClient; | 24 class FakeBluetoothAgentManagerClient; |
| 25 class FakeBluetoothDeviceClient; | 25 class FakeBluetoothDeviceClient; |
| 26 class FakeBluetoothInputClient; | 26 class FakeBluetoothInputClient; |
| 27 class FakeBluetoothProfileManagerClient; | 27 class FakeBluetoothProfileManagerClient; |
| 28 class FakeGsmSMSClient; | 28 class FakeGsmSMSClient; |
| 29 class FakeShillDeviceClient; |
| 30 class FakeShillIPConfigClient; |
| 29 class MockCryptohomeClient; | 31 class MockCryptohomeClient; |
| 30 class MockShillDeviceClient; | 32 class MockPowerManagerClient; |
| 31 class MockShillIPConfigClient; | 33 class MockSessionManagerClient; |
| 32 class MockShillManagerClient; | 34 class MockShillManagerClient; |
| 33 class MockShillProfileClient; | 35 class MockShillProfileClient; |
| 34 class MockShillServiceClient; | 36 class MockShillServiceClient; |
| 35 class MockPowerManagerClient; | |
| 36 class MockSessionManagerClient; | |
| 37 | 37 |
| 38 // This class provides a mock DBusThreadManager with mock clients | 38 // This class provides a mock DBusThreadManager with mock clients |
| 39 // installed. You can customize the behaviors of mock clients with | 39 // installed. You can customize the behaviors of mock clients with |
| 40 // mock_foo_client() functions. | 40 // mock_foo_client() functions. |
| 41 // Please avoid adding more GMock in this class. We have an ongoing effort to | 41 // Please avoid adding more GMock in this class. We have an ongoing effort to |
| 42 // remove GMock dependency. TODO(haruki): crbug.com/223061. | 42 // remove GMock dependency. TODO(haruki): crbug.com/223061. |
| 43 class MockDBusThreadManager : public DBusThreadManager { | 43 class MockDBusThreadManager : public DBusThreadManager { |
| 44 public: | 44 public: |
| 45 MockDBusThreadManager(); | 45 MockDBusThreadManager(); |
| 46 virtual ~MockDBusThreadManager(); | 46 virtual ~MockDBusThreadManager(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 FakeBluetoothInputClient* fake_bluetooth_input_client() { | 97 FakeBluetoothInputClient* fake_bluetooth_input_client() { |
| 98 return fake_bluetooth_input_client_.get(); | 98 return fake_bluetooth_input_client_.get(); |
| 99 } | 99 } |
| 100 FakeBluetoothProfileManagerClient* fake_bluetooth_profile_manager_client() { | 100 FakeBluetoothProfileManagerClient* fake_bluetooth_profile_manager_client() { |
| 101 return fake_bluetooth_profile_manager_client_.get(); | 101 return fake_bluetooth_profile_manager_client_.get(); |
| 102 } | 102 } |
| 103 FakeGsmSMSClient* fake_gsm_sms_client() { | 103 FakeGsmSMSClient* fake_gsm_sms_client() { |
| 104 return fake_gsm_sms_client_.get(); | 104 return fake_gsm_sms_client_.get(); |
| 105 } | 105 } |
| 106 FakeShillDeviceClient* fake_shill_device_client() { |
| 107 return fake_shill_device_client_.get(); |
| 108 } |
| 109 FakeShillIPConfigClient* fake_shill_ipconfig_client() { |
| 110 return fake_shill_ipconfig_client_.get(); |
| 111 } |
| 106 MockCryptohomeClient* mock_cryptohome_client() { | 112 MockCryptohomeClient* mock_cryptohome_client() { |
| 107 return mock_cryptohome_client_.get(); | 113 return mock_cryptohome_client_.get(); |
| 108 } | 114 } |
| 109 MockShillDeviceClient* mock_shill_device_client() { | |
| 110 return mock_shill_device_client_.get(); | |
| 111 } | |
| 112 MockShillIPConfigClient* mock_shill_ipconfig_client() { | |
| 113 return mock_shill_ipconfig_client_.get(); | |
| 114 } | |
| 115 MockShillManagerClient* mock_shill_manager_client() { | 115 MockShillManagerClient* mock_shill_manager_client() { |
| 116 return mock_shill_manager_client_.get(); | 116 return mock_shill_manager_client_.get(); |
| 117 } | 117 } |
| 118 MockShillProfileClient* mock_shill_profile_client() { | 118 MockShillProfileClient* mock_shill_profile_client() { |
| 119 return mock_shill_profile_client_.get(); | 119 return mock_shill_profile_client_.get(); |
| 120 } | 120 } |
| 121 MockShillServiceClient* mock_shill_service_client() { | 121 MockShillServiceClient* mock_shill_service_client() { |
| 122 return mock_shill_service_client_.get(); | 122 return mock_shill_service_client_.get(); |
| 123 } | 123 } |
| 124 MockSessionManagerClient* mock_session_manager_client() { | 124 MockSessionManagerClient* mock_session_manager_client() { |
| 125 return mock_session_manager_client_.get(); | 125 return mock_session_manager_client_.get(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 private: | 128 private: |
| 129 // Note: Keep this before other members so they can call AddObserver() in | 129 // Note: Keep this before other members so they can call AddObserver() in |
| 130 // their c'tors. | 130 // their c'tors. |
| 131 ObserverList<DBusThreadManagerObserver> observers_; | 131 ObserverList<DBusThreadManagerObserver> observers_; |
| 132 | 132 |
| 133 scoped_ptr<FakeBluetoothAdapterClient> fake_bluetooth_adapter_client_; | 133 scoped_ptr<FakeBluetoothAdapterClient> fake_bluetooth_adapter_client_; |
| 134 scoped_ptr<FakeBluetoothAgentManagerClient> | 134 scoped_ptr<FakeBluetoothAgentManagerClient> |
| 135 fake_bluetooth_agent_manager_client_; | 135 fake_bluetooth_agent_manager_client_; |
| 136 scoped_ptr<FakeBluetoothDeviceClient> fake_bluetooth_device_client_; | 136 scoped_ptr<FakeBluetoothDeviceClient> fake_bluetooth_device_client_; |
| 137 scoped_ptr<FakeBluetoothInputClient> fake_bluetooth_input_client_; | 137 scoped_ptr<FakeBluetoothInputClient> fake_bluetooth_input_client_; |
| 138 scoped_ptr<FakeBluetoothProfileManagerClient> | 138 scoped_ptr<FakeBluetoothProfileManagerClient> |
| 139 fake_bluetooth_profile_manager_client_; | 139 fake_bluetooth_profile_manager_client_; |
| 140 scoped_ptr<FakeGsmSMSClient> fake_gsm_sms_client_; | 140 scoped_ptr<FakeGsmSMSClient> fake_gsm_sms_client_; |
| 141 scoped_ptr<FakeShillDeviceClient> fake_shill_device_client_; |
| 142 scoped_ptr<FakeShillIPConfigClient> fake_shill_ipconfig_client_; |
| 141 scoped_ptr<MockCryptohomeClient> mock_cryptohome_client_; | 143 scoped_ptr<MockCryptohomeClient> mock_cryptohome_client_; |
| 142 scoped_ptr<MockShillDeviceClient> mock_shill_device_client_; | |
| 143 scoped_ptr<MockShillIPConfigClient> mock_shill_ipconfig_client_; | |
| 144 scoped_ptr<MockShillManagerClient> mock_shill_manager_client_; | 144 scoped_ptr<MockShillManagerClient> mock_shill_manager_client_; |
| 145 scoped_ptr<MockShillProfileClient> mock_shill_profile_client_; | 145 scoped_ptr<MockShillProfileClient> mock_shill_profile_client_; |
| 146 scoped_ptr<MockShillServiceClient> mock_shill_service_client_; | 146 scoped_ptr<MockShillServiceClient> mock_shill_service_client_; |
| 147 scoped_ptr<MockSessionManagerClient> mock_session_manager_client_; | 147 scoped_ptr<MockSessionManagerClient> mock_session_manager_client_; |
| 148 | 148 |
| 149 DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManager); | 149 DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManager); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 } // namespace chromeos | 152 } // namespace chromeos |
| 153 | 153 |
| 154 #endif // CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ | 154 #endif // CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_H_ |
| OLD | NEW |