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

Unified Diff: device/bluetooth/test/bluetooth_test_mac.h

Issue 2638653002: Bluetooth: macOS: DidModifyServices can happens while scanning (Closed)
Patch Set: Adding comments and Mac suffix Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/test/bluetooth_test_mac.h
diff --git a/device/bluetooth/test/bluetooth_test_mac.h b/device/bluetooth/test/bluetooth_test_mac.h
index 5eb0042626a26eeb434f605a4677c13e4972f119..f41e9b00eb0d52f68ee48142a91f3017cce3fa06 100644
--- a/device/bluetooth/test/bluetooth_test_mac.h
+++ b/device/bluetooth/test/bluetooth_test_mac.h
@@ -103,24 +103,42 @@ class BluetoothTestMac : public BluetoothTestBase {
// macOS is the only platform for which we need to discover each set of
// attributes individually so we need a method to simulate discovering each
// set of attributes.
- void SimulateDidDiscoverServices(BluetoothDevice* device,
- const std::vector<std::string>& uuids);
+ // Simulates service discovery for a device.
+ void SimulateDidDiscoverServicesMac(BluetoothDevice* device);
+ // Simulates characteristic discovery for a service.
+ void SimulateDidDiscoverCharacteristicsMac(
+ BluetoothRemoteGattService* service);
+ // Simulates descriptor discovery for a characteristic.
+ void SimulateDidDiscoverDescriptorsMac(
+ BluetoothRemoteGattCharacteristic* characteristic);
// CoreBluetooth can return NSData when reading remote gatt descriptors.
// This methods simulate receiving NSData from CoreBluetooth.
- void SimulateGattDescriptorReadNSData(
+ void SimulateGattDescriptorReadNSDataMac(
BluetoothRemoteGattDescriptor* descriptor,
const std::vector<uint8_t>& value);
// CoreBluetooth can return NSString when reading remote gatt descriptors.
// This methods simulate receiving NSString from CoreBluetooth.
- void SimulateGattDescriptorReadNSString(
+ void SimulateGattDescriptorReadNSStringMac(
BluetoothRemoteGattDescriptor* descriptor,
const std::string& value);
// CoreBluetooth can return NSString when reading remote gatt descriptors.
// This methods simulate receiving NSString from CoreBluetooth.
- void SimulateGattDescriptorReadNSNumber(
+ void SimulateGattDescriptorReadNSNumberMac(
BluetoothRemoteGattDescriptor* descriptor,
short value);
+ // Adds services in MockCBPeripheral.
+ void AddServicesToDevice(BluetoothDevice* device,
scheib 2017/05/01 17:20:33 Please add the Mac suffix to these as well.
jlebel 2017/05/01 21:27:14 Ok, I was thinking that those methods could be use
scheib 2017/05/01 21:44:22 Ok, but let's rename them if/when they are moved t
+ const std::vector<std::string>& uuids);
+ // Adds a characteristic in MockCBService.
+ void AddCharacteristicToService(BluetoothRemoteGattService* service,
+ const std::string& characteristic_uuid,
+ int properties);
+ // Adds a descriptor in MockCBCharacteristic.
+ void AddDescriptorToCharacteristic(
+ BluetoothRemoteGattCharacteristic* characteristic,
+ const std::string& uuid);
+
// Callback for the bluetooth central manager mock.
void OnFakeBluetoothDeviceConnectGattCalled();
void OnFakeBluetoothGattDisconnect();
@@ -159,9 +177,6 @@ class BluetoothTestMac : public BluetoothTestBase {
// Returns MockCBDescriptor from BluetoothRemoteGattDescriptor.
MockCBDescriptor* GetCBMockDescriptor(
BluetoothRemoteGattDescriptor* descriptor) const;
- // Adds services in MockCBPeripheral.
- void AddServicesToDevice(BluetoothDevice* device,
- const std::vector<std::string>& uuids);
// Utility function for finding CBUUIDs with relatively nice SHA256 hashes.
std::string FindCBUUIDForHashTarget();

Powered by Google App Engine
This is Rietveld 408576698