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

Unified Diff: device/bluetooth/bluetooth_adapter_win.cc

Issue 1690133002: Implement BluetoothRemoteGattServiceWin and related unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments and split out of included GATT services Created 4 years, 10 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/bluetooth_adapter_win.cc
diff --git a/device/bluetooth/bluetooth_adapter_win.cc b/device/bluetooth/bluetooth_adapter_win.cc
index 68f781214c74167c9abad8454cb04e27e57f70e8..8206c9142b44750bebe440fe75249351398dc709 100644
--- a/device/bluetooth/bluetooth_adapter_win.cc
+++ b/device/bluetooth/bluetooth_adapter_win.cc
@@ -43,8 +43,8 @@ BluetoothAdapterWin::BluetoothAdapterWin(const InitCallback& init_callback)
powered_(false),
discovery_status_(NOT_DISCOVERING),
num_discovery_listeners_(0),
- weak_ptr_factory_(this) {
-}
+ force_update_device_for_test_(false),
+ weak_ptr_factory_(this) {}
BluetoothAdapterWin::~BluetoothAdapterWin() {
if (task_manager_.get()) {
@@ -284,10 +284,15 @@ void BluetoothAdapterWin::DevicesPolled(
static_cast<BluetoothDeviceWin*>(iter->second);
if (!device_win->IsEqual(*device_state)) {
device_win->Update(*device_state);
- FOR_EACH_OBSERVER(BluetoothAdapter::Observer,
- observers_,
+ FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_,
DeviceChanged(this, device_win));
}
+ // Above IsEqual returns true if device name, address, status and services
+ // (primary services of BLE device) are the same. However, in BLE tests,
+ // we may simulate characteristic, descriptor and secondary GATT service
+ // after device has been initialized.
+ if (force_update_device_for_test_)
+ device_win->Update(*device_state);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698