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

Side by Side Diff: device/bluetooth/bluetooth_device_unittest.cc

Issue 2017393002: bluetooth: Rename device's GetName to GetNameForDisplay (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/bluetooth_device.h" 5 #include "device/bluetooth/bluetooth_device.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 ASSERT_TRUE(device); 84 ASSERT_TRUE(device);
85 // Bluetooth class information for BLE device is not available on Windows. 85 // Bluetooth class information for BLE device is not available on Windows.
86 #ifndef OS_WIN 86 #ifndef OS_WIN
87 EXPECT_EQ(0x1F00u, device->GetBluetoothClass()); 87 EXPECT_EQ(0x1F00u, device->GetBluetoothClass());
88 #endif 88 #endif
89 EXPECT_EQ(kTestDeviceAddress1, device->GetAddress()); 89 EXPECT_EQ(kTestDeviceAddress1, device->GetAddress());
90 EXPECT_EQ(BluetoothDevice::VENDOR_ID_UNKNOWN, device->GetVendorIDSource()); 90 EXPECT_EQ(BluetoothDevice::VENDOR_ID_UNKNOWN, device->GetVendorIDSource());
91 EXPECT_EQ(0, device->GetVendorID()); 91 EXPECT_EQ(0, device->GetVendorID());
92 EXPECT_EQ(0, device->GetProductID()); 92 EXPECT_EQ(0, device->GetProductID());
93 EXPECT_EQ(0, device->GetDeviceID()); 93 EXPECT_EQ(0, device->GetDeviceID());
94 EXPECT_EQ(base::UTF8ToUTF16(kTestDeviceName), device->GetName()); 94 EXPECT_EQ(base::UTF8ToUTF16(kTestDeviceName), device->GetNameForDisplay());
95 EXPECT_FALSE(device->IsPaired()); 95 EXPECT_FALSE(device->IsPaired());
96 BluetoothDevice::UUIDList uuids = device->GetUUIDs(); 96 BluetoothDevice::UUIDList uuids = device->GetUUIDs();
97 EXPECT_TRUE(ContainsValue(uuids, BluetoothUUID(kTestUUIDGenericAccess))); 97 EXPECT_TRUE(ContainsValue(uuids, BluetoothUUID(kTestUUIDGenericAccess)));
98 EXPECT_TRUE(ContainsValue(uuids, BluetoothUUID(kTestUUIDGenericAttribute))); 98 EXPECT_TRUE(ContainsValue(uuids, BluetoothUUID(kTestUUIDGenericAttribute)));
99 } 99 }
100 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) 100 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN)
101 101
102 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) 102 #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN)
103 // Device with no advertised Service UUIDs. 103 // Device with no advertised Service UUIDs.
104 TEST_F(BluetoothTest, LowEnergyDeviceNoUUIDs) { 104 TEST_F(BluetoothTest, LowEnergyDeviceNoUUIDs) {
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 ResetEventCounts(); 635 ResetEventCounts();
636 SimulateGattConnection(device); 636 SimulateGattConnection(device);
637 EXPECT_EQ(1, gatt_discovery_attempts_); 637 EXPECT_EQ(1, gatt_discovery_attempts_);
638 638
639 SimulateGattServicesDiscoveryError(device); 639 SimulateGattServicesDiscoveryError(device);
640 EXPECT_EQ(0u, device->GetGattServices().size()); 640 EXPECT_EQ(0u, device->GetGattServices().size());
641 } 641 }
642 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) 642 #endif // defined(OS_ANDROID) || defined(OS_MACOSX)
643 643
644 } // namespace device 644 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_device.cc ('k') | device/bluetooth/bluez/bluetooth_bluez_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698