summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRay Chen <raychen@google.com>2010-04-30 14:07:03 -0700
committerRay Chen <raychen@google.com>2010-04-30 14:08:04 -0700
commit3e2d95456def6a6d6e716af77e4708a15747d2ed (patch)
treee14326a4e2aba595c891559be5d47258833a4955 /tests
parent2cd3630013cac6c02b2d5b98953fd9f7bb93d4bc (diff)
downloadLegacyCamera-3e2d95456def6a6d6e716af77e4708a15747d2ed.zip
LegacyCamera-3e2d95456def6a6d6e716af77e4708a15747d2ed.tar.gz
LegacyCamera-3e2d95456def6a6d6e716af77e4708a15747d2ed.tar.bz2
Fix issue 2622023: Clean up all hardcoded '/sdcard' in camera related codes
http://2622023 Change-Id: I10205ab378c863e2ffed460c83b0037311a6d1a1
Diffstat (limited to 'tests')
-rwxr-xr-xtests/src/com/android/camera/stress/CameraLatency.java10
-rw-r--r--tests/src/com/android/camera/stress/CameraStartUp.java7
-rwxr-xr-xtests/src/com/android/camera/stress/ImageCapture.java7
-rwxr-xr-xtests/src/com/android/camera/stress/SwitchPreview.java9
4 files changed, 22 insertions, 11 deletions
diff --git a/tests/src/com/android/camera/stress/CameraLatency.java b/tests/src/com/android/camera/stress/CameraLatency.java
index 5c6d308..76805c4 100755
--- a/tests/src/com/android/camera/stress/CameraLatency.java
+++ b/tests/src/com/android/camera/stress/CameraLatency.java
@@ -18,15 +18,16 @@ package com.android.camera.stress;
import com.android.camera.Camera;
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-
import android.app.Instrumentation;
+import android.os.Environment;
import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.LargeTest;
import android.util.Log;
import android.view.KeyEvent;
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+
/**
* Junit / Instrumentation test case for camera test
*
@@ -36,7 +37,8 @@ public class CameraLatency extends ActivityInstrumentationTestCase2 <Camera> {
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 String CAMERA_TEST_OUTPUT_FILE = "/sdcard/mediaStressOut.txt";
+ private static final String CAMERA_TEST_OUTPUT_FILE =
+ Environment.getExternalStorageDirectory().toString() + "/mediaStressOut.txt";
private long mTotalAutoFocusTime;
private long mTotalShutterLag;
diff --git a/tests/src/com/android/camera/stress/CameraStartUp.java b/tests/src/com/android/camera/stress/CameraStartUp.java
index a07b6ba..8aec0a9 100644
--- a/tests/src/com/android/camera/stress/CameraStartUp.java
+++ b/tests/src/com/android/camera/stress/CameraStartUp.java
@@ -1,12 +1,14 @@
package com.android.camera.stress;
+import android.app.Activity;
import android.app.Instrumentation;
import android.content.Intent;
import android.os.Debug;
+import android.os.Environment;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.LargeTest;
-import android.app.Activity;
import android.util.Log;
+
import java.io.FileWriter;
import java.io.BufferedWriter;
@@ -18,7 +20,8 @@ public class CameraStartUp extends InstrumentationTestCase {
private static final int TOTAL_NUMBER_OF_STARTUP = 20;
private String TAG = "CameraStartUp";
- private static final String CAMERA_TEST_OUTPUT_FILE = "/sdcard/mediaStressOut.txt";
+ private static final String CAMERA_TEST_OUTPUT_FILE =
+ Environment.getExternalStorageDirectory().toString() + "/mediaStressOut.txt";
private static final String CAMERA_PACKAGE_NAME = "com.google.android.camera";
private static final String CAMERA_ACTIVITY_NAME = "com.android.camera.Camera";
private static final String VIDEORECORDER_ACTIVITY_NAME = "com.android.camera.VideoCamera";
diff --git a/tests/src/com/android/camera/stress/ImageCapture.java b/tests/src/com/android/camera/stress/ImageCapture.java
index 0eb5586..8c20d37 100755
--- a/tests/src/com/android/camera/stress/ImageCapture.java
+++ b/tests/src/com/android/camera/stress/ImageCapture.java
@@ -19,10 +19,13 @@ package com.android.camera.stress;
import com.android.camera.Camera;
import android.app.Instrumentation;
+import android.content.Intent;
+import android.os.Environment;
import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.LargeTest;
import android.util.Log;
import android.view.KeyEvent;
+
import java.io.FileWriter;
import java.io.Writer;
import java.io.File;
@@ -30,7 +33,6 @@ import java.io.FileWriter;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
-import android.content.Intent;
/**
* Junit / Instrumentation test case for camera test
*
@@ -51,7 +53,8 @@ public class ImageCapture extends ActivityInstrumentationTestCase2 <Camera> {
private static final long WAIT_FOR_PREVIEW = 1500; //1.5 seconds
private static final long WAIT_FOR_STABLE_STATE = 2000; //2 seconds
private static final int NO_OF_LOOPS_TAKE_MEMORY_SNAPSHOT = 10;
- private static final String CAMERA_MEM_OUTPUTFILE = "/sdcard/ImageCaptureMemOut.txt";
+ private static final String CAMERA_MEM_OUTPUTFILE =
+ Environment.getExternalStorageDirectory().toString() + "/ImageCaptureMemOut.txt";
//the tolerant memory leak
private static final int MAX_ACCEPTED_MEMORY_LEAK_KB = 150;
diff --git a/tests/src/com/android/camera/stress/SwitchPreview.java b/tests/src/com/android/camera/stress/SwitchPreview.java
index 4575043..3c4bfaf 100755
--- a/tests/src/com/android/camera/stress/SwitchPreview.java
+++ b/tests/src/com/android/camera/stress/SwitchPreview.java
@@ -17,15 +17,17 @@
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.os.Environment;
import android.util.Log;
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+
/**
* Junit / Instrumentation test case for camera test
*
@@ -41,7 +43,8 @@ public class SwitchPreview extends ActivityInstrumentationTestCase2 <VideoCamera
private static final int TOTAL_NUMBER_OF_SWITCHING = 200;
private static final long WAIT_FOR_PREVIEW = 4000;
- private static final String CAMERA_TEST_OUTPUT_FILE = "/sdcard/mediaStressOut.txt";
+ private static final String CAMERA_TEST_OUTPUT_FILE =
+ Environment.getExternalStorageDirectory().toString() + "/mediaStressOut.txt";
private BufferedWriter mOut;
private FileWriter mfstream;