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

Unified Diff: device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc

Issue 2728623004: Fix getting notified twice after subscribe to notifications and call readValue (Closed)
Patch Set: address comments 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/bluez/bluetooth_gatt_bluez_unittest.cc
diff --git a/device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc b/device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc
index d8538b6e0734214fa8b8e1704f42931132fd4edc..f0b756d85781f3a32239a794ba3e2721d6c4771b 100644
--- a/device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc
+++ b/device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc
@@ -1119,7 +1119,7 @@ TEST_F(BluetoothGattBlueZTest, GattCharacteristicValue) {
base::Unretained(this)));
EXPECT_EQ(2, success_callback_count_);
EXPECT_EQ(4, error_callback_count_);
- EXPECT_EQ(1, observer.gatt_characteristic_value_changed_count());
+ EXPECT_EQ(0, observer.gatt_characteristic_value_changed_count());
EXPECT_TRUE(ValuesEqual(characteristic->GetValue(), last_read_value_));
// Test long-running actions.
@@ -1143,7 +1143,7 @@ TEST_F(BluetoothGattBlueZTest, GattCharacteristicValue) {
// tne next one.
EXPECT_EQ(2, success_callback_count_);
EXPECT_EQ(4, error_callback_count_);
- EXPECT_EQ(1, observer.gatt_characteristic_value_changed_count());
+ EXPECT_EQ(0, observer.gatt_characteristic_value_changed_count());
// Next read should error because IN_PROGRESS
characteristic->ReadRemoteCharacteristic(
@@ -1157,7 +1157,7 @@ TEST_F(BluetoothGattBlueZTest, GattCharacteristicValue) {
// But previous call finished.
EXPECT_EQ(3, success_callback_count_);
- EXPECT_EQ(2, observer.gatt_characteristic_value_changed_count());
+ EXPECT_EQ(1, observer.gatt_characteristic_value_changed_count());
ortuno 2017/03/06 09:15:37 Please spend some time trying to understand tests
juncai 2017/03/08 23:20:39 Done.
EXPECT_TRUE(ValuesEqual(characteristic->GetValue(), last_read_value_));
fake_bluetooth_gatt_characteristic_client_->SetExtraProcessing(0);
@@ -1172,7 +1172,7 @@ TEST_F(BluetoothGattBlueZTest, GattCharacteristicValue) {
EXPECT_EQ(6, error_callback_count_);
EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_NOT_AUTHORIZED,
last_service_error_);
- EXPECT_EQ(2, observer.gatt_characteristic_value_changed_count());
+ EXPECT_EQ(1, observer.gatt_characteristic_value_changed_count());
fake_bluetooth_gatt_characteristic_client_->SetAuthorized(true);
// Test unauthenticated / needs login.
@@ -1186,7 +1186,7 @@ TEST_F(BluetoothGattBlueZTest, GattCharacteristicValue) {
EXPECT_EQ(7, error_callback_count_);
EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_NOT_PAIRED,
last_service_error_);
- EXPECT_EQ(2, observer.gatt_characteristic_value_changed_count());
+ EXPECT_EQ(1, observer.gatt_characteristic_value_changed_count());
fake_bluetooth_gatt_characteristic_client_->SetAuthenticated(true);
}

Powered by Google App Engine
This is Rietveld 408576698