Loading framework/tests/bumble/src/android/bluetooth/GattClientTest.java +17 −20 Original line number Diff line number Diff line Loading @@ -87,7 +87,6 @@ public class GattClientTest { 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); gatt.close(); Loading @@ -100,16 +99,14 @@ public class GattClientTest { BluetoothGatt gatt2 = device.connectGatt(mContext, false, gattCallback2); verify(gattCallback2, timeout(1000)) .onConnectionStateChange(any(), anyInt(), eq(BluetoothProfile.STATE_CONNECTED)); gatt2.close(); disconnectAndWaitDisconnection(gatt2, gattCallback2); // After reconnecting with the second set of callback, check that nothing happened on // the first set of callback // After reconnecting, verify the first callback was not invoked. Collection<Invocation> invocationsAfterSomeTimes = mockingDetails(gattCallback).getInvocations(); int numberOfCallsAfterSomeTimes = invocationsAfterSomeTimes.size(); assertThat(numberOfCallsAfterSomeTimes).isEqualTo(numberOfCalls); } } @Test public void fullGattClientLifecycle() throws Exception { Loading Loading
framework/tests/bumble/src/android/bluetooth/GattClientTest.java +17 −20 Original line number Diff line number Diff line Loading @@ -87,7 +87,6 @@ public class GattClientTest { 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); gatt.close(); Loading @@ -100,16 +99,14 @@ public class GattClientTest { BluetoothGatt gatt2 = device.connectGatt(mContext, false, gattCallback2); verify(gattCallback2, timeout(1000)) .onConnectionStateChange(any(), anyInt(), eq(BluetoothProfile.STATE_CONNECTED)); gatt2.close(); disconnectAndWaitDisconnection(gatt2, gattCallback2); // After reconnecting with the second set of callback, check that nothing happened on // the first set of callback // After reconnecting, verify the first callback was not invoked. Collection<Invocation> invocationsAfterSomeTimes = mockingDetails(gattCallback).getInvocations(); int numberOfCallsAfterSomeTimes = invocationsAfterSomeTimes.size(); assertThat(numberOfCallsAfterSomeTimes).isEqualTo(numberOfCalls); } } @Test public void fullGattClientLifecycle() throws Exception { Loading