| OLD | NEW |
| 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 "components/proximity_auth/bluetooth_connection_finder.h" | 5 #include "components/proximity_auth/bluetooth_connection_finder.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace | 123 } // namespace |
| 124 | 124 |
| 125 class ProximityAuthBluetoothConnectionFinderTest : public testing::Test { | 125 class ProximityAuthBluetoothConnectionFinderTest : public testing::Test { |
| 126 protected: | 126 protected: |
| 127 ProximityAuthBluetoothConnectionFinderTest() | 127 ProximityAuthBluetoothConnectionFinderTest() |
| 128 : adapter_(new NiceMock<device::MockBluetoothAdapter>), | 128 : adapter_(new NiceMock<device::MockBluetoothAdapter>), |
| 129 bluetooth_device_(new NiceMock<device::MockBluetoothDevice>( | 129 bluetooth_device_(new NiceMock<device::MockBluetoothDevice>( |
| 130 adapter_.get(), | 130 adapter_.get(), |
| 131 device::BluetoothDevice::DEVICE_PHONE, | 131 static_cast<uint32_t>(device::BluetoothDeviceType::PHONE), |
| 132 kTestRemoteDeviceName, | 132 kTestRemoteDeviceName, |
| 133 kTestRemoteDeviceBluetoothAddress, | 133 kTestRemoteDeviceBluetoothAddress, |
| 134 true, | 134 true, |
| 135 false)), | 135 false)), |
| 136 connection_callback_(base::Bind( | 136 connection_callback_(base::Bind( |
| 137 &ProximityAuthBluetoothConnectionFinderTest::OnConnectionFound, | 137 &ProximityAuthBluetoothConnectionFinderTest::OnConnectionFound, |
| 138 base::Unretained(this))) { | 138 base::Unretained(this))) { |
| 139 device::BluetoothAdapterFactory::SetAdapterForTesting(adapter_); | 139 device::BluetoothAdapterFactory::SetAdapterForTesting(adapter_); |
| 140 | 140 |
| 141 // By default, configure the environment to allow polling. Individual tests | 141 // By default, configure the environment to allow polling. Individual tests |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 358 |
| 359 // Successfully connect to the Bluetooth device. | 359 // Successfully connect to the Bluetooth device. |
| 360 ON_CALL(*adapter_, GetDevice(kTestRemoteDeviceBluetoothAddress)) | 360 ON_CALL(*adapter_, GetDevice(kTestRemoteDeviceBluetoothAddress)) |
| 361 .WillByDefault(Return(bluetooth_device_.get())); | 361 .WillByDefault(Return(bluetooth_device_.get())); |
| 362 MockConnection* connection = connection_finder_.ExpectCreateConnection(); | 362 MockConnection* connection = connection_finder_.ExpectCreateConnection(); |
| 363 connection_finder_.seek_callback().Run(); | 363 connection_finder_.seek_callback().Run(); |
| 364 SimulateDeviceConnection(connection); | 364 SimulateDeviceConnection(connection); |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace proximity_auth | 367 } // namespace proximity_auth |
| OLD | NEW |