| 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 "components/proximity_auth/ble/bluetooth_low_energy_characteristics_fin
der.h" | 5 #include "components/cryptauth/ble/bluetooth_low_energy_characteristics_finder.h
" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "components/proximity_auth/ble/remote_attribute.h" | 11 #include "components/cryptauth/ble/remote_attribute.h" |
| 12 #include "device/bluetooth/bluetooth_adapter_factory.h" | 12 #include "device/bluetooth/bluetooth_adapter_factory.h" |
| 13 #include "device/bluetooth/bluetooth_uuid.h" | 13 #include "device/bluetooth/bluetooth_uuid.h" |
| 14 #include "device/bluetooth/test/mock_bluetooth_adapter.h" | 14 #include "device/bluetooth/test/mock_bluetooth_adapter.h" |
| 15 #include "device/bluetooth/test/mock_bluetooth_device.h" | 15 #include "device/bluetooth/test/mock_bluetooth_device.h" |
| 16 #include "device/bluetooth/test/mock_bluetooth_gatt_characteristic.h" | 16 #include "device/bluetooth/test/mock_bluetooth_gatt_characteristic.h" |
| 17 #include "device/bluetooth/test/mock_bluetooth_gatt_service.h" | 17 #include "device/bluetooth/test/mock_bluetooth_gatt_service.h" |
| 18 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 | 20 |
| 21 using testing::_; | 21 using testing::_; |
| 22 using testing::AtLeast; | 22 using testing::AtLeast; |
| 23 using testing::NiceMock; | 23 using testing::NiceMock; |
| 24 using testing::Return; | 24 using testing::Return; |
| 25 using testing::StrictMock; | 25 using testing::StrictMock; |
| 26 using testing::SaveArg; | 26 using testing::SaveArg; |
| 27 | 27 |
| 28 namespace proximity_auth { | 28 namespace cryptauth { |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 const char kDeviceName[] = "Device name"; | 31 const char kDeviceName[] = "Device name"; |
| 32 const char kBluetoothAddress[] = "11:22:33:44:55:66"; | 32 const char kBluetoothAddress[] = "11:22:33:44:55:66"; |
| 33 | 33 |
| 34 const char kServiceUUID[] = "DEADBEEF-CAFE-FEED-FOOD-D15EA5EBEEEF"; | 34 const char kServiceUUID[] = "DEADBEEF-CAFE-FEED-FOOD-D15EA5EBEEEF"; |
| 35 const char kToPeripheralCharUUID[] = "FBAE09F2-0482-11E5-8418-1697F925EC7B"; | 35 const char kToPeripheralCharUUID[] = "FBAE09F2-0482-11E5-8418-1697F925EC7B"; |
| 36 const char kFromPeripheralCharUUID[] = "5539ED10-0483-11E5-8418-1697F925EC7B"; | 36 const char kFromPeripheralCharUUID[] = "5539ED10-0483-11E5-8418-1697F925EC7B"; |
| 37 | 37 |
| 38 const char kToPeripheralCharID[] = "to peripheral id"; | 38 const char kToPeripheralCharID[] = "to peripheral id"; |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 static_cast<device::BluetoothAdapter::Observer*>(&characteristic_finder); | 285 static_cast<device::BluetoothAdapter::Observer*>(&characteristic_finder); |
| 286 | 286 |
| 287 EXPECT_EQ(kToPeripheralCharID, found_to_char.id); | 287 EXPECT_EQ(kToPeripheralCharID, found_to_char.id); |
| 288 EXPECT_EQ(kFromPeripheralCharID, found_from_char.id); | 288 EXPECT_EQ(kFromPeripheralCharID, found_from_char.id); |
| 289 | 289 |
| 290 EXPECT_CALL(*service_, GetUUID()) | 290 EXPECT_CALL(*service_, GetUUID()) |
| 291 .WillOnce(Return(device::BluetoothUUID(kServiceUUID))); | 291 .WillOnce(Return(device::BluetoothUUID(kServiceUUID))); |
| 292 observer->GattDiscoveryCompleteForService(adapter_.get(), service_.get()); | 292 observer->GattDiscoveryCompleteForService(adapter_.get(), service_.get()); |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace proximity_auth | 295 } // namespace cryptauth |
| OLD | NEW |