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

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

Issue 2867713008: bluetooth: Implement known_service_uuids for Peripherals. (Closed)
Patch Set: Fix test 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 248079b2f58b20fb8d4cb2eca18e071559aff209..79c256333ae6ef1da6e359063b51d012b4c0a8f1 100644
--- a/device/bluetooth/test/fake_central.cc
+++ b/device/bluetooth/test/fake_central.cc
@@ -8,7 +8,9 @@
#include <string>
#include <utility>
+#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_discovery_filter.h"
+#include "device/bluetooth/bluetooth_uuid.h"
#include "device/bluetooth/public/interfaces/test/fake_bluetooth.mojom.h"
#include "device/bluetooth/test/fake_peripheral.h"
@@ -21,6 +23,7 @@ FakeCentral::FakeCentral(mojom::CentralState state,
void FakeCentral::SimulatePreconnectedPeripheral(
const std::string& address,
const std::string& name,
+ const std::vector<device::BluetoothUUID>& known_service_uuids,
const SimulatePreconnectedPeripheralCallback& callback) {
auto device_iter = devices_.find(address);
if (device_iter == devices_.end()) {
@@ -35,10 +38,18 @@ void FakeCentral::SimulatePreconnectedPeripheral(
static_cast<FakePeripheral*>(device_iter->second.get());
fake_peripheral->SetName(name);
fake_peripheral->SetGattConnected(true);
+ fake_peripheral->SetServiceUUIDs(device::BluetoothDevice::UUIDSet(
+ known_service_uuids.begin(), known_service_uuids.end()));
callback.Run();
}
+void FakeCentral::SetState(mojom::CentralState state,
+ const SetStateCallback& callback) {
+ state_ = state;
+ callback.Run();
+}
+
std::string FakeCentral::GetAddress() const {
NOTREACHED();
return std::string();

Powered by Google App Engine
This is Rietveld 408576698