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

Unified Diff: device/bluetooth/test/bluetooth_test.h

Issue 2695573002: Adding BluetoothTestBase::CheckNotifySessionValue() method (Closed)
Patch Set: Cleanup Created 3 years, 10 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
Index: device/bluetooth/test/bluetooth_test.h
diff --git a/device/bluetooth/test/bluetooth_test.h b/device/bluetooth/test/bluetooth_test.h
index 52b6224174cf9a314d7a3983ab59dd6ff4fec8b2..7490800cbb739ce7acc65f3d71c03a11ae3a319a 100644
--- a/device/bluetooth/test/bluetooth_test.h
+++ b/device/bluetooth/test/bluetooth_test.h
@@ -56,6 +56,12 @@ class BluetoothTestBase : public testing::Test {
HEART_RATE_DEVICE,
};
+ enum class NotifyValueState {
+ NONE,
+ NOTIFY,
+ INDICATE,
+ };
+
static const std::string kTestAdapterName;
static const std::string kTestAdapterAddress;
@@ -401,6 +407,13 @@ class BluetoothTestBase : public testing::Test {
virtual void SimulateGattDescriptorWriteWillFailSynchronouslyOnce(
BluetoothRemoteGattDescriptor* descriptor) {}
+ // Tests if the notify value attemps.
+ virtual void ExpectedChangeNotifyValueAttempts(int attempts);
+
+ // Tests if the notify session has been changed. The default implementation
+ // uses descriptors.
+ virtual void ExpectedNotifyValue(NotifyValueState expected_value_state);
+
// Returns a list of local GATT services registered with the adapter.
virtual std::vector<BluetoothLocalGattService*> RegisteredGattServices();
@@ -465,7 +478,7 @@ class BluetoothTestBase : public testing::Test {
bool error_in_reentrant);
// Reset all event count members to 0.
- void ResetEventCounts();
+ virtual void ResetEventCounts();
void RemoveTimedOutDevices();
@@ -488,7 +501,6 @@ class BluetoothTestBase : public testing::Test {
int gatt_connection_attempts_ = 0;
int gatt_disconnection_attempts_ = 0;
int gatt_discovery_attempts_ = 0;
- int gatt_notify_characteristic_attempts_ = 0;
int gatt_read_characteristic_attempts_ = 0;
int gatt_write_characteristic_attempts_ = 0;
int gatt_read_descriptor_attempts_ = 0;

Powered by Google App Engine
This is Rietveld 408576698