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/proximity_auth/ble/bluetooth_low_energy_weave_client_connec
tion.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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 .WillOnce( | 479 .WillOnce( |
480 DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_), | 480 DoAll(SaveArg<0>(&last_value_written_on_tx_characteristic_), |
481 SaveArg<1>(&write_remote_characteristic_success_callback_), | 481 SaveArg<1>(&write_remote_characteristic_success_callback_), |
482 SaveArg<2>(&write_remote_characteristic_error_callback_))); | 482 SaveArg<2>(&write_remote_characteristic_error_callback_))); |
483 EXPECT_FALSE(notify_session_error_callback_.is_null()); | 483 EXPECT_FALSE(notify_session_error_callback_.is_null()); |
484 ASSERT_FALSE(notify_session_success_callback_.is_null()); | 484 ASSERT_FALSE(notify_session_success_callback_.is_null()); |
485 | 485 |
486 // Store an alias for the notify session passed |connection|. | 486 // Store an alias for the notify session passed |connection|. |
487 std::unique_ptr<device::MockBluetoothGattNotifySession> notify_session( | 487 std::unique_ptr<device::MockBluetoothGattNotifySession> notify_session( |
488 new NiceMock<device::MockBluetoothGattNotifySession>( | 488 new NiceMock<device::MockBluetoothGattNotifySession>( |
489 kTXCharacteristicID)); | 489 tx_characteristic_->GetWeakPtr())); |
490 notify_session_alias_ = notify_session.get(); | 490 notify_session_alias_ = notify_session.get(); |
491 | 491 |
492 notify_session_success_callback_.Run(std::move(notify_session)); | 492 notify_session_success_callback_.Run(std::move(notify_session)); |
493 task_runner_->RunUntilIdle(); | 493 task_runner_->RunUntilIdle(); |
494 | 494 |
495 // Written value contains only the mock Connection Request. | 495 // Written value contains only the mock Connection Request. |
496 EXPECT_EQ(last_value_written_on_tx_characteristic_, kConnectionRequest); | 496 EXPECT_EQ(last_value_written_on_tx_characteristic_, kConnectionRequest); |
497 | 497 |
498 EXPECT_EQ(connection->sub_status(), SubStatus::WAITING_CONNECTION_RESPONSE); | 498 EXPECT_EQ(connection->sub_status(), SubStatus::WAITING_CONNECTION_RESPONSE); |
499 EXPECT_EQ(connection->status(), Connection::IN_PROGRESS); | 499 EXPECT_EQ(connection->status(), Connection::IN_PROGRESS); |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 adapter_, kTestRemoteDeviceBluetoothAddress))); | 1040 adapter_, kTestRemoteDeviceBluetoothAddress))); |
1041 | 1041 |
1042 CharacteristicsFound(connection.get()); | 1042 CharacteristicsFound(connection.get()); |
1043 NotifySessionStarted(connection.get()); | 1043 NotifySessionStarted(connection.get()); |
1044 ConnectionResponseReceived(connection.get(), kDefaultMaxPacketSize); | 1044 ConnectionResponseReceived(connection.get(), kDefaultMaxPacketSize); |
1045 } | 1045 } |
1046 | 1046 |
1047 } // namespace weave | 1047 } // namespace weave |
1048 | 1048 |
1049 } // namespace proximity_auth | 1049 } // namespace proximity_auth |
OLD | NEW |