summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYu Shan Emily Lau <yslau@google.com>2009-09-24 11:49:01 -0700
committerYu Shan Emily Lau <yslau@google.com>2009-09-24 11:51:31 -0700
commit78f86edcd377aeb4883780d3d9cdcb36e1c73787 (patch)
tree6db3d71da12bf07c4bf6e497ca167109195ecb4f /tests
parente15c0ad52981ba7413002b028784e09da772ec35 (diff)
downloadLegacyCamera-78f86edcd377aeb4883780d3d9cdcb36e1c73787.zip
LegacyCamera-78f86edcd377aeb4883780d3d9cdcb36e1c73787.tar.gz
LegacyCamera-78f86edcd377aeb4883780d3d9cdcb36e1c73787.tar.bz2
Fixed the switching mode test case. Send out the intent instead of sending the raw menu key event.
Diffstat (limited to 'tests')
-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);
}
}
-