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

Unified Diff: device/bluetooth/bluetooth_adapter_unittest.cc

Issue 2244693002: bluetooth: Refactor how we update based on Advertising Data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix arc Created 4 years, 4 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_unittest.cc
diff --git a/device/bluetooth/bluetooth_adapter_unittest.cc b/device/bluetooth/bluetooth_adapter_unittest.cc
index ffd8467e19a0ed2a9a6ebe29ce92cbd8d482229b..f28db2e6942cd65950572e93f53e5c8745f7d903 100644
--- a/device/bluetooth/bluetooth_adapter_unittest.cc
+++ b/device/bluetooth/bluetooth_adapter_unittest.cc
@@ -621,6 +621,8 @@ TEST_F(BluetoothTest, DiscoverLowEnergyDeviceTwice) {
#if defined(OS_ANDROID) || defined(OS_MACOSX)
// Discovers a device, and then again with new Service UUIDs.
+// Makes sure we don't create another device when we've found the
+// device in the past.
TEST_F(BluetoothTest, DiscoverLowEnergyDeviceWithUpdatedUUIDs) {
if (!PlatformSupportsLowEnergy()) {
LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test.";
@@ -633,12 +635,6 @@ TEST_F(BluetoothTest, DiscoverLowEnergyDeviceWithUpdatedUUIDs) {
StartLowEnergyDiscoverySession();
BluetoothDevice* device = SimulateLowEnergyDevice(1);
- // Check the initial UUIDs:
- EXPECT_TRUE(base::ContainsValue(device->GetUUIDs(),
Jeffrey Yasskin 2016/08/18 19:56:30 Why don't we need to check which UUIDs are listed
ortuno 2016/08/19 20:50:33 The purpose of this test is just to make sure that
- BluetoothUUID(kTestUUIDGenericAccess)));
- EXPECT_FALSE(base::ContainsValue(device->GetUUIDs(),
- BluetoothUUID(kTestUUIDImmediateAlert)));
-
// Discover same device again with updated UUIDs:
observer.Reset();
SimulateLowEnergyDevice(2);
@@ -647,21 +643,12 @@ TEST_F(BluetoothTest, DiscoverLowEnergyDeviceWithUpdatedUUIDs) {
EXPECT_EQ(1u, adapter_->GetDevices().size());
EXPECT_EQ(device, observer.last_device());
- // Expect only new UUIDs:
- EXPECT_FALSE(base::ContainsValue(device->GetUUIDs(),
- BluetoothUUID(kTestUUIDGenericAccess)));
- EXPECT_TRUE(base::ContainsValue(device->GetUUIDs(),
- BluetoothUUID(kTestUUIDImmediateAlert)));
-
// Discover same device again with empty UUIDs:
observer.Reset();
SimulateLowEnergyDevice(3);
EXPECT_EQ(0, observer.device_added_count());
EXPECT_EQ(1, observer.device_changed_count());
EXPECT_EQ(1u, adapter_->GetDevices().size());
-
- // Expect no UUIDs:
- EXPECT_EQ(0u, device->GetUUIDs().size());
}
#endif // defined(OS_ANDROID) || defined(OS_MACOSX)

Powered by Google App Engine
This is Rietveld 408576698