Loading framework/tests/bumble/src/android/bluetooth/pairing/PairingTest.java +185 −183 Original line number Diff line number Diff line Loading @@ -107,11 +107,11 @@ public class PairingTest { @Rule(order = 3) public final EnableBluetoothRule mEnableBluetoothRule = new EnableBluetoothRule(false /* enableTestMode */, true /* toggleBluetooth */); private final Map<String, Integer> mActionRegistrationCounts = new HashMap<>(); private final StreamObserverSpliterator<PairingEvent> mPairingEventStreamObserver = new StreamObserverSpliterator<>(); @Mock private BroadcastReceiver mReceiver; @Mock private BroadcastReceiver mReceiver; private InOrder mInOrder = null; private BluetoothDevice mBumbleDevice; Loading Loading @@ -300,8 +300,8 @@ public class PairingTest { * <li>Service discovery completes * <li>Android cancels the pairing * </ol> * <p> * Expectation: Pairing gets cancelled instead of getting timed out * * <p>Expectation: Pairing gets cancelled instead of getting timed out */ @Test public void testCancelBondLe_WithGattServiceDiscovery() { Loading Loading @@ -350,8 +350,8 @@ public class PairingTest { * <li>Android does confirms the pairing * <li>Pairing is successful * </ol> * <p> * Expectation: Pairing succeeds * * <p>Expectation: Pairing succeeds */ @Test public void testBondLe_WithGattServiceDiscovery() { Loading Loading @@ -396,8 +396,8 @@ public class PairingTest { * <li>Bumble is connectable over LE * <li>Android reconnects to Bumble successfully and re-encrypts the link * </ol> * <p> * Expectation: Pairing succeeds * * <p>Expectation: Pairing succeeds */ @Test public void testBondLe_Reconnect() { Loading @@ -417,6 +417,7 @@ public class PairingTest { .setConnectable(true) .setOwnAddressType(OwnAddressType.PUBLIC) .build()); assertThat(mBumbleDevice.connect()).isEqualTo(BluetoothStatusCodes.SUCCESS); verifyIntentReceived( hasAction(BluetoothDevice.ACTION_ACL_CONNECTED), Loading Loading @@ -460,7 +461,8 @@ public class PairingTest { hasAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED), hasExtra(BluetoothDevice.EXTRA_DEVICE, mBumbleDevice), hasExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_BONDING)); verifyIntentReceived(hasAction(BluetoothDevice.ACTION_ACL_CONNECTED), verifyIntentReceived( hasAction(BluetoothDevice.ACTION_ACL_CONNECTED), hasExtra(BluetoothDevice.EXTRA_DEVICE, mBumbleDevice), hasExtra(BluetoothDevice.EXTRA_TRANSPORT, BluetoothDevice.TRANSPORT_LE)); verifyIntentReceivedUnordered( Loading Loading
framework/tests/bumble/src/android/bluetooth/pairing/PairingTest.java +185 −183 Original line number Diff line number Diff line Loading @@ -107,11 +107,11 @@ public class PairingTest { @Rule(order = 3) public final EnableBluetoothRule mEnableBluetoothRule = new EnableBluetoothRule(false /* enableTestMode */, true /* toggleBluetooth */); private final Map<String, Integer> mActionRegistrationCounts = new HashMap<>(); private final StreamObserverSpliterator<PairingEvent> mPairingEventStreamObserver = new StreamObserverSpliterator<>(); @Mock private BroadcastReceiver mReceiver; @Mock private BroadcastReceiver mReceiver; private InOrder mInOrder = null; private BluetoothDevice mBumbleDevice; Loading Loading @@ -300,8 +300,8 @@ public class PairingTest { * <li>Service discovery completes * <li>Android cancels the pairing * </ol> * <p> * Expectation: Pairing gets cancelled instead of getting timed out * * <p>Expectation: Pairing gets cancelled instead of getting timed out */ @Test public void testCancelBondLe_WithGattServiceDiscovery() { Loading Loading @@ -350,8 +350,8 @@ public class PairingTest { * <li>Android does confirms the pairing * <li>Pairing is successful * </ol> * <p> * Expectation: Pairing succeeds * * <p>Expectation: Pairing succeeds */ @Test public void testBondLe_WithGattServiceDiscovery() { Loading Loading @@ -396,8 +396,8 @@ public class PairingTest { * <li>Bumble is connectable over LE * <li>Android reconnects to Bumble successfully and re-encrypts the link * </ol> * <p> * Expectation: Pairing succeeds * * <p>Expectation: Pairing succeeds */ @Test public void testBondLe_Reconnect() { Loading @@ -417,6 +417,7 @@ public class PairingTest { .setConnectable(true) .setOwnAddressType(OwnAddressType.PUBLIC) .build()); assertThat(mBumbleDevice.connect()).isEqualTo(BluetoothStatusCodes.SUCCESS); verifyIntentReceived( hasAction(BluetoothDevice.ACTION_ACL_CONNECTED), Loading Loading @@ -460,7 +461,8 @@ public class PairingTest { hasAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED), hasExtra(BluetoothDevice.EXTRA_DEVICE, mBumbleDevice), hasExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.BOND_BONDING)); verifyIntentReceived(hasAction(BluetoothDevice.ACTION_ACL_CONNECTED), verifyIntentReceived( hasAction(BluetoothDevice.ACTION_ACL_CONNECTED), hasExtra(BluetoothDevice.EXTRA_DEVICE, mBumbleDevice), hasExtra(BluetoothDevice.EXTRA_TRANSPORT, BluetoothDevice.TRANSPORT_LE)); verifyIntentReceivedUnordered( Loading