Chromium Code Reviews| Index: device/bluetooth/bluetooth_device_unittest.cc |
| diff --git a/device/bluetooth/bluetooth_device_unittest.cc b/device/bluetooth/bluetooth_device_unittest.cc |
| index 0b075e250d02187bba5c4bd989889af0079a1a9c..4a2e20c15ab79e40d47bd45994eac080b8533497 100644 |
| --- a/device/bluetooth/bluetooth_device_unittest.cc |
| +++ b/device/bluetooth/bluetooth_device_unittest.cc |
| @@ -472,6 +472,7 @@ TEST_F(BluetoothTest, BluetoothGattConnection_DisconnectGatt_Cleanup) { |
| GetConnectErrorCallback(Call::NOT_EXPECTED)); |
| TestBluetoothAdapterObserver observer(adapter_); |
| SimulateGattConnection(device); |
| + EXPECT_EQ(1, observer.device_changed_count()); |
|
scheib
2016/05/24 23:34:34
These additions are fine, but I sought a simpler t
Jeffrey Yasskin
2016/05/25 00:08:12
Done.
|
| EXPECT_TRUE(device->IsConnected()); |
| // Discover services |
| @@ -486,6 +487,7 @@ TEST_F(BluetoothTest, BluetoothGattConnection_DisconnectGatt_Cleanup) { |
| // Disconnect from the device |
| device->DisconnectGatt(); |
| SimulateGattDisconnection(device); |
| + EXPECT_EQ(2, observer.device_changed_count()); |
| EXPECT_FALSE(device->IsConnected()); |
| EXPECT_FALSE(device->IsGattServicesDiscoveryComplete()); |
| EXPECT_EQ(0u, device->GetGattServices().size()); |
| @@ -494,6 +496,7 @@ TEST_F(BluetoothTest, BluetoothGattConnection_DisconnectGatt_Cleanup) { |
| device->CreateGattConnection(GetGattConnectionCallback(Call::EXPECTED), |
| GetConnectErrorCallback(Call::NOT_EXPECTED)); |
| SimulateGattConnection(device); |
| + EXPECT_EQ(3, observer.device_changed_count()); |
| EXPECT_TRUE(device->IsConnected()); |
| // Verify that service discovery can be done again |
| @@ -552,6 +555,7 @@ TEST_F(BluetoothTest, GattServices_ObserversCalls) { |
| TestBluetoothAdapterObserver observer(adapter_); |
| ResetEventCounts(); |
| SimulateGattConnection(device); |
| + EXPECT_EQ(1, observer.device_changed_count()); |
| EXPECT_EQ(1, gatt_discovery_attempts_); |
| std::vector<std::string> services; |
| @@ -561,6 +565,9 @@ TEST_F(BluetoothTest, GattServices_ObserversCalls) { |
| EXPECT_EQ(1, observer.gatt_services_discovered_count()); |
| EXPECT_EQ(2, observer.gatt_service_added_count()); |
| + |
| + SimulateGattDisconnection(device); |
| + EXPECT_EQ(2, observer.device_changed_count()); |
| } |
| #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_MACOSX) |