For CameraLAtency.java got rid of the key event to get rid of geo tagging dialog on first launch of camera. That will be taken care of by pushing the shared_pref file.
Change-Id: I76a824b5690d6913630560d58739e2df5cc1c259
public class CameraLatency extends ActivityInstrumentationTestCase2 <CameraActivity> {
private String TAG = "CameraLatency";
private static final int TOTAL_NUMBER_OF_IMAGECAPTURE = 20;
- private static final long WAIT_FOR_IMAGE_CAPTURE_TO_BE_TAKEN = 4000;
+ private static final long WAIT_FOR_IMAGE_CAPTURE_TO_BE_TAKEN = 6 * 1000; //6 seconds.
private static final String CAMERA_TEST_OUTPUT_FILE =
Environment.getExternalStorageDirectory().toString() + "/mediaStressOut.txt";
@Override
protected void setUp() throws Exception {
+ Thread.sleep(2 * 1000); //sleep for 2 seconds.
getActivity();
super.setUp();
}
public void testImageCapture() {
Log.v(TAG, "start testImageCapture test");
Instrumentation inst = getInstrumentation();
- inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN);
try {
for (int i = 0; i < TOTAL_NUMBER_OF_IMAGECAPTURE; i++) {
Thread.sleep(WAIT_FOR_IMAGE_CAPTURE_TO_BE_TAKEN);
private String TAG = "CameraStartUp";
private static final String CAMERA_TEST_OUTPUT_FILE =
Environment.getExternalStorageDirectory().toString() + "/mediaStressOut.txt";
- private static int WAIT_TIME_FOR_PREVIEW = 1500; //1.5 second
+ private static int WAIT_TIME_FOR_PREVIEW = 4 * 1000; //4 seconds.
private long launchCamera() {
long startupTime = 0;
Thread.sleep(WAIT_TIME_FOR_PREVIEW);
cameraActivity.finish();
startupTime = cameraStarted - beforeStart;
- Thread.sleep(1000);
+ Thread.sleep(2 * 1000); //sleep for 2 seconds.
Log.v(TAG, "camera startup time: " + startupTime);
} catch (Exception e) {
Log.v(TAG, "Got exception", e);
Instrumentation inst = getInstrumentation();
Activity recorderActivity = inst.startActivitySync(intent);
long cameraStarted = System.currentTimeMillis();
+ Thread.sleep(WAIT_TIME_FOR_PREVIEW);
recorderActivity.finish();
startupTime = cameraStarted - beforeStart;
Log.v(TAG, "Video Startup Time = " + startupTime);
// wait for 1s to make sure it reach a clean stage
- Thread.sleep(WAIT_TIME_FOR_PREVIEW);
+ Thread.sleep(2 * 1000); //sleep for 2 seconds.
Log.v(TAG, "video startup time: " + startupTime);
} catch (Exception e) {
Log.v(TAG, "Got exception", e);
public class ImageCapture extends ActivityInstrumentationTestCase2 <CameraActivity> {
private String TAG = "ImageCapture";
- private static final long WAIT_FOR_IMAGE_CAPTURE_TO_BE_TAKEN = 1500; //1.5 sedconds
- private static final long WAIT_FOR_SWITCH_CAMERA = 3000; //3 seconds
+ private static final long WAIT_FOR_IMAGE_CAPTURE_TO_BE_TAKEN = 4 * 1000; //4 seconds
+ private static final long WAIT_FOR_SWITCH_CAMERA = 4 * 1000; //4 seconds
private TestUtil testUtil = new TestUtil();
Thread.sleep(WAIT_FOR_SWITCH_CAMERA);
captureImages("Back Camera Image Capture\n", inst);
act.finish();
+ // Wait for a clean finish.
+ Thread.sleep(2 * 1000); //sleep for 2 seconds.
+
}
public void testFrontImageCapture() throws Exception {
Thread.sleep(WAIT_FOR_SWITCH_CAMERA);
captureImages("Front Camera Image Capture\n", inst);
act.finish();
+ // Wait for a clean finish.
+ Thread.sleep(2 * 1000); //sleep for 2 seconds.
}
}
*/
public class VideoCapture extends ActivityInstrumentationTestCase2 <CameraActivity> {
- private static final long WAIT_FOR_PREVIEW = 1500; //1.5 seconds
- private static final long WAIT_FOR_SWITCH_CAMERA = 3000; //2 seconds
+ private static final long WAIT_FOR_PREVIEW = 4 * 1000; //4 seconds
+ private static final long WAIT_FOR_SWITCH_CAMERA = 4 * 1000; //4 seconds
// Private intent extras which control the camera facing.
private final static String EXTRAS_CAMERA_FACING =
Thread.sleep(WAIT_FOR_SWITCH_CAMERA);
captureVideos("Back Camera Video Capture\n", inst);
act.finish();
+ // Wait for a clean finish.
+ Thread.sleep(2 * 1000); //sleep for 2 seconds
+
}
public void testFrontVideoCapture() throws Exception {
Thread.sleep(WAIT_FOR_SWITCH_CAMERA);
captureVideos("Front Camera Video Capture\n", inst);
act.finish();
+ // Wait for a clean finish.
+ Thread.sleep(2 * 1000); //sleep for 2 seconds.
+
}
}