Chromium Code Reviews| Index: device/bluetooth/test/bluetooth_test_android.cc |
| diff --git a/device/bluetooth/test/bluetooth_test_android.cc b/device/bluetooth/test/bluetooth_test_android.cc |
| index e23a83549ac28d2335792c175c007c43fbcdcb19..d41cf5354f5b4f3e955455bc5b966fb7e4c0da56 100644 |
| --- a/device/bluetooth/test/bluetooth_test_android.cc |
| +++ b/device/bluetooth/test/bluetooth_test_android.cc |
| @@ -36,6 +36,14 @@ void BluetoothTestAndroid::SetUp() { |
| ASSERT_TRUE(RegisterNativesImpl(AttachCurrentThread())); |
| } |
| +void BluetoothTestAndroid::TearDown() { |
| + BluetoothAdapter::DeviceList devices = adapter_->GetDevices(); |
| + for (auto& device : devices) { |
| + DeleteDevice(device); |
| + } |
| + EXPECT_EQ(0, gatt_open_connections_); |
| +} |
|
scheib
2016/02/01 18:18:48
Also call BluetoothTest::TearDown()
tommyt
2016/02/02 09:48:30
I even read the comment in bluetooth_test.h that s
|
| + |
| bool BluetoothTestAndroid::PlatformSupportsLowEnergy() { |
| return true; |
| } |
| @@ -289,6 +297,7 @@ void BluetoothTestAndroid::SimulateGattDescriptorWriteWillFailSynchronouslyOnce( |
| void BluetoothTestAndroid::OnFakeBluetoothDeviceConnectGattCalled( |
| JNIEnv* env, |
| const JavaParamRef<jobject>& caller) { |
| + gatt_open_connections_++; |
| gatt_connection_attempts_++; |
| } |
| @@ -298,6 +307,15 @@ void BluetoothTestAndroid::OnFakeBluetoothGattDisconnect( |
| gatt_disconnection_attempts_++; |
| } |
| +void BluetoothTestAndroid::OnFakeBluetoothGattClose( |
| + JNIEnv* env, |
| + const JavaParamRef<jobject>& caller) { |
| + gatt_open_connections_--; |
| + |
| + // close implies disconnect |
| + gatt_disconnection_attempts_++; |
| +} |
| + |
| void BluetoothTestAndroid::OnFakeBluetoothGattDiscoverServices( |
| JNIEnv* env, |
| const JavaParamRef<jobject>& caller) { |