Chromium Code Reviews| Index: device/bluetooth/test/fake_central.cc |
| diff --git a/device/bluetooth/test/fake_central.cc b/device/bluetooth/test/fake_central.cc |
| index 8bc994fffc81a9d12eeb2afab8b46d8fb2581fbe..c7db13594007401bb5741f221d30272000521992 100644 |
| --- a/device/bluetooth/test/fake_central.cc |
| +++ b/device/bluetooth/test/fake_central.cc |
| @@ -37,13 +37,26 @@ void FakeCentral::SimulatePreconnectedPeripheral( |
| FakePeripheral* fake_peripheral = |
| static_cast<FakePeripheral*>(device_iter->second.get()); |
| fake_peripheral->SetName(name); |
| - fake_peripheral->SetGattConnected(true); |
| + fake_peripheral->SetSystemConnected(true); |
| fake_peripheral->SetServiceUUIDs(device::BluetoothDevice::UUIDSet( |
| known_service_uuids.begin(), known_service_uuids.end())); |
| std::move(callback).Run(); |
| } |
| +void FakeCentral::SetNextGATTConnectionResponse( |
| + const std::string& address, |
| + uint16_t code, |
| + SetNextGATTConnectionResponseCallback callback) { |
| + auto device_iter = devices_.find(address); |
| + DCHECK(device_iter != devices_.end()); |
|
dcheng
2017/06/02 16:07:35
Might be worth handling this: otherwise, I suspect
ortuno
2017/06/05 01:36:09
Ah good catch. Done.
|
| + |
| + FakePeripheral* fake_peripheral = |
| + static_cast<FakePeripheral*>(device_iter->second.get()); |
| + fake_peripheral->SetNextGATTConnectionResponse(code); |
| + std::move(callback).Run(); |
| +} |
| + |
| std::string FakeCentral::GetAddress() const { |
| NOTREACHED(); |
| return std::string(); |