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

Unified Diff: device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc

Issue 1862093002: bluetooth: replace GattServices D-Bus property with ServicesResolved (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests Created 4 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
« no previous file with comments | « device/bluetooth/bluez/bluetooth_device_bluez.cc ('k') | device/bluetooth/dbus/bluetooth_device_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc
diff --git a/device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc b/device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc
index 905b53a3ee5cb598948d1c9651d115921d13c96f..e2cc16a2b1b76f8e74d5817e188acab0ceb08da3 100644
--- a/device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc
+++ b/device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc
@@ -375,18 +375,14 @@ TEST_F(BluetoothGattBlueZTest, ServicesDiscovered) {
TestBluetoothAdapterObserver observer(adapter_);
- EXPECT_EQ(0, observer.gatt_services_discovered_count());
-
// Expose the fake Heart Rate Service.
fake_bluetooth_gatt_service_client_->ExposeHeartRateService(
dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kLowEnergyPath));
// Notify that all services have been discovered.
- properties->gatt_services.ReplaceValue(
- fake_bluetooth_gatt_service_client_->GetServices());
+ properties->services_resolved.ReplaceValue(true);
EXPECT_TRUE(device->IsGattServicesDiscoveryComplete());
EXPECT_EQ(1u, device->GetGattServices().size());
- EXPECT_EQ(1, observer.gatt_services_discovered_count());
EXPECT_EQ(device, observer.last_device());
EXPECT_EQ(bluez::FakeBluetoothDeviceClient::kLowEnergyAddress,
observer.last_device_address());
@@ -398,6 +394,7 @@ TEST_F(BluetoothGattBlueZTest, ServicesDiscovered) {
base::Unretained(this)));
fake_bluetooth_gatt_service_client_->HideHeartRateService();
properties->connected.ReplaceValue(false);
+ properties->services_resolved.ReplaceValue(false);
EXPECT_FALSE(device->IsConnected());
EXPECT_FALSE(device->IsGattServicesDiscoveryComplete());
@@ -415,8 +412,7 @@ TEST_F(BluetoothGattBlueZTest, ServicesDiscovered) {
// Verify that service discovery can be done again:
fake_bluetooth_gatt_service_client_->ExposeHeartRateService(
dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kLowEnergyPath));
- properties->gatt_services.ReplaceValue(
- fake_bluetooth_gatt_service_client_->GetServices());
+ properties->services_resolved.ReplaceValue(true);
EXPECT_TRUE(device->IsGattServicesDiscoveryComplete());
EXPECT_EQ(1u, device->GetGattServices().size());
}
« no previous file with comments | « device/bluetooth/bluez/bluetooth_device_bluez.cc ('k') | device/bluetooth/dbus/bluetooth_device_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698