diff options
author | Yu Shan Emily Lau <yslau@google.com> | 2010-07-27 17:04:00 -0700 |
---|---|---|
committer | Yu Shan Emily Lau <yslau@google.com> | 2010-07-27 17:15:17 -0700 |
commit | 0433fd29133860ba30eee8bcc7fe88363effa55b (patch) | |
tree | d18116674cbcf248ac78df63eff6bd5e403c77a9 /tests/src | |
parent | e4b210af3f11ecb3e1556a2edc95bc06119bcecb (diff) | |
download | LegacyCamera-0433fd29133860ba30eee8bcc7fe88363effa55b.zip LegacyCamera-0433fd29133860ba30eee8bcc7fe88363effa55b.tar.gz LegacyCamera-0433fd29133860ba30eee8bcc7fe88363effa55b.tar.bz2 |
Fixed the NPE issue with the test file output name.
Change-Id: I715772867d84b60d87c1b44ef6588e7b5003019d
Diffstat (limited to 'tests/src')
-rwxr-xr-x | tests/src/com/android/camera/stress/ImageCapture.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/src/com/android/camera/stress/ImageCapture.java b/tests/src/com/android/camera/stress/ImageCapture.java index 42a7b54..cd2bd29 100755 --- a/tests/src/com/android/camera/stress/ImageCapture.java +++ b/tests/src/com/android/camera/stress/ImageCapture.java @@ -53,8 +53,6 @@ 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 = - Environment.getExternalStorageDirectory().toString() + "/ImageCaptureMemOut.txt"; //the tolerant memory leak private static final int MAX_ACCEPTED_MEMORY_LEAK_KB = 150; @@ -64,8 +62,6 @@ public class ImageCapture extends ActivityInstrumentationTestCase2 <Camera> { private static int mStartPid = 0; private static int mEndPid = 0; - private static final String CAMERA_TEST_OUTPUT_FILE = - Environment.getExternalStorageDirectory().toString() + "/mediaStressOut.txt"; private BufferedWriter mOut; private FileWriter mfstream; @@ -87,8 +83,10 @@ public class ImageCapture extends ActivityInstrumentationTestCase2 <Camera> { } private void prepareOutputFile(){ + String camera_test_output_file = + Environment.getExternalStorageDirectory().toString() + "/mediaStressOut.txt"; try{ - mfstream = new FileWriter(CAMERA_TEST_OUTPUT_FILE, true); + mfstream = new FileWriter(camera_test_output_file, true); mOut = new BufferedWriter(mfstream); } catch (Exception e){ assertTrue("ImageCapture open output",false); @@ -186,9 +184,12 @@ public class ImageCapture extends ActivityInstrumentationTestCase2 <Camera> { //TODO(yslau): Need to integrate the outoput with the central dashboard, //write to a txt file as a temp solution + String camera_mem_out = + Environment.getExternalStorageDirectory().toString() + "/ImageCaptureMemOut.txt"; boolean memoryResult = false; Instrumentation inst = getInstrumentation(); - File imageCaptureMemFile = new File(CAMERA_MEM_OUTPUTFILE); + File imageCaptureMemFile = new File(camera_mem_out); + mStartPid = getMediaserverPid(); mStartMemory = getMediaserverVsize(); Log.v(TAG, "start memory : " + mStartMemory); @@ -239,12 +240,14 @@ public class ImageCapture extends ActivityInstrumentationTestCase2 <Camera> { public void testVideoCapture() { //TODO(yslau): Need to integrate the output with the central dashboard, //write to a txt file as a temp solution + String camera_mem_out = + Environment.getExternalStorageDirectory().toString() + "/ImageCaptureMemOut.txt"; boolean memoryResult = false; int total_num_of_videos = CameraStressTestRunner.mVideoIterations; int video_duration = CameraStressTestRunner.mVideoDuration; Instrumentation inst = getInstrumentation(); - File imageCaptureMemFile = new File(CAMERA_MEM_OUTPUTFILE); + File imageCaptureMemFile = new File(camera_mem_out); mStartPid = getMediaserverPid(); mStartMemory = getMediaserverVsize(); Log.v(TAG, "start memory : " + mStartMemory); @@ -284,4 +287,3 @@ public class ImageCapture extends ActivityInstrumentationTestCase2 <Camera> { } } - |