| Index: device/bluetooth/bluetooth_remote_gatt_service_unittest.cc
|
| diff --git a/device/bluetooth/bluetooth_gatt_service_unittest.cc b/device/bluetooth/bluetooth_remote_gatt_service_unittest.cc
|
| similarity index 89%
|
| rename from device/bluetooth/bluetooth_gatt_service_unittest.cc
|
| rename to device/bluetooth/bluetooth_remote_gatt_service_unittest.cc
|
| index bd108ede6073cffc29781a5ca287c4bc2d1f2021..7c2627b6e76e1a6b785aceb3b7d0f4afd94ca3bd 100644
|
| --- a/device/bluetooth/bluetooth_gatt_service_unittest.cc
|
| +++ b/device/bluetooth/bluetooth_remote_gatt_service_unittest.cc
|
| @@ -5,7 +5,7 @@
|
| #include "device/bluetooth/bluetooth_gatt_service.h"
|
|
|
| #include "build/build_config.h"
|
| -#include "device/bluetooth/bluetooth_gatt_characteristic.h"
|
| +#include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
|
| #include "device/bluetooth/test/test_bluetooth_adapter_observer.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -20,11 +20,11 @@
|
| namespace device {
|
|
|
| #if defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN)
|
| -class BluetoothGattServiceTest : public BluetoothTest {};
|
| +class BluetoothRemoteGattServiceTest : public BluetoothTest {};
|
| #endif
|
|
|
| #if defined(OS_ANDROID) || defined(OS_WIN)
|
| -TEST_F(BluetoothGattServiceTest, GetIdentifier) {
|
| +TEST_F(BluetoothRemoteGattServiceTest, GetIdentifier) {
|
| InitWithFakeAdapter();
|
| StartLowEnergyDiscoverySession();
|
| // 2 devices to verify unique IDs across them.
|
| @@ -44,10 +44,10 @@ TEST_F(BluetoothGattServiceTest, GetIdentifier) {
|
| services.push_back(uuid);
|
| SimulateGattServicesDiscovered(device1, services);
|
| SimulateGattServicesDiscovered(device2, services);
|
| - BluetoothGattService* service1 = device1->GetGattServices()[0];
|
| - BluetoothGattService* service2 = device1->GetGattServices()[1];
|
| - BluetoothGattService* service3 = device2->GetGattServices()[0];
|
| - BluetoothGattService* service4 = device2->GetGattServices()[1];
|
| + BluetoothRemoteGattService* service1 = device1->GetGattServices()[0];
|
| + BluetoothRemoteGattService* service2 = device1->GetGattServices()[1];
|
| + BluetoothRemoteGattService* service3 = device2->GetGattServices()[0];
|
| + BluetoothRemoteGattService* service4 = device2->GetGattServices()[1];
|
|
|
| // All IDs are unique, even though they have the same UUID.
|
| EXPECT_NE(service1->GetIdentifier(), service2->GetIdentifier());
|
| @@ -62,7 +62,7 @@ TEST_F(BluetoothGattServiceTest, GetIdentifier) {
|
| #endif // defined(OS_ANDROID) || defined(OS_WIN)
|
|
|
| #if defined(OS_ANDROID) || defined(OS_WIN)
|
| -TEST_F(BluetoothGattServiceTest, GetUUID) {
|
| +TEST_F(BluetoothRemoteGattServiceTest, GetUUID) {
|
| InitWithFakeAdapter();
|
| StartLowEnergyDiscoverySession();
|
| BluetoothDevice* device = DiscoverLowEnergyDevice(3);
|
| @@ -84,7 +84,7 @@ TEST_F(BluetoothGattServiceTest, GetUUID) {
|
| #endif // defined(OS_ANDROID) || defined(OS_WIN)
|
|
|
| #if defined(OS_ANDROID) || defined(OS_WIN)
|
| -TEST_F(BluetoothGattServiceTest, GetCharacteristics_FindNone) {
|
| +TEST_F(BluetoothRemoteGattServiceTest, GetCharacteristics_FindNone) {
|
| InitWithFakeAdapter();
|
| StartLowEnergyDiscoverySession();
|
| BluetoothDevice* device = DiscoverLowEnergyDevice(3);
|
| @@ -96,14 +96,15 @@ TEST_F(BluetoothGattServiceTest, GetCharacteristics_FindNone) {
|
| std::vector<std::string> services;
|
| services.push_back("00000000-0000-1000-8000-00805f9b34fb");
|
| SimulateGattServicesDiscovered(device, services);
|
| - BluetoothGattService* service = device->GetGattServices()[0];
|
| + BluetoothRemoteGattService* service = device->GetGattServices()[0];
|
|
|
| EXPECT_EQ(0u, service->GetCharacteristics().size());
|
| }
|
| #endif // defined(OS_ANDROID) || defined(OS_WIN)
|
|
|
| #if defined(OS_ANDROID) || defined(OS_WIN)
|
| -TEST_F(BluetoothGattServiceTest, GetCharacteristics_and_GetCharacteristic) {
|
| +TEST_F(BluetoothRemoteGattServiceTest,
|
| + GetCharacteristics_and_GetCharacteristic) {
|
| InitWithFakeAdapter();
|
| StartLowEnergyDiscoverySession();
|
| BluetoothDevice* device = DiscoverLowEnergyDevice(3);
|
| @@ -115,7 +116,7 @@ TEST_F(BluetoothGattServiceTest, GetCharacteristics_and_GetCharacteristic) {
|
| std::vector<std::string> services;
|
| services.push_back("00000000-0000-1000-8000-00805f9b34fb");
|
| SimulateGattServicesDiscovered(device, services);
|
| - BluetoothGattService* service = device->GetGattServices()[0];
|
| + BluetoothRemoteGattService* service = device->GetGattServices()[0];
|
| std::string characteristic_uuid1 = "11111111-0000-1000-8000-00805f9b34fb";
|
| std::string characteristic_uuid2 = "22222222-0000-1000-8000-00805f9b34fb";
|
| std::string characteristic_uuid3 = characteristic_uuid2; // Duplicate UUID.
|
| @@ -151,7 +152,8 @@ TEST_F(BluetoothGattServiceTest, GetCharacteristics_and_GetCharacteristic) {
|
| #endif // defined(OS_ANDROID) || defined(OS_WIN)
|
|
|
| #if defined(OS_WIN)
|
| -TEST_F(BluetoothGattServiceTest, GetCharacteristic_CharacteristicRemoved) {
|
| +TEST_F(BluetoothRemoteGattServiceTest,
|
| + GetCharacteristic_CharacteristicRemoved) {
|
| InitWithFakeAdapter();
|
| StartLowEnergyDiscoverySession();
|
| BluetoothDevice* device = DiscoverLowEnergyDevice(3);
|
| @@ -165,7 +167,7 @@ TEST_F(BluetoothGattServiceTest, GetCharacteristic_CharacteristicRemoved) {
|
| std::vector<std::string> services;
|
| services.push_back("00000000-0000-1000-8000-00805f9b34fb");
|
| SimulateGattServicesDiscovered(device, services);
|
| - BluetoothGattService* service = device->GetGattServices()[0];
|
| + BluetoothRemoteGattService* service = device->GetGattServices()[0];
|
| std::string characteristic_uuid1 = "11111111-0000-1000-8000-00805f9b34fb";
|
| std::string characteristic_uuid2 = "22222222-0000-1000-8000-00805f9b34fb";
|
| std::string characteristic_uuid3 = characteristic_uuid2; // Duplicate UUID.
|
| @@ -207,7 +209,7 @@ TEST_F(BluetoothGattServiceTest, GetCharacteristic_CharacteristicRemoved) {
|
| #endif // defined(OS_WIN)
|
|
|
| #if defined(OS_WIN)
|
| -TEST_F(BluetoothGattServiceTest, SimulateGattServiceRemove) {
|
| +TEST_F(BluetoothRemoteGattServiceTest, SimulateGattServiceRemove) {
|
| InitWithFakeAdapter();
|
| StartLowEnergyDiscoverySession();
|
| BluetoothDevice* device = DiscoverLowEnergyDevice(3);
|
| @@ -225,8 +227,8 @@ TEST_F(BluetoothGattServiceTest, SimulateGattServiceRemove) {
|
| EXPECT_EQ(2u, device->GetGattServices().size());
|
|
|
| // Simulate remove of a primary service.
|
| - BluetoothGattService* service1 = device->GetGattServices()[0];
|
| - BluetoothGattService* service2 = device->GetGattServices()[1];
|
| + BluetoothRemoteGattService* service1 = device->GetGattServices()[0];
|
| + BluetoothRemoteGattService* service2 = device->GetGattServices()[1];
|
| std::string removed_service = service1->GetIdentifier();
|
| SimulateGattServiceRemoved(device->GetGattService(removed_service));
|
| EXPECT_EQ(1, observer.gatt_service_removed_count());
|
|
|