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

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

Issue 2853433002: bluetooth: Implement simulateCentral (Closed)
Patch Set: call setLESupported in simulateCentral 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/fake_bluetooth.cc
diff --git a/device/bluetooth/test/fake_bluetooth.cc b/device/bluetooth/test/fake_bluetooth.cc
index 08c6615c208933c6cea416a9293cf9a81a2e92ce..fe474b0077b52bef5f823b53d8e6fb6bc75b99e2 100644
--- a/device/bluetooth/test/fake_bluetooth.cc
+++ b/device/bluetooth/test/fake_bluetooth.cc
@@ -32,4 +32,12 @@ void FakeBluetooth::SetLESupported(bool supported,
callback.Run();
}
+void FakeBluetooth::SimulateCentral(mojom::CentralState state,
+ const SimulateCentralCallback& callback) {
+ mojom::FakeCentralPtr fake_central_ptr;
+ fake_central_ = new FakeCentral(state, mojo::MakeRequest(&fake_central_ptr));
dcheng 2017/05/04 00:55:04 Nit: maybe use base::MakeShared<FakeCentral> to ma
ortuno 2017/05/04 05:28:24 Done.
+ device::BluetoothAdapterFactory::SetAdapterForTesting(fake_central_);
+ callback.Run(std::move(fake_central_ptr));
+}
+
} // namespace bluetooth

Powered by Google App Engine
This is Rietveld 408576698