Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Unified Diff: device/bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc

Issue 1973703002: Implement //device/bt changes for notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notifications_dbus
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/test/test_bluetooth_local_gatt_service_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « device/bluetooth/test/test_bluetooth_local_gatt_service_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698