Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e40dc61e authored by Jackal Guo's avatar Jackal Guo
Browse files

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
parent abe2fed8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -189,6 +189,7 @@ public class AccessibilityManagerServiceTest extends AndroidTestCase {
    public void testOnSystemActionsChanged() throws Exception {
        setupAccessibilityServiceConnection();
        mA11yms.notifySystemActionsChangedLocked(mUserState);
        InstrumentationRegistry.getInstrumentation().waitForIdleSync();
        verify(mMockServiceClient).onSystemActionsChanged();
    }
}