HidHostTest: Use Mockito to wait for events instead of Future
* This helps get rid of unncessary broadcast receiver and listener classes * Before this change, there is no gurantee that A2DP, HFP, and HID_HOST service proxy will be connected on time during setUp() function. This change ensures that we always wait for service proxy connections * Before this change, some times the Future is created after calling the method under test, if the future is completed before the Future is completed, then we will wait forever for the future. This change makes sure this race condition won't happen * Added EnableBluetoothRule to toggle Bluetooth at each test, adding about 2 second delay to each test, but it makes the test much more stable Test: atest HidHostTest Flag: TEST_ONLY Bug: 363974008 Change-Id: I9e9a198bdccd1510f963a8bb85df78b5d52f54e7
Loading
Please register or sign in to comment