Fix AccessibilityManagerServiceTest
AccessibilityServiceConnection would send a message, and notify all
IAccessibilityServiceClient in the main thread. The message may not
be sent immediately. Using waitForIdleSync before verify to ensure
the target method is invoked.
Bug: 150345707
Test: atest FrameworksServicesTests:com.android.server.accessibility
Test: atest --rerun-until-failure 100 \
AccessibilityManagerServiceTest#testOnSystemActionsChanged
Change-Id: I6a796772e00f55d6523e1f12703c17b0fd931f9c
This commit is contained in:
@@ -189,6 +189,7 @@ public class AccessibilityManagerServiceTest extends AndroidTestCase {
|
||||
public void testOnSystemActionsChanged() throws Exception {
|
||||
setupAccessibilityServiceConnection();
|
||||
mA11yms.notifySystemActionsChangedLocked(mUserState);
|
||||
InstrumentationRegistry.getInstrumentation().waitForIdleSync();
|
||||
verify(mMockServiceClient).onSystemActionsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user