Class LocalUiController

  • All Implemented Interfaces:
    androidx.test.platform.ui.UiController

    public class LocalUiController
    extends Object
    implements androidx.test.platform.ui.UiController
    A UiController that runs on a local JVM with Robolectric.
    • Constructor Detail

      • LocalUiController

        public LocalUiController()
    • Method Detail

      • setIdlingResourceTimeout

        @Beta
        public static void setIdlingResourceTimeout​(long timeout,
                                                    TimeUnit unit)
        Sets the error timeout for idling resources.

        See androidx.test.espresso.IdlingPolicies#setIdlingResourceTimeout(long, TimeUnit).

        Note: This API may be removed in the future in favor of using IdlingPolicies directly.

      • injectMotionEvent

        public boolean injectMotionEvent​(MotionEvent event)
                                  throws androidx.test.platform.ui.InjectEventSecurityException
        Specified by:
        injectMotionEvent in interface androidx.test.platform.ui.UiController
        Throws:
        androidx.test.platform.ui.InjectEventSecurityException
      • injectKeyEvent

        public boolean injectKeyEvent​(KeyEvent event)
                               throws androidx.test.platform.ui.InjectEventSecurityException
        Specified by:
        injectKeyEvent in interface androidx.test.platform.ui.UiController
        Throws:
        androidx.test.platform.ui.InjectEventSecurityException
      • injectString

        public boolean injectString​(String str)
                             throws androidx.test.platform.ui.InjectEventSecurityException
        Specified by:
        injectString in interface androidx.test.platform.ui.UiController
        Throws:
        androidx.test.platform.ui.InjectEventSecurityException
      • loopMainThreadUntilIdle

        public void loopMainThreadUntilIdle()
        Specified by:
        loopMainThreadUntilIdle in interface androidx.test.platform.ui.UiController
      • loopMainThreadForAtLeast

        public void loopMainThreadForAtLeast​(long millisDelay)
        Specified by:
        loopMainThreadForAtLeast in interface androidx.test.platform.ui.UiController