@Implements(value=android.os.AsyncTask.class, shadowPicker=Picker.class, isInAndroidSdk=false) public class ShadowPausedAsyncTask<Params,Progress,Result> extends ShadowAsyncTask
AsyncTask
shadow for LooperMode.Mode.PAUSED
This is beta API, and will likely be renamed/removed in a future Robolectric release.
ShadowAsyncTask.Picker
Constructor | Description |
---|---|
ShadowPausedAsyncTask() |
Modifier and Type | Method | Description |
---|---|---|
protected AsyncTask<Params,Progress,Result> |
executeOnExecutor(Executor exec,
Params... params) |
|
static void |
overrideExecutor(Executor executor) |
Globally override the executor used for all AsyncTask#execute* calls.
|
static void |
reset() |
@Resetter public static void reset()
@Implementation protected AsyncTask<Params,Progress,Result> executeOnExecutor(Executor exec, Params... params)
public static void overrideExecutor(Executor executor)
This can be useful if you want to use a more determinstic executor for tests, like PausedExecutorService
or InlineExecutorService
.
Use this API as a last resort. Its recommended instead to use dependency injection to provide a custom executor to AsyncTask#executeOnExecutor.
Beta API, may be removed or changed in a future Robolectric release