Package org.robolectric.android.internal
Class RoboMonitoringInstrumentation
java.lang.Object
android.app.Instrumentation
org.robolectric.android.internal.RoboMonitoringInstrumentation
public class RoboMonitoringInstrumentation extends Instrumentation
A Robolectric instrumentation that acts like a slimmed down
MonitoringInstrumentation
with only the parts needed for
Robolectric.-
Nested Class Summary
Nested classes/interfaces inherited from class android.app.Instrumentation
Instrumentation.ActivityMonitor, Instrumentation.ActivityResult, Instrumentation.UiAutomationFlags
-
Field Summary
Fields inherited from class android.app.Instrumentation
REPORT_KEY_IDENTIFIER, REPORT_KEY_STREAMRESULT
-
Constructor Summary
Constructors Constructor Description RoboMonitoringInstrumentation()
-
Method Summary
Modifier and Type Method Description void
callActivityOnCreate(Activity activity, Bundle bundle)
void
callActivityOnDestroy(Activity activity)
void
callActivityOnPause(Activity activity)
void
callActivityOnRestart(Activity activity)
void
callActivityOnResume(Activity activity)
void
callActivityOnStart(Activity activity)
void
callActivityOnStop(Activity activity)
void
callApplicationOnCreate(Application app)
void
execStartActivities(Context who, IBinder contextThread, IBinder token, Activity target, Intent[] intents, Bundle options)
Instrumentation.ActivityResult
execStartActivity(Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode, Bundle options)
Instrumentation.ActivityResult
execStartActivity(Context who, IBinder contextThread, IBinder token, String target, Intent intent, int requestCode, Bundle options)
This API was added in Android API 23 (M)Instrumentation.ActivityResult
execStartActivity(Context who, IBinder contextThread, IBinder token, String target, Intent intent, int requestCode, Bundle options, UserHandle user)
This API was added in Android API 17 (JELLY_BEAN_MR1)void
finish(int resultCode, Bundle bundle)
Context
getContext()
Context
getTargetContext()
protected String
getThreadState()
void
onCreate(Bundle arguments)
Sets up lifecycle monitoring, and argument registry.boolean
onException(Object obj, Throwable e)
void
runOnMainSync(Runnable runner)
void
setInTouchMode(boolean inTouch)
Activity
startActivitySync(Intent intent)
ActivityController<? extends Activity>
startActivitySyncInternal(Intent intent)
void
waitForIdleSync()
Methods inherited from class android.app.Instrumentation
acquireLooperManager, addMonitor, addMonitor, addMonitor, addResults, callActivityOnCreate, callActivityOnNewIntent, callActivityOnNewIntent, callActivityOnPictureInPictureRequested, callActivityOnPostCreate, callActivityOnPostCreate, callActivityOnRestoreInstanceState, callActivityOnRestoreInstanceState, callActivityOnSaveInstanceState, callActivityOnSaveInstanceState, callActivityOnUserLeaving, checkMonitorHit, checkStartActivityResult, endPerformanceSnapshot, execStartActivitiesAsUser, execStartActivityAsCaller, execStartActivityFromAppTask, getAllocCounts, getBinderCounts, getComponentName, getProcessName, getUiAutomation, getUiAutomation, invokeContextMenuAction, invokeMenuActionSync, isProfiling, newActivity, newActivity, newApplication, newApplication, onDestroy, onEnterAnimationComplete, onStart, removeMonitor, sendCharacterSync, sendKeyDownUpSync, sendKeySync, sendPointerSync, sendStatus, sendStringSync, sendTrackballEventSync, setAutomaticPerformanceSnapshots, start, startActivitySync, startAllocCounting, startPerformanceSnapshot, startProfiling, stopAllocCounting, stopProfiling, waitForIdle, waitForMonitor, waitForMonitorWithTimeout
-
Constructor Details
-
RoboMonitoringInstrumentation
public RoboMonitoringInstrumentation()
-
-
Method Details
-
onCreate
Sets up lifecycle monitoring, and argument registry.Subclasses must call up to onCreate(). This onCreate method does not call start() it is the subclasses responsibility to call start if it desires.
- Overrides:
onCreate
in classInstrumentation
-
setInTouchMode
public void setInTouchMode(boolean inTouch)- Overrides:
setInTouchMode
in classInstrumentation
-
waitForIdleSync
public void waitForIdleSync()- Overrides:
waitForIdleSync
in classInstrumentation
-
startActivitySync
- Overrides:
startActivitySync
in classInstrumentation
-
startActivitySyncInternal
-
callApplicationOnCreate
- Overrides:
callApplicationOnCreate
in classInstrumentation
-
runOnMainSync
- Overrides:
runOnMainSync
in classInstrumentation
-
execStartActivity
public Instrumentation.ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode, Bundle options)- Overrides:
execStartActivity
in classInstrumentation
-
execStartActivity
public Instrumentation.ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, String target, Intent intent, int requestCode, Bundle options)This API was added in Android API 23 (M)- Overrides:
execStartActivity
in classInstrumentation
-
execStartActivity
public Instrumentation.ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, String target, Intent intent, int requestCode, Bundle options, UserHandle user)This API was added in Android API 17 (JELLY_BEAN_MR1)- Overrides:
execStartActivity
in classInstrumentation
-
execStartActivities
public void execStartActivities(Context who, IBinder contextThread, IBinder token, Activity target, Intent[] intents, Bundle options)- Overrides:
execStartActivities
in classInstrumentation
-
onException
- Overrides:
onException
in classInstrumentation
-
getThreadState
-
callActivityOnDestroy
- Overrides:
callActivityOnDestroy
in classInstrumentation
-
callActivityOnRestart
- Overrides:
callActivityOnRestart
in classInstrumentation
-
callActivityOnCreate
- Overrides:
callActivityOnCreate
in classInstrumentation
-
callActivityOnStart
- Overrides:
callActivityOnStart
in classInstrumentation
-
callActivityOnStop
- Overrides:
callActivityOnStop
in classInstrumentation
-
callActivityOnResume
- Overrides:
callActivityOnResume
in classInstrumentation
-
callActivityOnPause
- Overrides:
callActivityOnPause
in classInstrumentation
-
finish
- Overrides:
finish
in classInstrumentation
-
getTargetContext
- Overrides:
getTargetContext
in classInstrumentation
-
getContext
- Overrides:
getContext
in classInstrumentation
-