| Index: device/bluetooth/test/bluetooth_test.cc
|
| diff --git a/device/bluetooth/test/bluetooth_test.cc b/device/bluetooth/test/bluetooth_test.cc
|
| index 77ecddcd6521aaecd14262cea07eae5759311a14..dcfd43e3403381d905c64079ee83e6323f2c15f9 100644
|
| --- a/device/bluetooth/test/bluetooth_test.cc
|
| +++ b/device/bluetooth/test/bluetooth_test.cc
|
| @@ -158,6 +158,22 @@ void BluetoothTestBase::GattErrorCallback(
|
| unexpected_error_callback_ = true;
|
| }
|
|
|
| +void BluetoothTestBase::ReentrantStartNotifySessionErrorCallback(
|
| + Call expected,
|
| + BluetoothGattCharacteristic* characteristic,
|
| + BluetoothGattService::GattErrorCode error_code) {
|
| + ++error_callback_count_;
|
| + last_gatt_error_code_ = error_code;
|
| +
|
| + if (expected == Call::EXPECTED)
|
| + ++actual_error_callback_calls_;
|
| + else
|
| + unexpected_error_callback_ = true;
|
| +
|
| + characteristic->StartNotifySession(GetNotifyCallback(Call::EXPECTED),
|
| + GetGattErrorCallback(Call::NOT_EXPECTED));
|
| +}
|
| +
|
| base::Closure BluetoothTestBase::GetCallback(Call expected) {
|
| if (expected == Call::EXPECTED)
|
| ++expected_success_callback_calls_;
|
| @@ -221,6 +237,17 @@ BluetoothTestBase::GetGattErrorCallback(Call expected) {
|
| weak_factory_.GetWeakPtr(), expected);
|
| }
|
|
|
| +base::Callback<void(BluetoothGattService::GattErrorCode)>
|
| +BluetoothTestBase::GetReentrantStartNotifySessionErrorCallback(
|
| + Call expected,
|
| + BluetoothGattCharacteristic* characteristic) {
|
| + if (expected == Call::EXPECTED)
|
| + ++expected_error_callback_calls_;
|
| + return base::Bind(
|
| + &BluetoothTestBase::ReentrantStartNotifySessionErrorCallback,
|
| + weak_factory_.GetWeakPtr(), expected, characteristic);
|
| +}
|
| +
|
| void BluetoothTestBase::ResetEventCounts() {
|
| last_connect_error_code_ = BluetoothDevice::ERROR_UNKNOWN;
|
| callback_count_ = 0;
|
|
|