OSDN Git Service

Increased time to wait in all tests.
authorpriya <priyar@google.com>
Wed, 9 Oct 2013 18:51:11 +0000 (11:51 -0700)
committerThe Android Automerger <android-build@google.com>
Thu, 10 Oct 2013 23:26:38 +0000 (16:26 -0700)
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

tests/src/com/android/camera/stress/CameraLatency.java
tests/src/com/android/camera/stress/CameraStartUp.java
tests/src/com/android/camera/stress/ImageCapture.java
tests/src/com/android/camera/stress/VideoCapture.java

index 527b586..22347dd 100755 (executable)
@@ -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);
index 4a9b773..c39f435 100644 (file)
@@ -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);
index fd7e2af..f5f4302 100755 (executable)
@@ -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.
     }
 }
index 3688d89..c740982 100755 (executable)
@@ -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.
+
     }
 }