public final class DummyMainThread extends Object
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
DummyMainThread.TestRunnable |
Runnable variant which can throw a checked exception. |
| Modifier and Type | Field | Description |
|---|---|---|
static int |
TIMEOUT_MS |
Default timeout value used for
runOnMainThread(Runnable). |
| Constructor | Description |
|---|---|
DummyMainThread() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
release() |
|
void |
runOnMainThread(int timeoutMs,
Runnable runnable) |
Runs the provided
Runnable on the main thread, blocking until execution completes or
until timeout milliseconds have passed. |
void |
runOnMainThread(Runnable runnable) |
Runs the provided
Runnable on the main thread, blocking until execution completes or
until TIMEOUT_MS milliseconds have passed. |
void |
runTestOnMainThread(int timeoutMs,
DummyMainThread.TestRunnable runnable) |
Runs the provided
DummyMainThread.TestRunnable on the main thread, blocking until execution completes
or until timeout milliseconds have passed. |
void |
runTestOnMainThread(DummyMainThread.TestRunnable runnable) |
Runs the provided
DummyMainThread.TestRunnable on the main thread, blocking until execution completes
or until TIMEOUT_MS milliseconds have passed. |
public static final int TIMEOUT_MS
runOnMainThread(Runnable).public void runOnMainThread(Runnable runnable)
Runnable on the main thread, blocking until execution completes or
until TIMEOUT_MS milliseconds have passed.runnable - The Runnable to run.public void runOnMainThread(int timeoutMs,
Runnable runnable)
Runnable on the main thread, blocking until execution completes or
until timeout milliseconds have passed.timeoutMs - The maximum time to wait in milliseconds.runnable - The Runnable to run.public void runTestOnMainThread(DummyMainThread.TestRunnable runnable)
DummyMainThread.TestRunnable on the main thread, blocking until execution completes
or until TIMEOUT_MS milliseconds have passed.runnable - The DummyMainThread.TestRunnable to run.public void runTestOnMainThread(int timeoutMs,
DummyMainThread.TestRunnable runnable)
DummyMainThread.TestRunnable on the main thread, blocking until execution completes
or until timeout milliseconds have passed.timeoutMs - The maximum time to wait in milliseconds.runnable - The DummyMainThread.TestRunnable to run.public void release()