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

Unified Diff: device/bluetooth/bluetooth_gatt_chromeos_unittest.cc

Issue 307453007: device/bluetooth: Implement GATT characteristic properties on Chrome OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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_gatt_chromeos_unittest.cc
diff --git a/device/bluetooth/bluetooth_gatt_chromeos_unittest.cc b/device/bluetooth/bluetooth_gatt_chromeos_unittest.cc
index 91a44466f56b9be6d3acece49e9dcee0b7ddfafd..9b14809ed52b8e9788e9fb26c244b38bcb0b586d 100644
--- a/device/bluetooth/bluetooth_gatt_chromeos_unittest.cc
+++ b/device/bluetooth/bluetooth_gatt_chromeos_unittest.cc
@@ -860,6 +860,49 @@ TEST_F(BluetoothGattChromeOSTest, GattCharacteristicValue) {
service_observer.last_gatt_characteristic_id_);
}
+TEST_F(BluetoothGattChromeOSTest, GattCharacteristicProperties) {
+ fake_bluetooth_device_client_->CreateDevice(
+ dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
+ dbus::ObjectPath(FakeBluetoothDeviceClient::kLowEnergyPath));
+ BluetoothDevice* device = adapter_->GetDevice(
+ FakeBluetoothDeviceClient::kLowEnergyAddress);
+ ASSERT_TRUE(device);
+
+ TestDeviceObserver observer(adapter_, device);
+
+ // Expose the fake Heart Rate service. This will asynchronously expose
+ // characteristics.
+ fake_bluetooth_gatt_service_client_->ExposeHeartRateService(
+ dbus::ObjectPath(FakeBluetoothDeviceClient::kLowEnergyPath));
+
+ BluetoothGattService* service =
+ device->GetGattService(observer.last_gatt_service_id_);
+
+ TestGattServiceObserver service_observer(adapter_, device, service);
+ EXPECT_TRUE(service->GetCharacteristics().empty());
+
+ // Run the message loop so that the characteristics appear.
+ base::MessageLoop::current()->Run();
+
+ BluetoothGattCharacteristic *characteristic = service->GetCharacteristic(
+ fake_bluetooth_gatt_characteristic_client_->
+ GetBodySensorLocationPath().value());
+ EXPECT_EQ(BluetoothGattCharacteristic::kPropertyRead,
+ characteristic->GetProperties());
+
+ characteristic = service->GetCharacteristic(
+ fake_bluetooth_gatt_characteristic_client_->
+ GetHeartRateControlPointPath().value());
+ EXPECT_EQ(BluetoothGattCharacteristic::kPropertyWrite,
+ characteristic->GetProperties());
+
+ characteristic = service->GetCharacteristic(
+ fake_bluetooth_gatt_characteristic_client_->
+ GetHeartRateMeasurementPath().value());
+ EXPECT_EQ(BluetoothGattCharacteristic::kPropertyNotify,
+ characteristic->GetProperties());
+}
+
TEST_F(BluetoothGattChromeOSTest, GattDescriptorValue) {
fake_bluetooth_device_client_->CreateDevice(
dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
« no previous file with comments | « device/bluetooth/bluetooth_gatt_characteristic.h ('k') | device/bluetooth/bluetooth_remote_gatt_characteristic_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698