VolumeControlService: Improve succeed connect test
If service got stopped when connect is ongoing, it seems sent intent will not contain valid device, which will break a test: java.lang.AssertionError at org.junit.Assert.fail(Assert.java:87) at org.junit.Assert.assertTrue(Assert.java:42) at org.junit.Assert.assertNotNull(Assert.java:713) at org.junit.Assert.assertNotNull(Assert.java:723) at com.android.bluetooth.vc.VolumeControlServiceTest$VolumeControlIntentReceiver.onReceive(VolumeControlServiceTest.java:154) For the testing purpose we want to keep null check in the broadcastreceiver, therefore we change a test in the way that it ends when CONNECTING state is propagated. Bug: 209486207 Test: atest VolumeControlServiceTest Change-Id: I5167aeca83e84fe5a78f29554e9d61d62a12426c
Loading
Please register or sign in to comment