Lines Matching refs:Activity
19 import android.app.Activity;
31 * This class provides isolated testing of a single activity. The activity under test will
33 * wrappered versions of many of Activity's dependencies. Most of the work is handled
38 * <p>It must be noted that, as a true unit test, your Activity will not be running in the
43 * <li>{@link android.app.Activity#createPendingResult(int, Intent, int)}</li>
44 * <li>{@link android.app.Activity#startActivityIfNeeded(Intent, int)}</li>
45 * <li>{@link android.app.Activity#startActivityFromChild(Activity, Intent, int)}</li>
46 * <li>{@link android.app.Activity#startNextMatchingActivity(Intent)}</li>
47 * <li>{@link android.app.Activity#getCallingActivity()}</li>
48 * <li>{@link android.app.Activity#getCallingPackage()}</li>
49 * <li>{@link android.app.Activity#createPendingResult(int, Intent, int)}</li>
50 * <li>{@link android.app.Activity#getTaskId()}</li>
51 * <li>{@link android.app.Activity#isTaskRoot()}</li>
52 * <li>{@link android.app.Activity#moveTaskToBack(boolean)}</li>
59 * <li>{@link android.app.Activity#startActivity(Intent)}</li>
60 * <li>{@link android.app.Activity#startActivityForResult(Intent, int)}</li>
67 * <li>{@link android.app.Activity#finish()}</li>
68 * <li>{@link android.app.Activity#finishFromChild(Activity child)}</li>
69 * <li>{@link android.app.Activity#finishActivity(int requestCode)}</li>
73 public abstract class ActivityUnitTestCase<T extends Activity>
103 * Start the activity under test, in the same way as if it was started by
105 * arguments it supplied. When you use this method to start the activity, it will automatically
108 * <p>This method will call onCreate(), but if you wish to further exercise Activity life
118 * Activity if it calls {@link android.app.Activity#getLastNonConfigurationInstance()}.
120 * @return Returns the Activity that was created
124 assertFalse("Activity already created", mCreated);
180 * @param application The Application object that will be injected into the Activity under test.
196 * This method will return the value if your Activity under test calls
197 * {@link android.app.Activity#setRequestedOrientation}.
207 * This method will return the launch intent if your Activity under test calls
208 * {@link android.app.Activity#startActivity(Intent)} or
209 * {@link android.app.Activity#startActivityForResult(Intent, int)}.
220 * This method will return the launch request code if your Activity under test calls
221 * {@link android.app.Activity#startActivityForResult(Intent, int)}.
232 * This method will notify you if the Activity under test called
233 * {@link android.app.Activity#finish()},
234 * {@link android.app.Activity#finishFromChild(Activity)}, or
235 * {@link android.app.Activity#finishActivity(int)}.
246 * This method will return the request code if the Activity under test called
247 * {@link android.app.Activity#finishActivity(int)}.
258 * This mock Activity represents the "parent" activity. By injecting this, we allow the user
259 * to call a few more Activity methods, including:
261 * <li>{@link android.app.Activity#getRequestedOrientation()}</li>
262 * <li>{@link android.app.Activity#setRequestedOrientation(int)}</li>
263 * <li>{@link android.app.Activity#finish()}</li>
264 * <li>{@link android.app.Activity#finishActivity(int requestCode)}</li>
265 * <li>{@link android.app.Activity#finishFromChild(Activity child)}</li>
270 private static class MockParent extends Activity {
279 * Implementing in the parent allows the user to call this function on the tested activity.
287 * Implementing in the parent allows the user to call this function on the tested activity.
303 * By defining this in the parent, we allow the tested activity to call
305 * <li>{@link android.app.Activity#startActivity(Intent)}</li>
306 * <li>{@link android.app.Activity#startActivityForResult(Intent, int)}</li>
310 public void startActivityFromChild(Activity child, Intent intent, int requestCode) {
316 * By defining this in the parent, we allow the tested activity to call
318 * <li>{@link android.app.Activity#finish()}</li>
319 * <li>{@link android.app.Activity#finishFromChild(Activity child)}</li>
323 public void finishFromChild(Activity child) {
328 * By defining this in the parent, we allow the tested activity to call
330 * <li>{@link android.app.Activity#finishActivity(int requestCode)}</li>
334 public void finishActivityFromChild(Activity child, int requestCode) {