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

Unified Diff: device/bluetooth/test/fake_central.cc

Issue 2874873003: bluetooth: Implement simulateGATTConnectionResponse() (Closed)
Patch Set: Merge branch 'bluetooth-generate-with-headers' into bluetooth-simulate-gatt-discovery-complete Created 3 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
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..b09be79a9839bf3a2998af5b5bfd330254ced9aa 100644
--- a/device/bluetooth/test/fake_central.cc
+++ b/device/bluetooth/test/fake_central.cc
@@ -44,6 +44,19 @@ void FakeCentral::SimulatePreconnectedPeripheral(
std::move(callback).Run();
}
+void FakeCentral::SimulateGATTConnectionResponse(
+ const std::string& address,
+ uint16_t code,
+ SimulateGATTConnectionResponseCallback callback) {
+ auto device_iter = devices_.find(address);
+ DCHECK(device_iter != devices_.end());
+
+ FakePeripheral* fake_peripheral =
+ static_cast<FakePeripheral*>(device_iter->second.get());
+ fake_peripheral->SimulateGATTConnectionResponse(code);
+ std::move(callback).Run();
+}
+
std::string FakeCentral::GetAddress() const {
NOTREACHED();
return std::string();

Powered by Google App Engine
This is Rietveld 408576698