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

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

Issue 2853433002: bluetooth: Implement simulateCentral (Closed)
Patch Set: even moar cleanup 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 e9af2b3fd19bb1abf3524e2d6a0a6b66adf9eb41..a376bfc4380ecf5cdf0d9473241057cd2e0c1b92 100644
--- a/device/bluetooth/test/fake_bluetooth.cc
+++ b/device/bluetooth/test/fake_bluetooth.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/memory/ptr_util.h"
+#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/public/interfaces/test/fake_bluetooth.mojom.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
@@ -27,4 +28,14 @@ void FakeBluetooth::SetLESupported(bool available,
callback.Run();
}
+void FakeBluetooth::SimulateLECentralObserverManager(
+ mojom::LECentralObserverManagerState state,
+ const SimulateLECentralObserverManagerCallback& callback) {
+ mojom::FakeLECentralObserverManagerPtr fake_manager_ptr;
+ fake_manager_ = new FakeLECentralObserverManager(
+ state, mojo::MakeRequest(&fake_manager_ptr));
+ device::BluetoothAdapterFactory::SetAdapterForTesting(fake_manager_);
+ callback.Run(std::move(fake_manager_ptr));
+}
+
} // namespace bluetooth

Powered by Google App Engine
This is Rietveld 408576698