Chromium Code Reviews| 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( |