summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorpriya <priyar@google.com>2013-10-09 18:51:11 (GMT)
committerpriya <priyar@google.com>2013-10-10 16:13:25 (GMT)
commit05f84f31e26acdb9acd89c016d795669b2f994b2 (patch)
tree98dbfdc738652e4fcf132178bc8ffd155ef4b8d0 /tests
parent676b89cab6e9db1b784617fc16e97eadac7c4e2d (diff)
downloadandroid_packages_apps_Snap-05f84f31e26acdb9acd89c016d795669b2f994b2.zip
android_packages_apps_Snap-05f84f31e26acdb9acd89c016d795669b2f994b2.tar.gz
android_packages_apps_Snap-05f84f31e26acdb9acd89c016d795669b2f994b2.tar.bz2
Increased time to wait in all tests.
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
Diffstat (limited to 'tests')
-rwxr-xr-xtests/src/com/android/camera/stress/CameraLatency.java4
-rw-r--r--tests/src/com/android/camera/stress/CameraStartUp.java7
-rwxr-xr-xtests/src/com/android/camera/stress/ImageCapture.java9
-rwxr-xr-xtests/src/com/android/camera/stress/VideoCapture.java10
4 files changed, 21 insertions, 9 deletions
diff --git a/tests/src/com/android/camera/stress/CameraLatency.java b/tests/src/com/android/camera/stress/CameraLatency.java
index 527b586..22347dd 100755
--- a/tests/src/com/android/camera/stress/CameraLatency.java
+++ b/tests/src/com/android/camera/stress/CameraLatency.java
@@ -36,7 +36,7 @@ import java.io.FileWriter;
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";
@@ -57,6 +57,7 @@ public class CameraLatency extends ActivityInstrumentationTestCase2 <CameraActiv
@Override
protected void setUp() throws Exception {
+ Thread.sleep(2 * 1000); //sleep for 2 seconds.
getActivity();
super.setUp();
}
@@ -69,7 +70,6 @@ public class CameraLatency extends ActivityInstrumentationTestCase2 <CameraActiv
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);
diff --git a/tests/src/com/android/camera/stress/CameraStartUp.java b/tests/src/com/android/camera/stress/CameraStartUp.java
index 4a9b773..c39f435 100644
--- a/tests/src/com/android/camera/stress/CameraStartUp.java
+++ b/tests/src/com/android/camera/stress/CameraStartUp.java
@@ -40,7 +40,7 @@ public class CameraStartUp extends InstrumentationTestCase {
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;
@@ -55,7 +55,7 @@ public class CameraStartUp extends InstrumentationTestCase {
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);
@@ -75,11 +75,12 @@ public class CameraStartUp extends InstrumentationTestCase {
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);
diff --git a/tests/src/com/android/camera/stress/ImageCapture.java b/tests/src/com/android/camera/stress/ImageCapture.java
index fd7e2af..f5f4302 100755
--- a/tests/src/com/android/camera/stress/ImageCapture.java
+++ b/tests/src/com/android/camera/stress/ImageCapture.java
@@ -40,8 +40,8 @@ import android.app.Activity;
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();
@@ -101,6 +101,9 @@ public class ImageCapture extends ActivityInstrumentationTestCase2 <CameraActivi
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 {
@@ -115,5 +118,7 @@ public class ImageCapture extends ActivityInstrumentationTestCase2 <CameraActivi
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.
}
}
diff --git a/tests/src/com/android/camera/stress/VideoCapture.java b/tests/src/com/android/camera/stress/VideoCapture.java
index 3688d89..c740982 100755
--- a/tests/src/com/android/camera/stress/VideoCapture.java
+++ b/tests/src/com/android/camera/stress/VideoCapture.java
@@ -41,8 +41,8 @@ import com.android.camera.stress.CameraStressTestRunner;
*/
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 =
@@ -94,6 +94,9 @@ public class VideoCapture extends ActivityInstrumentationTestCase2 <CameraActivi
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 {
@@ -108,5 +111,8 @@ public class VideoCapture extends ActivityInstrumentationTestCase2 <CameraActivi
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.
+
}
}