| 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_WITHOUT_GMOCK_H_ | 5 #ifndef CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_WITHOUT_GMOCK_H_ |
| 6 #define CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_WITHOUT_GMOCK_H_ | 6 #define CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_WITHOUT_GMOCK_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "chromeos/dbus/dbus_thread_manager.h" | 12 #include "chromeos/dbus/dbus_thread_manager.h" |
| 13 | 13 |
| 14 namespace dbus { | 14 namespace dbus { |
| 15 class Bus; | 15 class Bus; |
| 16 class ObjectPath; | 16 class ObjectPath; |
| 17 } // namespace dbus | 17 } // namespace dbus |
| 18 | 18 |
| 19 namespace chromeos { | 19 namespace chromeos { |
| 20 | 20 |
| 21 class DBusThreadManagerObserver; | 21 class DBusThreadManagerObserver; |
| 22 class FakeBluetoothAdapterClient; |
| 23 class FakeBluetoothAgentManagerClient; |
| 24 class FakeBluetoothDeviceClient; |
| 25 class FakeBluetoothProfileManagerClient; |
| 22 class MockIBusClient; | 26 class MockIBusClient; |
| 23 class MockIBusConfigClient; | 27 class MockIBusConfigClient; |
| 24 class MockIBusEngineFactoryService; | 28 class MockIBusEngineFactoryService; |
| 25 class MockIBusEngineService; | 29 class MockIBusEngineService; |
| 26 class MockIBusInputContextClient; | 30 class MockIBusInputContextClient; |
| 27 class MockIBusPanelService; | 31 class MockIBusPanelService; |
| 28 | 32 |
| 29 // This class provides an another mock DBusThreadManager without gmock | 33 // This class provides an another mock DBusThreadManager without gmock |
| 30 // dependency. This class is used only for places where GMock is not allowed | 34 // dependency. This class is used only for places where GMock is not allowed |
| 31 // (ex. ui/). | 35 // (ex. ui/). |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 virtual IBusClient* GetIBusClient() OVERRIDE; | 82 virtual IBusClient* GetIBusClient() OVERRIDE; |
| 79 virtual IBusConfigClient* GetIBusConfigClient() OVERRIDE; | 83 virtual IBusConfigClient* GetIBusConfigClient() OVERRIDE; |
| 80 virtual IBusInputContextClient* GetIBusInputContextClient() OVERRIDE; | 84 virtual IBusInputContextClient* GetIBusInputContextClient() OVERRIDE; |
| 81 virtual IBusEngineFactoryService* GetIBusEngineFactoryService() OVERRIDE; | 85 virtual IBusEngineFactoryService* GetIBusEngineFactoryService() OVERRIDE; |
| 82 virtual IBusEngineService* GetIBusEngineService( | 86 virtual IBusEngineService* GetIBusEngineService( |
| 83 const dbus::ObjectPath& object_path) OVERRIDE; | 87 const dbus::ObjectPath& object_path) OVERRIDE; |
| 84 virtual void RemoveIBusEngineService( | 88 virtual void RemoveIBusEngineService( |
| 85 const dbus::ObjectPath& object_path) OVERRIDE; | 89 const dbus::ObjectPath& object_path) OVERRIDE; |
| 86 virtual IBusPanelService* GetIBusPanelService() OVERRIDE; | 90 virtual IBusPanelService* GetIBusPanelService() OVERRIDE; |
| 87 | 91 |
| 92 FakeBluetoothAdapterClient* fake_bluetooth_adapter_client() { |
| 93 return fake_bluetooth_adapter_client_.get(); |
| 94 } |
| 95 |
| 96 FakeBluetoothAgentManagerClient* fake_bluetooth_agent_manager_client() { |
| 97 return fake_bluetooth_agent_manager_client_.get(); |
| 98 } |
| 99 |
| 100 FakeBluetoothDeviceClient* fake_bluetooth_device_client() { |
| 101 return fake_bluetooth_device_client_.get(); |
| 102 } |
| 103 |
| 104 FakeBluetoothProfileManagerClient* fake_bluetooth_profile_manager_client() { |
| 105 return fake_bluetooth_profile_manager_client_.get(); |
| 106 } |
| 107 |
| 88 MockIBusClient* mock_ibus_client() { | 108 MockIBusClient* mock_ibus_client() { |
| 89 return mock_ibus_client_.get(); | 109 return mock_ibus_client_.get(); |
| 90 } | 110 } |
| 91 | 111 |
| 92 MockIBusConfigClient* mock_ibus_config_client() { | 112 MockIBusConfigClient* mock_ibus_config_client() { |
| 93 return mock_ibus_config_client_.get(); | 113 return mock_ibus_config_client_.get(); |
| 94 } | 114 } |
| 95 | 115 |
| 96 MockIBusInputContextClient* mock_ibus_input_context_client() { | 116 MockIBusInputContextClient* mock_ibus_input_context_client() { |
| 97 return mock_ibus_input_context_client_.get(); | 117 return mock_ibus_input_context_client_.get(); |
| 98 } | 118 } |
| 99 | 119 |
| 100 MockIBusEngineService* mock_ibus_engine_service() { | 120 MockIBusEngineService* mock_ibus_engine_service() { |
| 101 return mock_ibus_engine_service_.get(); | 121 return mock_ibus_engine_service_.get(); |
| 102 } | 122 } |
| 103 | 123 |
| 104 MockIBusEngineFactoryService* mock_ibus_engine_factory_service() { | 124 MockIBusEngineFactoryService* mock_ibus_engine_factory_service() { |
| 105 return mock_ibus_engine_factory_service_.get(); | 125 return mock_ibus_engine_factory_service_.get(); |
| 106 } | 126 } |
| 107 | 127 |
| 108 MockIBusPanelService* mock_ibus_panel_service() { | 128 MockIBusPanelService* mock_ibus_panel_service() { |
| 109 return mock_ibus_panel_service_.get(); | 129 return mock_ibus_panel_service_.get(); |
| 110 } | 130 } |
| 111 | 131 |
| 112 void set_ibus_bus(dbus::Bus* ibus_bus) { | 132 void set_ibus_bus(dbus::Bus* ibus_bus) { |
| 113 ibus_bus_ = ibus_bus; | 133 ibus_bus_ = ibus_bus; |
| 114 } | 134 } |
| 115 | 135 |
| 116 private: | 136 private: |
| 137 scoped_ptr<FakeBluetoothAdapterClient> fake_bluetooth_adapter_client_; |
| 138 scoped_ptr<FakeBluetoothAgentManagerClient> |
| 139 fake_bluetooth_agent_manager_client_; |
| 140 scoped_ptr<FakeBluetoothDeviceClient> fake_bluetooth_device_client_; |
| 141 scoped_ptr<FakeBluetoothProfileManagerClient> |
| 142 fake_bluetooth_profile_manager_client_; |
| 117 scoped_ptr<MockIBusClient> mock_ibus_client_; | 143 scoped_ptr<MockIBusClient> mock_ibus_client_; |
| 118 scoped_ptr<MockIBusConfigClient> mock_ibus_config_client_; | 144 scoped_ptr<MockIBusConfigClient> mock_ibus_config_client_; |
| 119 scoped_ptr<MockIBusInputContextClient> mock_ibus_input_context_client_; | 145 scoped_ptr<MockIBusInputContextClient> mock_ibus_input_context_client_; |
| 120 scoped_ptr<MockIBusEngineService> mock_ibus_engine_service_; | 146 scoped_ptr<MockIBusEngineService> mock_ibus_engine_service_; |
| 121 scoped_ptr<MockIBusEngineFactoryService> mock_ibus_engine_factory_service_; | 147 scoped_ptr<MockIBusEngineFactoryService> mock_ibus_engine_factory_service_; |
| 122 scoped_ptr<MockIBusPanelService> mock_ibus_panel_service_; | 148 scoped_ptr<MockIBusPanelService> mock_ibus_panel_service_; |
| 123 | 149 |
| 124 dbus::Bus* ibus_bus_; | 150 dbus::Bus* ibus_bus_; |
| 125 | 151 |
| 126 ObserverList<DBusThreadManagerObserver> observers_; | 152 ObserverList<DBusThreadManagerObserver> observers_; |
| 127 | 153 |
| 128 DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManagerWithoutGMock); | 154 DISALLOW_COPY_AND_ASSIGN(MockDBusThreadManagerWithoutGMock); |
| 129 }; | 155 }; |
| 130 | 156 |
| 131 } // namespace chromeos | 157 } // namespace chromeos |
| 132 | 158 |
| 133 #endif // CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_WITHOUT_GMOCK_H_ | 159 #endif // CHROMEOS_DBUS_MOCK_DBUS_THREAD_MANAGER_WITHOUT_GMOCK_H_ |
| OLD | NEW |