Index: device/bluetooth/test/bluetooth_test.cc |
diff --git a/device/bluetooth/test/bluetooth_test.cc b/device/bluetooth/test/bluetooth_test.cc |
index faeb71f0e3e0dcb412d6232710477dfa38bb8190..ee36dbac05a9adf2d96d322219796acc7a6f29fb 100644 |
--- a/device/bluetooth/test/bluetooth_test.cc |
+++ b/device/bluetooth/test/bluetooth_test.cc |
@@ -141,6 +141,25 @@ void BluetoothTestBase::NotifyCallback( |
unexpected_success_callback_ = true; |
} |
+void BluetoothTestBase::StopNotifyCallback( |
+ Call expected, |
+ BluetoothGattNotifySession* notify_session) { |
+ ++callback_count_; |
+ for (ScopedVector<BluetoothGattNotifySession>::iterator i = |
ortuno
2016/08/02 01:56:34
If you do this then you never get a chance to test
tommyt
2016/08/05 12:22:30
I have removed this and adjusted the unittests.
|
+ notify_sessions_.begin(); |
+ i != notify_sessions_.end(); ++i) { |
+ if (*i == notify_session) { |
+ notify_sessions_.erase(i); |
+ break; |
+ } |
+ } |
+ |
+ if (expected == Call::EXPECTED) |
+ ++actual_success_callback_calls_; |
+ else |
+ unexpected_success_callback_ = true; |
+} |
+ |
void BluetoothTestBase::ReadValueCallback(Call expected, |
const std::vector<uint8_t>& value) { |
++callback_count_; |
@@ -257,6 +276,15 @@ BluetoothTestBase::GetNotifyCallback(Call expected) { |
weak_factory_.GetWeakPtr(), expected); |
} |
+base::Closure BluetoothTestBase::GetStopNotifyCallback( |
+ Call expected, |
+ BluetoothGattNotifySession* notify_session) { |
+ if (expected == Call::EXPECTED) |
+ ++expected_success_callback_calls_; |
+ return base::Bind(&BluetoothTestBase::StopNotifyCallback, |
+ weak_factory_.GetWeakPtr(), expected, notify_session); |
+} |
+ |
BluetoothRemoteGattCharacteristic::ValueCallback |
BluetoothTestBase::GetReadValueCallback(Call expected) { |
if (expected == Call::EXPECTED) |