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

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

Issue 2026193002: Preparing for characteristics discovery (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Same behavior than CoreBluetooth Created 4 years, 7 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
« no previous file with comments | « no previous file | device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/test/bluetooth_test_mac.mm
diff --git a/device/bluetooth/test/bluetooth_test_mac.mm b/device/bluetooth/test/bluetooth_test_mac.mm
index 4a27f3be741b9b46614d225762a8a071b70e8f58..73527a2bbafe639696dab33a984c6f43d2ece5e2 100644
--- a/device/bluetooth/test/bluetooth_test_mac.mm
+++ b/device/bluetooth/test/bluetooth_test_mac.mm
@@ -213,13 +213,13 @@ void BluetoothTestMac::SimulateGattDisconnection(BluetoothDevice* device) {
BluetoothLowEnergyDeviceMac* lowEnergyDeviceMac =
static_cast<BluetoothLowEnergyDeviceMac*>(device);
CBPeripheral* peripheral = lowEnergyDeviceMac->GetPeripheral();
- MockCBPeripheral* mockPeripheral = (MockCBPeripheral*)peripheral;
- [mockPeripheral setState:CBPeripheralStateDisconnected];
- CBCentralManager* centralManager =
+ MockCBPeripheral* peripheral_mock = (MockCBPeripheral*)peripheral;
+ [peripheral_mock setState:CBPeripheralStateDisconnected];
+ CBCentralManager* central_manager =
ObjCCast<CBCentralManager>(mock_central_manager_->get());
- [centralManager.delegate centralManager:centralManager
- didDisconnectPeripheral:peripheral
- error:nil];
+ [central_manager.delegate centralManager:central_manager
+ didDisconnectPeripheral:peripheral
+ error:nil];
}
void BluetoothTestMac::SimulateGattServicesDiscovered(
@@ -234,9 +234,8 @@ void BluetoothTestMac::SimulateGattServicesDiscovered(
CBUUID* cb_service_uuid = [CBUUID UUIDWithString:@(uuid.c_str())];
[services addObject:cb_service_uuid];
}
- [peripheral_mock removeAllServices];
[peripheral_mock addServices:services];
- [peripheral_mock didDiscoverWithError:nil];
+ [peripheral_mock didDiscoverServicesWithError:nil];
}
void BluetoothTestMac::SimulateGattServiceRemoved(
@@ -251,7 +250,7 @@ void BluetoothTestMac::SimulateGattServiceRemoved(
CBPeripheral* peripheral = device_mac->GetPeripheral();
MockCBPeripheral* peripheral_mock = ObjCCast<MockCBPeripheral>(peripheral);
[peripheral_mock removeService:mac_gatt_service->GetService()];
- [peripheral_mock didDiscoverWithError:nil];
+ [peripheral_mock didDiscoverServicesWithError:nil];
ortuno 2016/06/03 00:05:10 This ends up calling didDiscoverServices which mea
jlebel 2016/06/03 00:23:19 After calling -[<CBPeripheralDelegate> peripheral:
ortuno 2016/06/03 01:07:56 Ah I see. Hmm the test seems bit fragile but no ne
}
void BluetoothTestMac::OnFakeBluetoothDeviceConnectGattCalled() {
« no previous file with comments | « no previous file | device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698