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 downMonitoringInstrumentation
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
-
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, isInstrumenting, isProfiling, newActivity, newActivity, newApplication, newApplication, onDestroy, onEnterAnimationComplete, onStart, removeMonitor, sendCharacterSync, sendKeyDownUpSync, sendKeySync, sendPointerSync, sendStatus, sendStringSync, sendTrackballEventSync, setAutomaticPerformanceSnapshots, setInTouchMode, start, startActivitySync, startAllocCounting, startPerformanceSnapshot, startProfiling, stopAllocCounting, stopProfiling, waitForIdle, waitForMonitor, waitForMonitorWithTimeout
-
-
-
-
Method Detail
-
onCreate
public void onCreate(Bundle arguments)
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
-
waitForIdleSync
public void waitForIdleSync()
- Overrides:
waitForIdleSync
in classInstrumentation
-
startActivitySync
public Activity startActivitySync(Intent intent)
- Overrides:
startActivitySync
in classInstrumentation
-
startActivitySyncInternal
public ActivityController<? extends Activity> startActivitySyncInternal(Intent intent)
-
startActivitySyncInternal
public ActivityController<? extends Activity> startActivitySyncInternal(Intent intent, @Nullable Bundle activityOptions)
-
callApplicationOnCreate
public void callApplicationOnCreate(Application app)
- Overrides:
callApplicationOnCreate
in classInstrumentation
-
runOnMainSync
public void runOnMainSync(Runnable runner)
- 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
public boolean onException(Object obj, Throwable e)
- Overrides:
onException
in classInstrumentation
-
getThreadState
protected String getThreadState()
-
callActivityOnDestroy
public void callActivityOnDestroy(Activity activity)
- Overrides:
callActivityOnDestroy
in classInstrumentation
-
callActivityOnRestart
public void callActivityOnRestart(Activity activity)
- Overrides:
callActivityOnRestart
in classInstrumentation
-
callActivityOnCreate
public void callActivityOnCreate(Activity activity, Bundle bundle)
- Overrides:
callActivityOnCreate
in classInstrumentation
-
callActivityOnStart
public void callActivityOnStart(Activity activity)
- Overrides:
callActivityOnStart
in classInstrumentation
-
callActivityOnStop
public void callActivityOnStop(Activity activity)
- Overrides:
callActivityOnStop
in classInstrumentation
-
callActivityOnResume
public void callActivityOnResume(Activity activity)
- Overrides:
callActivityOnResume
in classInstrumentation
-
callActivityOnPause
public void callActivityOnPause(Activity activity)
- Overrides:
callActivityOnPause
in classInstrumentation
-
finish
public void finish(int resultCode, Bundle bundle)
- Overrides:
finish
in classInstrumentation
-
getTargetContext
public Context getTargetContext()
- Overrides:
getTargetContext
in classInstrumentation
-
getContext
public Context getContext()
- Overrides:
getContext
in classInstrumentation
-
-