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_connection.h" | 5 #include "components/proximity_auth/ble/bluetooth_low_energy_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> |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 .WillOnce( | 254 .WillOnce( |
255 DoAll(SaveArg<0>(&last_value_written_on_to_peripheral_char_), | 255 DoAll(SaveArg<0>(&last_value_written_on_to_peripheral_char_), |
256 SaveArg<1>(&write_remote_characteristic_success_callback_), | 256 SaveArg<1>(&write_remote_characteristic_success_callback_), |
257 SaveArg<2>(&write_remote_characteristic_error_callback_))); | 257 SaveArg<2>(&write_remote_characteristic_error_callback_))); |
258 EXPECT_FALSE(notify_session_error_callback_.is_null()); | 258 EXPECT_FALSE(notify_session_error_callback_.is_null()); |
259 ASSERT_FALSE(notify_session_success_callback_.is_null()); | 259 ASSERT_FALSE(notify_session_success_callback_.is_null()); |
260 | 260 |
261 // Store an alias for the notify session passed |connection|. | 261 // Store an alias for the notify session passed |connection|. |
262 std::unique_ptr<device::MockBluetoothGattNotifySession> notify_session( | 262 std::unique_ptr<device::MockBluetoothGattNotifySession> notify_session( |
263 new NiceMock<device::MockBluetoothGattNotifySession>( | 263 new NiceMock<device::MockBluetoothGattNotifySession>( |
264 kToPeripheralCharID)); | 264 to_peripheral_char_->GetWeakPtr())); |
265 notify_session_alias_ = notify_session.get(); | 265 notify_session_alias_ = notify_session.get(); |
266 | 266 |
267 notify_session_success_callback_.Run(std::move(notify_session)); | 267 notify_session_success_callback_.Run(std::move(notify_session)); |
268 task_runner_->RunUntilIdle(); | 268 task_runner_->RunUntilIdle(); |
269 | 269 |
270 EXPECT_EQ(connection->sub_status(), | 270 EXPECT_EQ(connection->sub_status(), |
271 BluetoothLowEnergyConnection::SubStatus::WAITING_RESPONSE_SIGNAL); | 271 BluetoothLowEnergyConnection::SubStatus::WAITING_RESPONSE_SIGNAL); |
272 EXPECT_EQ(connection->status(), Connection::IN_PROGRESS); | 272 EXPECT_EQ(connection->status(), Connection::IN_PROGRESS); |
273 } | 273 } |
274 | 274 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 create_gatt_connection_success_callback_.Run( | 694 create_gatt_connection_success_callback_.Run( |
695 base::WrapUnique(new NiceMock<device::MockBluetoothGattConnection>( | 695 base::WrapUnique(new NiceMock<device::MockBluetoothGattConnection>( |
696 adapter_, kTestRemoteDeviceBluetoothAddress))); | 696 adapter_, kTestRemoteDeviceBluetoothAddress))); |
697 | 697 |
698 CharacteristicsFound(connection.get()); | 698 CharacteristicsFound(connection.get()); |
699 NotifySessionStarted(connection.get()); | 699 NotifySessionStarted(connection.get()); |
700 ResponseSignalReceived(connection.get()); | 700 ResponseSignalReceived(connection.get()); |
701 } | 701 } |
702 | 702 |
703 } // namespace proximity_auth | 703 } // namespace proximity_auth |
OLD | NEW |