OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_weave_client_connec
tion.h" | 5 #include "components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.
h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
16 #include "base/test/test_simple_task_runner.h" | 16 #include "base/test/test_simple_task_runner.h" |
| 17 #include "components/cryptauth/bluetooth_throttler.h" |
| 18 #include "components/cryptauth/connection_finder.h" |
| 19 #include "components/cryptauth/connection_observer.h" |
| 20 #include "components/cryptauth/cryptauth_test_util.h" |
17 #include "components/cryptauth/remote_device.h" | 21 #include "components/cryptauth/remote_device.h" |
18 #include "components/proximity_auth/bluetooth_throttler.h" | 22 #include "components/cryptauth/wire_message.h" |
19 #include "components/proximity_auth/connection_finder.h" | |
20 #include "components/proximity_auth/connection_observer.h" | |
21 #include "components/proximity_auth/proximity_auth_test_util.h" | |
22 #include "components/proximity_auth/wire_message.h" | |
23 #include "device/bluetooth/bluetooth_adapter_factory.h" | 23 #include "device/bluetooth/bluetooth_adapter_factory.h" |
24 #include "device/bluetooth/test/mock_bluetooth_adapter.h" | 24 #include "device/bluetooth/test/mock_bluetooth_adapter.h" |
25 #include "device/bluetooth/test/mock_bluetooth_device.h" | 25 #include "device/bluetooth/test/mock_bluetooth_device.h" |
26 #include "device/bluetooth/test/mock_bluetooth_discovery_session.h" | 26 #include "device/bluetooth/test/mock_bluetooth_discovery_session.h" |
27 #include "device/bluetooth/test/mock_bluetooth_gatt_characteristic.h" | 27 #include "device/bluetooth/test/mock_bluetooth_gatt_characteristic.h" |
28 #include "device/bluetooth/test/mock_bluetooth_gatt_connection.h" | 28 #include "device/bluetooth/test/mock_bluetooth_gatt_connection.h" |
29 #include "device/bluetooth/test/mock_bluetooth_gatt_notify_session.h" | 29 #include "device/bluetooth/test/mock_bluetooth_gatt_notify_session.h" |
30 #include "testing/gmock/include/gmock/gmock.h" | 30 #include "testing/gmock/include/gmock/gmock.h" |
31 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
32 | 32 |
33 using testing::_; | 33 using testing::_; |
34 using testing::AtLeast; | 34 using testing::AtLeast; |
35 using testing::NiceMock; | 35 using testing::NiceMock; |
36 using testing::Return; | 36 using testing::Return; |
37 using testing::StrictMock; | 37 using testing::StrictMock; |
38 using testing::SaveArg; | 38 using testing::SaveArg; |
39 | 39 |
40 namespace proximity_auth { | 40 namespace cryptauth { |
41 namespace { | 41 namespace { |
42 | 42 |
43 class MockBluetoothThrottler : public BluetoothThrottler { | 43 class MockBluetoothThrottler : public BluetoothThrottler { |
44 public: | 44 public: |
45 MockBluetoothThrottler() {} | 45 MockBluetoothThrottler() {} |
46 ~MockBluetoothThrottler() override {} | 46 ~MockBluetoothThrottler() override {} |
47 | 47 |
48 MOCK_CONST_METHOD0(GetDelay, base::TimeDelta()); | 48 MOCK_CONST_METHOD0(GetDelay, base::TimeDelta()); |
49 MOCK_METHOD1(OnConnection, void(Connection* connection)); | 49 MOCK_METHOD1(OnConnection, void(Connection* connection)); |
50 | 50 |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 base::MakeUnique<NiceMock<device::MockBluetoothGattConnection>>( | 1046 base::MakeUnique<NiceMock<device::MockBluetoothGattConnection>>( |
1047 adapter_, kTestRemoteDeviceBluetoothAddress)); | 1047 adapter_, kTestRemoteDeviceBluetoothAddress)); |
1048 | 1048 |
1049 CharacteristicsFound(connection.get()); | 1049 CharacteristicsFound(connection.get()); |
1050 NotifySessionStarted(connection.get()); | 1050 NotifySessionStarted(connection.get()); |
1051 ConnectionResponseReceived(connection.get(), kDefaultMaxPacketSize); | 1051 ConnectionResponseReceived(connection.get(), kDefaultMaxPacketSize); |
1052 } | 1052 } |
1053 | 1053 |
1054 } // namespace weave | 1054 } // namespace weave |
1055 | 1055 |
1056 } // namespace proximity_auth | 1056 } // namespace cryptauth |
OLD | NEW |