Loading android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlStateMachineTest.java +10 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ import org.mockito.junit.MockitoRule; @RunWith(AndroidJUnit4.class) public class VolumeControlStateMachineTest { private BluetoothAdapter mAdapter; private HandlerThread mHandlerThread; private HandlerThread mHandlerThread = null; private VolumeControlStateMachine mVolumeControlStateMachine; private BluetoothDevice mTestDevice; private static final int TIMEOUT_MS = 1000; Loading @@ -67,6 +67,8 @@ public class VolumeControlStateMachineTest { @Mock private VolumeControlService mVolumeControlService; @Mock private VolumeControlNativeInterface mVolumeControlNativeInterface; boolean mIsAdapterServiceSet; @Before public void setUp() throws Exception { InstrumentationRegistry.getInstrumentation() Loading @@ -75,6 +77,7 @@ public class VolumeControlStateMachineTest { TestUtils.setAdapterService(mAdapterService); mAdapter = BluetoothAdapter.getDefaultAdapter(); mIsAdapterServiceSet = true; // Get a device for testing mTestDevice = mAdapter.getRemoteDevice("00:01:02:03:04:05"); Loading @@ -95,9 +98,13 @@ public class VolumeControlStateMachineTest { @After public void tearDown() throws Exception { if (mHandlerThread != null) { mHandlerThread.quit(); } if (mIsAdapterServiceSet) { TestUtils.clearAdapterService(mAdapterService); } } /** Test that default state is disconnected */ @Test Loading Loading
android/app/tests/unit/src/com/android/bluetooth/vc/VolumeControlStateMachineTest.java +10 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ import org.mockito.junit.MockitoRule; @RunWith(AndroidJUnit4.class) public class VolumeControlStateMachineTest { private BluetoothAdapter mAdapter; private HandlerThread mHandlerThread; private HandlerThread mHandlerThread = null; private VolumeControlStateMachine mVolumeControlStateMachine; private BluetoothDevice mTestDevice; private static final int TIMEOUT_MS = 1000; Loading @@ -67,6 +67,8 @@ public class VolumeControlStateMachineTest { @Mock private VolumeControlService mVolumeControlService; @Mock private VolumeControlNativeInterface mVolumeControlNativeInterface; boolean mIsAdapterServiceSet; @Before public void setUp() throws Exception { InstrumentationRegistry.getInstrumentation() Loading @@ -75,6 +77,7 @@ public class VolumeControlStateMachineTest { TestUtils.setAdapterService(mAdapterService); mAdapter = BluetoothAdapter.getDefaultAdapter(); mIsAdapterServiceSet = true; // Get a device for testing mTestDevice = mAdapter.getRemoteDevice("00:01:02:03:04:05"); Loading @@ -95,9 +98,13 @@ public class VolumeControlStateMachineTest { @After public void tearDown() throws Exception { if (mHandlerThread != null) { mHandlerThread.quit(); } if (mIsAdapterServiceSet) { TestUtils.clearAdapterService(mAdapterService); } } /** Test that default state is disconnected */ @Test Loading