Package org.robolectric.android.internal
Class LocalUiController
java.lang.Object
org.robolectric.android.internal.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 Summary
Constructors Constructor Description LocalUiController()
-
Method Summary
Modifier and Type Method Description boolean
injectKeyEvent(KeyEvent event)
boolean
injectMotionEvent(MotionEvent event)
boolean
injectString(String str)
void
loopMainThreadForAtLeast(long millisDelay)
void
loopMainThreadUntilIdle()
static void
setIdlingResourceTimeout(long timeout, TimeUnit unit)
Sets the error timeout for idling resources.
-
Constructor Details
-
LocalUiController
public LocalUiController()
-
-
Method Details
-
setIdlingResourceTimeout
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 interfaceandroidx.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 interfaceandroidx.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 interfaceandroidx.test.platform.ui.UiController
- Throws:
androidx.test.platform.ui.InjectEventSecurityException
-
loopMainThreadUntilIdle
public void loopMainThreadUntilIdle()- Specified by:
loopMainThreadUntilIdle
in interfaceandroidx.test.platform.ui.UiController
-
loopMainThreadForAtLeast
public void loopMainThreadForAtLeast(long millisDelay)- Specified by:
loopMainThreadForAtLeast
in interfaceandroidx.test.platform.ui.UiController
-