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

Side by Side Diff: device/bluetooth/bluetooth_low_energy_win_fake.h

Issue 1804093003: Add BluetoothGattCharacteristicTest::StartNotifySession_Reentrant unit test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_
7 7
8 #include "device/bluetooth/bluetooth_low_energy_win.h" 8 #include "device/bluetooth/bluetooth_low_energy_win.h"
9 9
10 #include <set> 10 #include <set>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 }; 55 };
56 56
57 struct GattCharacteristic { 57 struct GattCharacteristic {
58 GattCharacteristic(); 58 GattCharacteristic();
59 ~GattCharacteristic(); 59 ~GattCharacteristic();
60 scoped_ptr<BTH_LE_GATT_CHARACTERISTIC> characteristic_info; 60 scoped_ptr<BTH_LE_GATT_CHARACTERISTIC> characteristic_info;
61 scoped_ptr<BTH_LE_GATT_CHARACTERISTIC_VALUE> value; 61 scoped_ptr<BTH_LE_GATT_CHARACTERISTIC_VALUE> value;
62 GattDescriptorsMap included_descriptors; 62 GattDescriptorsMap included_descriptors;
63 std::vector<HRESULT> read_errors; 63 std::vector<HRESULT> read_errors;
64 std::vector<HRESULT> write_errors; 64 std::vector<HRESULT> write_errors;
65 std::vector<HRESULT> notify_errors;
65 std::vector<BLUETOOTH_GATT_EVENT_HANDLE> observers; 66 std::vector<BLUETOOTH_GATT_EVENT_HANDLE> observers;
66 }; 67 };
67 68
68 struct GattDescriptor { 69 struct GattDescriptor {
69 GattDescriptor(); 70 GattDescriptor();
70 ~GattDescriptor(); 71 ~GattDescriptor();
71 scoped_ptr<BTH_LE_GATT_DESCRIPTOR> descriptor_info; 72 scoped_ptr<BTH_LE_GATT_DESCRIPTOR> descriptor_info;
72 scoped_ptr<BTH_LE_GATT_DESCRIPTOR_VALUE> value; 73 scoped_ptr<BTH_LE_GATT_DESCRIPTOR_VALUE> value;
73 }; 74 };
74 75
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 const BTH_LE_GATT_CHARACTERISTIC& characteristic); 162 const BTH_LE_GATT_CHARACTERISTIC& characteristic);
162 void SimulateGattCharacteriscRemove(GattService* parent_service, 163 void SimulateGattCharacteriscRemove(GattService* parent_service,
163 std::string attribute_handle); 164 std::string attribute_handle);
164 GattCharacteristic* GetSimulatedGattCharacteristic( 165 GattCharacteristic* GetSimulatedGattCharacteristic(
165 GattService* parent_service, 166 GattService* parent_service,
166 std::string attribute_handle); 167 std::string attribute_handle);
167 void SimulateGattCharacteristicValue(GattCharacteristic* characteristic, 168 void SimulateGattCharacteristicValue(GattCharacteristic* characteristic,
168 const std::vector<uint8_t>& value); 169 const std::vector<uint8_t>& value);
169 void SimulateCharacteristicValueChangeNotification( 170 void SimulateCharacteristicValueChangeNotification(
170 GattCharacteristic* characteristic); 171 GattCharacteristic* characteristic);
172 void SimulateGattCharacteristicSetNotifyError(
173 GattCharacteristic* characteristic,
174 HRESULT error);
171 void SimulateGattCharacteristicReadError(GattCharacteristic* characteristic, 175 void SimulateGattCharacteristicReadError(GattCharacteristic* characteristic,
172 HRESULT error); 176 HRESULT error);
173 void SimulateGattCharacteristicWriteError(GattCharacteristic* characteristic, 177 void SimulateGattCharacteristicWriteError(GattCharacteristic* characteristic,
174 HRESULT error); 178 HRESULT error);
175 void SimulateGattDescriptor(std::string device_address, 179 void SimulateGattDescriptor(std::string device_address,
176 GattCharacteristic* characteristic, 180 GattCharacteristic* characteristic,
177 const BTH_LE_UUID& uuid); 181 const BTH_LE_UUID& uuid);
178 void AddObserver(Observer* observer); 182 void AddObserver(Observer* observer);
179 183
180 private: 184 private:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 BLEAttributeHandleTable attribute_handle_table_; 217 BLEAttributeHandleTable attribute_handle_table_;
214 BLEDevicesMap simulated_devices_; 218 BLEDevicesMap simulated_devices_;
215 Observer* observer_; 219 Observer* observer_;
216 GattCharacteristicObserverTable gatt_characteristic_observers_; 220 GattCharacteristicObserverTable gatt_characteristic_observers_;
217 }; 221 };
218 222
219 } // namespace win 223 } // namespace win
220 } // namespace device 224 } // namespace device
221 225
222 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ 226 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698