summaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-rwxr-xr-xtests/src/com/android/camera/stress/SwitchPreview.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/src/com/android/camera/stress/SwitchPreview.java b/tests/src/com/android/camera/stress/SwitchPreview.java
index baebf90..e03a563 100755
--- a/tests/src/com/android/camera/stress/SwitchPreview.java
+++ b/tests/src/com/android/camera/stress/SwitchPreview.java
@@ -17,15 +17,14 @@
package com.android.camera.stress;
import com.android.camera.VideoCamera;
-
import java.io.BufferedWriter;
import java.io.FileWriter;
import android.app.Instrumentation;
+import android.content.Intent;
import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.LargeTest;
import android.util.Log;
-import android.view.KeyEvent;
/**
* Junit / Instrumentation test case for camera test
@@ -40,7 +39,7 @@ import android.view.KeyEvent;
public class SwitchPreview extends ActivityInstrumentationTestCase2 <VideoCamera>{
private String TAG = "SwitchPreview";
private static final int TOTAL_NUMBER_OF_SWITCHING = 200;
- private static final long WAIT_FOR_PREVIEW = 2000;
+ private static final long WAIT_FOR_PREVIEW = 4000;
private static final String CAMERA_TEST_OUTPUT_FILE = "/sdcard/mediaStressOut.txt";
private BufferedWriter mOut;
@@ -93,10 +92,14 @@ public class SwitchPreview extends ActivityInstrumentationTestCase2 <VideoCamera
mOut.write("loop: ");
for (int i=0; i< TOTAL_NUMBER_OF_SWITCHING; i++) {
Thread.sleep(WAIT_FOR_PREVIEW);
- inst.sendKeyDownUpSync(KeyEvent.KEYCODE_MENU);
- inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_LEFT);
- inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_CENTER);
+ Intent intent = new Intent();
+ intent.setClassName("com.android.camera",
+ "com.android.camera.VideoCamera");
+ getActivity().startActivity(intent);
Thread.sleep(WAIT_FOR_PREVIEW);
+ intent.setClassName("com.android.camera",
+ "com.android.camera.Camera");
+ getActivity().startActivity(intent);
mOut.write(" ," + i);
mOut.flush();
}
@@ -106,4 +109,3 @@ public class SwitchPreview extends ActivityInstrumentationTestCase2 <VideoCamera
assertTrue("testSwitchMode",true);
}
}
-