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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc

Issue 1950033002: bluetooth: mac: Initial BluetoothRemoteGattCharacteristicMac implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@servicescan_cleanup
Patch Set: Fixing the build Created 4 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_remote_gatt_characteristic_unittest.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
index 64d6e40f6eeff2d72562eb8d67628ba550c86363..cc2186403f75d4fa8947fbfdec457d925a7a5e7c 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
@@ -136,8 +136,12 @@ class BluetoothRemoteGattCharacteristicTest : public BluetoothTest {
};
#endif
-#if defined(OS_ANDROID) || defined(OS_WIN)
+#if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN)
TEST_F(BluetoothRemoteGattCharacteristicTest, GetIdentifier) {
+ if (!PlatformSupportsLowEnergy()) {
+ LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test.";
+ return;
+ }
InitWithFakeAdapter();
StartLowEnergyDiscoverySession();
// 2 devices to verify unique IDs across them.
@@ -197,10 +201,14 @@ TEST_F(BluetoothRemoteGattCharacteristicTest, GetIdentifier) {
EXPECT_NE(char5->GetIdentifier(), char6->GetIdentifier());
}
-#endif // defined(OS_ANDROID) || defined(OS_WIN)
+#endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN)
-#if defined(OS_ANDROID) || defined(OS_WIN)
+#if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN)
TEST_F(BluetoothRemoteGattCharacteristicTest, GetUUID) {
+ if (!PlatformSupportsLowEnergy()) {
+ LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test.";
+ return;
+ }
InitWithFakeAdapter();
StartLowEnergyDiscoverySession();
BluetoothDevice* device = SimulateLowEnergyDevice(3);
@@ -235,10 +243,14 @@ TEST_F(BluetoothRemoteGattCharacteristicTest, GetUUID) {
EXPECT_EQ(uuid2, char2->GetUUID());
EXPECT_EQ(uuid2, char3->GetUUID());
}
-#endif // defined(OS_ANDROID) || defined(OS_WIN)
+#endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN)
-#if defined(OS_ANDROID) || defined(OS_WIN)
+#if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN)
TEST_F(BluetoothRemoteGattCharacteristicTest, GetProperties) {
+ if (!PlatformSupportsLowEnergy()) {
+ LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test.";
+ return;
+ }
InitWithFakeAdapter();
StartLowEnergyDiscoverySession();
BluetoothDevice* device = SimulateLowEnergyDevice(3);
@@ -263,17 +275,21 @@ TEST_F(BluetoothRemoteGattCharacteristicTest, GetProperties) {
EXPECT_EQ(0, properties1);
EXPECT_EQ(7, properties2);
}
-#endif // defined(OS_ANDROID) || defined(OS_WIN)
+#endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN)
-#if defined(OS_ANDROID) || defined(OS_WIN)
+#if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN)
// Tests GetService.
TEST_F(BluetoothRemoteGattCharacteristicTest, GetService) {
+ if (!PlatformSupportsLowEnergy()) {
+ LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test.";
+ return;
+ }
ASSERT_NO_FATAL_FAILURE(FakeCharacteristicBoilerplate());
EXPECT_EQ(service_, characteristic1_->GetService());
EXPECT_EQ(service_, characteristic2_->GetService());
}
-#endif // defined(OS_ANDROID) || defined(OS_WIN)
+#endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN)
#if defined(OS_ANDROID) || defined(OS_WIN)
// Tests ReadRemoteCharacteristic and GetValue with empty value buffer.
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm ('k') | device/bluetooth/bluetooth_remote_gatt_service_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698