Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: chromeos/dbus/fake_dbus_thread_manager.cc

Issue 206443009: chromeos/dbus: Add fake D-Bus clients for GATT client-mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chromeos/dbus/fake_dbus_thread_manager.h" 5 #include "chromeos/dbus/fake_dbus_thread_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chromeos/chromeos_switches.h" 8 #include "chromeos/chromeos_switches.h"
9 #include "chromeos/dbus/cras_audio_client_stub_impl.h" 9 #include "chromeos/dbus/cras_audio_client_stub_impl.h"
10 #include "chromeos/dbus/cros_disks_client.h" 10 #include "chromeos/dbus/cros_disks_client.h"
11 #include "chromeos/dbus/dbus_client.h" 11 #include "chromeos/dbus/dbus_client.h"
12 #include "chromeos/dbus/dbus_thread_manager.h" 12 #include "chromeos/dbus/dbus_thread_manager.h"
13 #include "chromeos/dbus/dbus_thread_manager_observer.h" 13 #include "chromeos/dbus/dbus_thread_manager_observer.h"
14 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" 14 #include "chromeos/dbus/fake_bluetooth_adapter_client.h"
15 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" 15 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h"
16 #include "chromeos/dbus/fake_bluetooth_device_client.h" 16 #include "chromeos/dbus/fake_bluetooth_device_client.h"
17 #include "chromeos/dbus/fake_bluetooth_gatt_characteristic_client.h"
18 #include "chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h"
19 #include "chromeos/dbus/fake_bluetooth_gatt_service_client.h"
17 #include "chromeos/dbus/fake_bluetooth_input_client.h" 20 #include "chromeos/dbus/fake_bluetooth_input_client.h"
18 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h" 21 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h"
19 #include "chromeos/dbus/fake_cryptohome_client.h" 22 #include "chromeos/dbus/fake_cryptohome_client.h"
20 #include "chromeos/dbus/fake_debug_daemon_client.h" 23 #include "chromeos/dbus/fake_debug_daemon_client.h"
21 #include "chromeos/dbus/fake_gsm_sms_client.h" 24 #include "chromeos/dbus/fake_gsm_sms_client.h"
22 #include "chromeos/dbus/fake_image_burner_client.h" 25 #include "chromeos/dbus/fake_image_burner_client.h"
23 #include "chromeos/dbus/fake_introspectable_client.h" 26 #include "chromeos/dbus/fake_introspectable_client.h"
24 #include "chromeos/dbus/fake_modem_messaging_client.h" 27 #include "chromeos/dbus/fake_modem_messaging_client.h"
25 #include "chromeos/dbus/fake_nfc_adapter_client.h" 28 #include "chromeos/dbus/fake_nfc_adapter_client.h"
26 #include "chromeos/dbus/fake_nfc_device_client.h" 29 #include "chromeos/dbus/fake_nfc_device_client.h"
(...skipping 25 matching lines...) Expand all
52 55
53 void FakeDBusThreadManager::SetFakeClients() { 56 void FakeDBusThreadManager::SetFakeClients() {
54 const DBusClientImplementationType client_type = 57 const DBusClientImplementationType client_type =
55 STUB_DBUS_CLIENT_IMPLEMENTATION; 58 STUB_DBUS_CLIENT_IMPLEMENTATION;
56 SetBluetoothAdapterClient( 59 SetBluetoothAdapterClient(
57 scoped_ptr<BluetoothAdapterClient>(new FakeBluetoothAdapterClient)); 60 scoped_ptr<BluetoothAdapterClient>(new FakeBluetoothAdapterClient));
58 SetBluetoothAgentManagerClient(scoped_ptr<BluetoothAgentManagerClient>( 61 SetBluetoothAgentManagerClient(scoped_ptr<BluetoothAgentManagerClient>(
59 new FakeBluetoothAgentManagerClient)); 62 new FakeBluetoothAgentManagerClient));
60 SetBluetoothDeviceClient( 63 SetBluetoothDeviceClient(
61 scoped_ptr<BluetoothDeviceClient>(new FakeBluetoothDeviceClient)); 64 scoped_ptr<BluetoothDeviceClient>(new FakeBluetoothDeviceClient));
65 SetBluetoothGattCharacteristicClient(
66 scoped_ptr<BluetoothGattCharacteristicClient>(
67 new FakeBluetoothGattCharacteristicClient));
68 SetBluetoothGattDescriptorClient(scoped_ptr<BluetoothGattDescriptorClient>(
69 new FakeBluetoothGattDescriptorClient));
70 SetBluetoothGattServiceClient(scoped_ptr<BluetoothGattServiceClient>(
71 new FakeBluetoothGattServiceClient));
62 SetBluetoothInputClient( 72 SetBluetoothInputClient(
63 scoped_ptr<BluetoothInputClient>(new FakeBluetoothInputClient)); 73 scoped_ptr<BluetoothInputClient>(new FakeBluetoothInputClient));
64 SetBluetoothProfileManagerClient(scoped_ptr<BluetoothProfileManagerClient>( 74 SetBluetoothProfileManagerClient(scoped_ptr<BluetoothProfileManagerClient>(
65 new FakeBluetoothProfileManagerClient)); 75 new FakeBluetoothProfileManagerClient));
66 SetCrosDisksClient( 76 SetCrosDisksClient(
67 scoped_ptr<CrosDisksClient>(CrosDisksClient::Create(client_type))); 77 scoped_ptr<CrosDisksClient>(CrosDisksClient::Create(client_type)));
68 SetCrasAudioClient(scoped_ptr<CrasAudioClient>(new CrasAudioClientStubImpl)); 78 SetCrasAudioClient(scoped_ptr<CrasAudioClient>(new CrasAudioClientStubImpl));
69 SetCryptohomeClient(scoped_ptr<CryptohomeClient>(new FakeCryptohomeClient)); 79 SetCryptohomeClient(scoped_ptr<CryptohomeClient>(new FakeCryptohomeClient));
70 SetDebugDaemonClient( 80 SetDebugDaemonClient(
71 scoped_ptr<DebugDaemonClient>(new FakeDebugDaemonClient)); 81 scoped_ptr<DebugDaemonClient>(new FakeDebugDaemonClient));
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 void FakeDBusThreadManager::SetBluetoothAgentManagerClient( 142 void FakeDBusThreadManager::SetBluetoothAgentManagerClient(
133 scoped_ptr<BluetoothAgentManagerClient> client) { 143 scoped_ptr<BluetoothAgentManagerClient> client) {
134 bluetooth_agent_manager_client_ = client.Pass(); 144 bluetooth_agent_manager_client_ = client.Pass();
135 } 145 }
136 146
137 void FakeDBusThreadManager::SetBluetoothDeviceClient( 147 void FakeDBusThreadManager::SetBluetoothDeviceClient(
138 scoped_ptr<BluetoothDeviceClient> client) { 148 scoped_ptr<BluetoothDeviceClient> client) {
139 bluetooth_device_client_ = client.Pass(); 149 bluetooth_device_client_ = client.Pass();
140 } 150 }
141 151
152 void FakeDBusThreadManager::SetBluetoothGattCharacteristicClient(
153 scoped_ptr<BluetoothGattCharacteristicClient> client) {
154 bluetooth_gatt_characteristic_client_ = client.Pass();
155 }
156
157 void FakeDBusThreadManager::SetBluetoothGattDescriptorClient(
158 scoped_ptr<BluetoothGattDescriptorClient> client) {
159 bluetooth_gatt_descriptor_client_ = client.Pass();
160 }
161
162 void FakeDBusThreadManager::SetBluetoothGattServiceClient(
163 scoped_ptr<BluetoothGattServiceClient> client) {
164 bluetooth_gatt_service_client_ = client.Pass();
165 }
166
142 void FakeDBusThreadManager::SetBluetoothInputClient( 167 void FakeDBusThreadManager::SetBluetoothInputClient(
143 scoped_ptr<BluetoothInputClient> client) { 168 scoped_ptr<BluetoothInputClient> client) {
144 bluetooth_input_client_ = client.Pass(); 169 bluetooth_input_client_ = client.Pass();
145 } 170 }
146 171
147 void FakeDBusThreadManager::SetBluetoothProfileManagerClient( 172 void FakeDBusThreadManager::SetBluetoothProfileManagerClient(
148 scoped_ptr<BluetoothProfileManagerClient> client) { 173 scoped_ptr<BluetoothProfileManagerClient> client) {
149 bluetooth_profile_manager_client_ = client.Pass(); 174 bluetooth_profile_manager_client_ = client.Pass();
150 } 175 }
151 176
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 BluetoothAgentManagerClient* 322 BluetoothAgentManagerClient*
298 FakeDBusThreadManager::GetBluetoothAgentManagerClient() { 323 FakeDBusThreadManager::GetBluetoothAgentManagerClient() {
299 return bluetooth_agent_manager_client_.get(); 324 return bluetooth_agent_manager_client_.get();
300 } 325 }
301 326
302 BluetoothDeviceClient* 327 BluetoothDeviceClient*
303 FakeDBusThreadManager::GetBluetoothDeviceClient() { 328 FakeDBusThreadManager::GetBluetoothDeviceClient() {
304 return bluetooth_device_client_.get(); 329 return bluetooth_device_client_.get();
305 } 330 }
306 331
332 BluetoothGattCharacteristicClient*
333 FakeDBusThreadManager::GetBluetoothGattCharacteristicClient() {
334 return bluetooth_gatt_characteristic_client_.get();
335 }
336
337 BluetoothGattDescriptorClient*
338 FakeDBusThreadManager::GetBluetoothGattDescriptorClient() {
339 return bluetooth_gatt_descriptor_client_.get();
340 }
341
342 BluetoothGattServiceClient*
343 FakeDBusThreadManager::GetBluetoothGattServiceClient() {
344 return bluetooth_gatt_service_client_.get();
345 }
346
307 BluetoothInputClient* 347 BluetoothInputClient*
308 FakeDBusThreadManager::GetBluetoothInputClient() { 348 FakeDBusThreadManager::GetBluetoothInputClient() {
309 return bluetooth_input_client_.get(); 349 return bluetooth_input_client_.get();
310 } 350 }
311 351
312 BluetoothProfileManagerClient* 352 BluetoothProfileManagerClient*
313 FakeDBusThreadManager::GetBluetoothProfileManagerClient() { 353 FakeDBusThreadManager::GetBluetoothProfileManagerClient() {
314 return bluetooth_profile_manager_client_.get(); 354 return bluetooth_profile_manager_client_.get();
315 } 355 }
316 356
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 458
419 SystemClockClient* FakeDBusThreadManager::GetSystemClockClient() { 459 SystemClockClient* FakeDBusThreadManager::GetSystemClockClient() {
420 return system_clock_client_.get(); 460 return system_clock_client_.get();
421 } 461 }
422 462
423 UpdateEngineClient* FakeDBusThreadManager::GetUpdateEngineClient() { 463 UpdateEngineClient* FakeDBusThreadManager::GetUpdateEngineClient() {
424 return update_engine_client_.get(); 464 return update_engine_client_.get();
425 } 465 }
426 466
427 } // namespace chromeos 467 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_dbus_thread_manager.h ('k') | device/bluetooth/bluetooth_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698