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

Side by Side Diff: device/bluetooth/test/bluetooth_test.h

Issue 1690133002: Implement BluetoothRemoteGattServiceWin and related unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments and split out of included GATT services Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ 5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // Simulates GattConnection disconnecting. 106 // Simulates GattConnection disconnecting.
107 virtual void SimulateGattDisconnection(BluetoothDevice* device) {} 107 virtual void SimulateGattDisconnection(BluetoothDevice* device) {}
108 108
109 // Simulates success of discovering services. |uuids| is used to create a 109 // Simulates success of discovering services. |uuids| is used to create a
110 // service for each UUID string. Multiple UUIDs with the same value produce 110 // service for each UUID string. Multiple UUIDs with the same value produce
111 // multiple service instances. 111 // multiple service instances.
112 virtual void SimulateGattServicesDiscovered( 112 virtual void SimulateGattServicesDiscovered(
113 BluetoothDevice* device, 113 BluetoothDevice* device,
114 const std::vector<std::string>& uuids) {} 114 const std::vector<std::string>& uuids) {}
115 115
116 // Simulates remove of a |service|.
117 virtual void SimulateGattServiceRemoved(BluetoothGattService* service) {}
118
116 // Simulates failure to discover services. 119 // Simulates failure to discover services.
117 virtual void SimulateGattServicesDiscoveryError(BluetoothDevice* device) {} 120 virtual void SimulateGattServicesDiscoveryError(BluetoothDevice* device) {}
118 121
119 // Simulates a Characteristic on a service. 122 // Simulates a Characteristic on a service.
120 virtual void SimulateGattCharacteristic(BluetoothGattService* service, 123 virtual void SimulateGattCharacteristic(BluetoothGattService* service,
121 const std::string& uuid, 124 const std::string& uuid,
122 int properties) {} 125 int properties) {}
123 126
127 // Simulates remove of a |characteristic| from |service|.
128 virtual void SimulateGattCharacteristicRemoved(
129 BluetoothGattService* service,
130 BluetoothGattCharacteristic* characteristic) {}
131
124 // Remembers |characteristic|'s platform specific object to be used in a 132 // Remembers |characteristic|'s platform specific object to be used in a
125 // subsequent call to methods such as SimulateGattCharacteristicRead that 133 // subsequent call to methods such as SimulateGattCharacteristicRead that
126 // accept a nullptr value to select this remembered characteristic. This 134 // accept a nullptr value to select this remembered characteristic. This
127 // enables tests where the platform attempts to reference characteristic 135 // enables tests where the platform attempts to reference characteristic
128 // objects after the Chrome objects have been deleted, e.g. with DeleteDevice. 136 // objects after the Chrome objects have been deleted, e.g. with DeleteDevice.
129 virtual void RememberCharacteristicForSubsequentAction( 137 virtual void RememberCharacteristicForSubsequentAction(
130 BluetoothGattCharacteristic* characteristic) {} 138 BluetoothGattCharacteristic* characteristic) {}
131 139
132 // Simulates a Characteristic Set Notify success. 140 // Simulates a Characteristic Set Notify success.
133 virtual void SimulateGattNotifySessionStarted( 141 virtual void SimulateGattNotifySessionStarted(
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 int actual_error_callback_calls_ = 0; 260 int actual_error_callback_calls_ = 0;
253 bool unexpected_success_callback_ = false; 261 bool unexpected_success_callback_ = false;
254 bool unexpected_error_callback_ = false; 262 bool unexpected_error_callback_ = false;
255 263
256 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; 264 base::WeakPtrFactory<BluetoothTestBase> weak_factory_;
257 }; 265 };
258 266
259 } // namespace device 267 } // namespace device
260 268
261 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ 269 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698