| Index: device/bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc
|
| diff --git a/device/bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc b/device/bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc
|
| index c96c1a419250a740869f2323fdb12b5f5321e711..7a163257b0501a3b11581480df5f97cefe81ccb9 100644
|
| --- a/device/bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc
|
| +++ b/device/bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc
|
| @@ -16,6 +16,9 @@ TestBluetoothLocalGattServiceDelegate::TestBluetoothLocalGattServiceDelegate()
|
| expected_characteristic_(nullptr),
|
| expected_descriptor_(nullptr) {}
|
|
|
| +TestBluetoothLocalGattServiceDelegate::
|
| + ~TestBluetoothLocalGattServiceDelegate() {}
|
| +
|
| void TestBluetoothLocalGattServiceDelegate::OnCharacteristicReadRequest(
|
| const BluetoothLocalGattService* service,
|
| const BluetoothLocalGattCharacteristic* characteristic,
|
| @@ -80,4 +83,31 @@ void TestBluetoothLocalGattServiceDelegate::OnDescriptorWriteRequest(
|
| callback.Run();
|
| }
|
|
|
| +void TestBluetoothLocalGattServiceDelegate::OnNotificationsStart(
|
| + const BluetoothLocalGattService* service,
|
| + const BluetoothLocalGattCharacteristic* characteristic) {
|
| + EXPECT_EQ(expected_service_, service);
|
| + EXPECT_EQ(expected_characteristic_, characteristic);
|
| + notifications_started_for_characteristic_[characteristic->GetIdentifier()] =
|
| + true;
|
| +}
|
| +
|
| +void TestBluetoothLocalGattServiceDelegate::OnNotificationsStop(
|
| + const BluetoothLocalGattService* service,
|
| + const BluetoothLocalGattCharacteristic* characteristic) {
|
| + EXPECT_EQ(expected_service_, service);
|
| + EXPECT_EQ(expected_characteristic_, characteristic);
|
| + notifications_started_for_characteristic_[characteristic->GetIdentifier()] =
|
| + false;
|
| +}
|
| +
|
| +bool TestBluetoothLocalGattServiceDelegate::NotificationStatusForCharacteristic(
|
| + BluetoothLocalGattCharacteristic* characteristic) {
|
| + auto found = notifications_started_for_characteristic_.find(
|
| + characteristic->GetIdentifier());
|
| + if (found == notifications_started_for_characteristic_.end())
|
| + return false;
|
| + return found->second;
|
| +}
|
| +
|
| } // namespace device
|
|
|