@Override public void setUp() throws Exception { super.setUp(); // Work around dexmaker issue when running tests on Android 4.3 System.setProperty("dexmaker.dexcache", getInstrumentation().getTargetContext().getCacheDir().getPath()); }
@Override public void run() { Bundle outState = new Bundle(); test.getInstrumentation().callActivityOnSaveInstanceState(activity, outState); test.getInstrumentation().callActivityOnPause(activity); test.getInstrumentation().callActivityOnResume(activity); test.getInstrumentation().callActivityOnRestoreInstanceState(activity, outState); } });
public static void saveAndRestoreInstanceState(final InstrumentationTestCase test, final Activity activity) throws Throwable { test.runTestOnUiThread(new Runnable() { @Override public void run() { Bundle outState = new Bundle(); test.getInstrumentation().callActivityOnSaveInstanceState(activity, outState); test.getInstrumentation().callActivityOnPause(activity); test.getInstrumentation().callActivityOnResume(activity); test.getInstrumentation().callActivityOnRestoreInstanceState(activity, outState); } }); test.getInstrumentation().waitForIdleSync(); }
@Override public void tearDown() throws Exception { super.tearDown(); } }
/** * Launches the main chat. * * <p>Use {@link #goBack(Solo)} or {@link #goHome(Solo)} to navigate to an already opened main chat. * Use this method if the main chat has been finished and closed.</p> * * @param testCase The test that needs to launch the main chat. */ public static void launchMainChat(final InstrumentationTestCase testCase) { final String packageName = testCase.getInstrumentation().getTargetContext().getPackageName(); testCase.launchActivity(packageName, MainChatController.class, null); }
@TargetApi(5) @Override public void injectInstrumentation(InstrumentationTestCase test, Instrumentation instrumentation) { test.injectInstrumentation(instrumentation); } }
@SuppressWarnings("deprecation") @Override public void injectInstrumentation(InstrumentationTestCase test, Instrumentation instrumentation) { test.injectInsrumentation(instrumentation); } }
@Override public void tearDown() throws Exception { super.tearDown(); } }
@TargetApi(5) @Override public void injectInstrumentation(InstrumentationTestCase test, Instrumentation instrumentation) { test.injectInstrumentation(instrumentation); } }
@SuppressWarnings("deprecation") @Override public void injectInstrumentation(InstrumentationTestCase test, Instrumentation instrumentation) { test.injectInsrumentation(instrumentation); } }
@Override public void setUp() throws Exception { super.setUp(); }
@Override protected void tearDown() throws Exception { uut = null; prefs = null; editor = null; super.tearDown(); }
public AssertionBase(InstrumentationTestCase testCase, Activity activity) { this.testCase = testCase; this.instrumentation = testCase.getInstrumentation(); this.activity = activity; }
@Override public void setUp() throws Exception { super.setUp(); }
public void tearDown() throws Exception { super.tearDown(); }
Instrumentation inst = test.getInstrumentation();
@Override protected void setUp() throws Exception { super.setUp(); //Intent intent = new Intent(); // intent.setClassName("com.fatcat.filetransfer.utils",FileUtils.class.getName()); // intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); }
public void tearDown() throws Exception { super.tearDown(); }
public static MockCalendarContentProvider getContentProvider(InstrumentationTestCase testCase) throws JSONException { MockContentResolver mockResolver = new MockContentResolver(); Context isolatedContext = new IsolatedContext(mockResolver, testCase.getInstrumentation().getTargetContext()); MockCalendarContentProvider contentProvider = new MockCalendarContentProvider(isolatedContext); mockResolver.addProvider("com.android.calendar", contentProvider); mockResolver.addProvider("settings", new MockSettingsProvider()); return contentProvider; }
public void setUp() throws Exception { super.setUp(); }