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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc

Issue 2646443010: bluetooth: Test cancelling a Stop notify session request (Closed)
Patch Set: Clean up Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
index 0b09275d3f8ca3683ec07e9250492f7b23ad5288..62ab03f4489c1648ba22e23412badb7b2b038ee2 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
@@ -1514,6 +1514,28 @@ TEST_F(BluetoothRemoteGattCharacteristicTest,
#endif // defined(OS_ANDROID)
#if defined(OS_ANDROID)
scheib 2017/01/20 18:00:59 Why only Android?
ortuno 2017/01/22 23:57:43 Added TODO for mac and windows.
+// Tests that cancelling StopNotifySession works.
+TEST_F(BluetoothRemoteGattCharacteristicTest, StopNotifySession_Cancelled) {
+ ASSERT_NO_FATAL_FAILURE(StartNotifyBoilerplate(
+ /* properties: NOTIFY */ 0x10,
+ /* expected_config_descriptor_value: NOTIFY */ 1));
+
+ // Check that the session is correctly setup.
+ std::string characteristic_identifier = characteristic1_->GetIdentifier();
+ EXPECT_EQ(characteristic_identifier,
+ notify_sessions_[0]->GetCharacteristicIdentifier());
+ EXPECT_EQ(characteristic1_, notify_sessions_[0]->GetCharacteristic());
+ EXPECT_TRUE(notify_sessions_[0]->IsActive());
+
+ // Queue a Stop request.
+ notify_sessions_[0]->Stop(GetStopNotifyCallback(Call::EXPECTED));
+
+ // Cancel Stop by deleting the device before Stop finishes.
+ DeleteDevice(device_); // TODO(576906) delete only the characteristic.
+}
+#endif // defined(OS_ANDROID)
+
+#if defined(OS_ANDROID)
// Tests that deleted sessions are stopped.
TEST_F(BluetoothRemoteGattCharacteristicTest, StopNotifySession_AfterDeleted) {
ASSERT_NO_FATAL_FAILURE(StartNotifyBoilerplate(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698