Loading framework/tests/bumble/src/android/bluetooth/GattClientTest.java +5 −21 Original line number Diff line number Diff line Loading @@ -100,25 +100,9 @@ public class GattClientTest { @Test public void fullGattClientLifecycle() throws Exception { advertiseWithBumble(); BluetoothDevice device = mAdapter.getRemoteLeDevice( Utils.BUMBLE_RANDOM_ADDRESS, BluetoothDevice.ADDRESS_TYPE_RANDOM); for (int i = 0; i < 10; i++) { BluetoothGattCallback gattCallback = mock(BluetoothGattCallback.class); BluetoothGatt gatt = device.connectGatt(mContext, false, gattCallback); verify(gattCallback, timeout(1000)) .onConnectionStateChange(any(), anyInt(), eq(BluetoothProfile.STATE_CONNECTED)); gatt.disconnect(); verify(gattCallback, timeout(1000)) .onConnectionStateChange( any(), anyInt(), eq(BluetoothProfile.STATE_DISCONNECTED)); gatt.close(); } BluetoothGatt gatt = connectGattAndWaitConnection(gattCallback); disconnectAndWaitDisconnection(gatt, gattCallback); } @Test Loading Loading @@ -179,9 +163,9 @@ public class GattClientTest { private void disconnectAndWaitDisconnection( BluetoothGatt gatt, BluetoothGattCallback callback) { final int state = BluetoothProfile.STATE_DISCONNECTED; gatt.disconnect(); verify(callback, timeout(1000)) .onConnectionStateChange(any(), anyInt(), eq(BluetoothProfile.STATE_DISCONNECTED)); verify(callback, timeout(1000)).onConnectionStateChange(eq(gatt), anyInt(), eq(state)); gatt.close(); gatt = null; Loading Loading
framework/tests/bumble/src/android/bluetooth/GattClientTest.java +5 −21 Original line number Diff line number Diff line Loading @@ -100,25 +100,9 @@ public class GattClientTest { @Test public void fullGattClientLifecycle() throws Exception { advertiseWithBumble(); BluetoothDevice device = mAdapter.getRemoteLeDevice( Utils.BUMBLE_RANDOM_ADDRESS, BluetoothDevice.ADDRESS_TYPE_RANDOM); for (int i = 0; i < 10; i++) { BluetoothGattCallback gattCallback = mock(BluetoothGattCallback.class); BluetoothGatt gatt = device.connectGatt(mContext, false, gattCallback); verify(gattCallback, timeout(1000)) .onConnectionStateChange(any(), anyInt(), eq(BluetoothProfile.STATE_CONNECTED)); gatt.disconnect(); verify(gattCallback, timeout(1000)) .onConnectionStateChange( any(), anyInt(), eq(BluetoothProfile.STATE_DISCONNECTED)); gatt.close(); } BluetoothGatt gatt = connectGattAndWaitConnection(gattCallback); disconnectAndWaitDisconnection(gatt, gattCallback); } @Test Loading Loading @@ -179,9 +163,9 @@ public class GattClientTest { private void disconnectAndWaitDisconnection( BluetoothGatt gatt, BluetoothGattCallback callback) { final int state = BluetoothProfile.STATE_DISCONNECTED; gatt.disconnect(); verify(callback, timeout(1000)) .onConnectionStateChange(any(), anyInt(), eq(BluetoothProfile.STATE_DISCONNECTED)); verify(callback, timeout(1000)).onConnectionStateChange(eq(gatt), anyInt(), eq(state)); gatt.close(); gatt = null; Loading