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

Unified Diff: device/bluetooth/bluetooth_gatt_characteristic_unittest.cc

Issue 1422093002: bluetooth: android: BluetoothRemoteGattCharacteristicAndroid::GetUUID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-cleanup-
Patch Set: Created 5 years, 2 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/bluetooth.gyp ('k') | device/bluetooth/bluetooth_remote_gatt_characteristic_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_gatt_characteristic_unittest.cc
diff --git a/device/bluetooth/bluetooth_gatt_characteristic_unittest.cc b/device/bluetooth/bluetooth_gatt_characteristic_unittest.cc
index 132a91844411a7db4f010f0f1ff3d39c2ca94e9a..ff5b695d803dee752fef36ca46b5173e44cff2d9 100644
--- a/device/bluetooth/bluetooth_gatt_characteristic_unittest.cc
+++ b/device/bluetooth/bluetooth_gatt_characteristic_unittest.cc
@@ -82,4 +82,27 @@ TEST_F(BluetoothGattCharacteristicTest, GetIdentifier) {
}
#endif // defined(OS_ANDROID)
+#if defined(OS_ANDROID)
+TEST_F(BluetoothGattCharacteristicTest, GetUUID) {
+ InitWithFakeAdapter();
+ StartLowEnergyDiscoverySession();
+ BluetoothDevice* device = DiscoverLowEnergyDevice(3);
+ device->CreateGattConnection(GetGattConnectionCallback(),
+ GetConnectErrorCallback());
+ SimulateGattConnection(device);
+ std::vector<std::string> services;
+ services.push_back("00000000-0000-1000-8000-00805f9b34fb");
+ SimulateGattServicesDiscovered(device, services);
+ BluetoothGattService* service = device->GetGattServices()[0];
+
+ BluetoothUUID characteristic_uuid("22222222-0000-1000-8000-00805f9b34fb");
+ SimulateGattCharacteristic(service, characteristic_uuid.canonical_value());
+ SimulateGattCharacteristic(service, characteristic_uuid.canonical_value());
+
+ // Each has the same UUID.
+ EXPECT_EQ(characteristic_uuid, service->GetCharacteristics()[0]->GetUUID());
+ EXPECT_EQ(characteristic_uuid, service->GetCharacteristics()[1]->GetUUID());
ortuno 2015/10/26 22:10:09 Should we test that GetCharacteristic(instance_id)
scheib 2015/10/27 22:38:18 Done.
+}
+#endif // defined(OS_ANDROID)
+
} // namespace device
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/bluetooth_remote_gatt_characteristic_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698