Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_gatt_service.h" | 5 #include "device/bluetooth/bluetooth_gatt_service.h" |
| 6 | 6 |
| 7 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_android.h" | 7 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_android.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 #if defined(OS_ANDROID) | 10 #if defined(OS_ANDROID) |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 EXPECT_NE(char3->GetIdentifier(), char5->GetIdentifier()); | 75 EXPECT_NE(char3->GetIdentifier(), char5->GetIdentifier()); |
| 76 EXPECT_NE(char3->GetIdentifier(), char6->GetIdentifier()); | 76 EXPECT_NE(char3->GetIdentifier(), char6->GetIdentifier()); |
| 77 | 77 |
| 78 EXPECT_NE(char4->GetIdentifier(), char5->GetIdentifier()); | 78 EXPECT_NE(char4->GetIdentifier(), char5->GetIdentifier()); |
| 79 EXPECT_NE(char4->GetIdentifier(), char6->GetIdentifier()); | 79 EXPECT_NE(char4->GetIdentifier(), char6->GetIdentifier()); |
| 80 | 80 |
| 81 EXPECT_NE(char5->GetIdentifier(), char6->GetIdentifier()); | 81 EXPECT_NE(char5->GetIdentifier(), char6->GetIdentifier()); |
| 82 } | 82 } |
| 83 #endif // defined(OS_ANDROID) | 83 #endif // defined(OS_ANDROID) |
| 84 | 84 |
| 85 #if defined(OS_ANDROID) | |
| 86 TEST_F(BluetoothGattCharacteristicTest, GetUUID) { | |
| 87 InitWithFakeAdapter(); | |
| 88 StartLowEnergyDiscoverySession(); | |
| 89 BluetoothDevice* device = DiscoverLowEnergyDevice(3); | |
| 90 device->CreateGattConnection(GetGattConnectionCallback(), | |
| 91 GetConnectErrorCallback()); | |
| 92 SimulateGattConnection(device); | |
| 93 std::vector<std::string> services; | |
| 94 services.push_back("00000000-0000-1000-8000-00805f9b34fb"); | |
| 95 SimulateGattServicesDiscovered(device, services); | |
| 96 BluetoothGattService* service = device->GetGattServices()[0]; | |
| 97 | |
| 98 BluetoothUUID characteristic_uuid("22222222-0000-1000-8000-00805f9b34fb"); | |
| 99 SimulateGattCharacteristic(service, characteristic_uuid.canonical_value()); | |
| 100 SimulateGattCharacteristic(service, characteristic_uuid.canonical_value()); | |
| 101 | |
| 102 // Each has the same UUID. | |
| 103 EXPECT_EQ(characteristic_uuid, service->GetCharacteristics()[0]->GetUUID()); | |
| 104 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.
| |
| 105 } | |
| 106 #endif // defined(OS_ANDROID) | |
| 107 | |
| 85 } // namespace device | 108 } // namespace device |
| OLD | NEW |