use of android.app.Instrumentation in project android_packages_apps_Camera by CyanogenMod.
the class ImageCapture method testFrontImageCapture.
@LargeTest
public void testFrontImageCapture() throws Exception {
Instrumentation inst = getInstrumentation();
Intent intent = new Intent();
intent.setClass(getInstrumentation().getTargetContext(), CameraActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(EXTRAS_CAMERA_FACING, android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT);
Activity act = inst.startActivitySync(intent);
Thread.sleep(WAIT_FOR_SWITCH_CAMERA);
captureImages("Front Camera Image Capture\n", inst);
act.finish();
}
use of android.app.Instrumentation in project android_packages_apps_Camera by CyanogenMod.
the class VideoCapture method testBackVideoCapture.
@LargeTest
public void testBackVideoCapture() throws Exception {
Instrumentation inst = getInstrumentation();
Intent intent = new Intent(MediaStore.INTENT_ACTION_VIDEO_CAMERA);
intent.setClass(getInstrumentation().getTargetContext(), CameraActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(EXTRAS_CAMERA_FACING, android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK);
Activity act = inst.startActivitySync(intent);
Thread.sleep(WAIT_FOR_SWITCH_CAMERA);
captureVideos("Back Camera Video Capture\n", inst);
act.finish();
}
use of android.app.Instrumentation in project android_packages_apps_Camera by CyanogenMod.
the class VideoCapture method testFrontVideoCapture.
@LargeTest
public void testFrontVideoCapture() throws Exception {
Instrumentation inst = getInstrumentation();
Intent intent = new Intent(MediaStore.INTENT_ACTION_VIDEO_CAMERA);
intent.setClass(getInstrumentation().getTargetContext(), CameraActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(EXTRAS_CAMERA_FACING, android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT);
Activity act = inst.startActivitySync(intent);
Thread.sleep(WAIT_FOR_SWITCH_CAMERA);
captureVideos("Front Camera Video Capture\n", inst);
act.finish();
}
use of android.app.Instrumentation in project appium-espresso-driver by appium.
the class CreateSession method startActivity.
private void startActivity(String appActivity) {
System.out.println("Starting activity '" + appActivity + "'");
Instrumentation mInstrumentation = InstrumentationRegistry.getInstrumentation();
ActivityMonitor mSessionMonitor = mInstrumentation.addMonitor(appActivity, null, false);
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName(mInstrumentation.getTargetContext(), appActivity);
mInstrumentation.startActivitySync(intent);
Activity mCurrentActivity = mInstrumentation.waitForMonitor(mSessionMonitor);
System.out.println("Activity '" + mCurrentActivity.getLocalClassName() + "' started");
}
use of android.app.Instrumentation in project android_frameworks_base by crdroidandroid.
the class ListManagedCursorTest method testKeyScrolling.
/**
* Scroll the list using arrows, launch new activity, hit back, make sure we're still scrolled.
*/
@LargeTest
public void testKeyScrolling() {
Instrumentation inst = getInstrumentation();
int firstVisiblePosition = arrowScroll(inst);
inst.sendCharacterSync(KeyEvent.KEYCODE_BACK);
inst.waitForIdleSync();
assertTrue("List changed to touch mode", !mListView.isInTouchMode());
assertTrue("List did not preserve scroll position", firstVisiblePosition == mListView.getFirstVisiblePosition());
}
Aggregations