diff options
author | James Dong <jdong@google.com> | 2011-08-29 14:33:25 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2011-08-29 14:40:52 -0700 |
commit | 4afbe2ec7560bfa2637841802cf01cfbd01187e3 (patch) | |
tree | 8ff348e5d96948794aaf9b3ddde98d69874ac8d0 /media/tests/MediaFrameworkTest | |
parent | b8a9e15c2aa3d317834555244a90f184b46e1dcb (diff) | |
download | frameworks_base-4afbe2ec7560bfa2637841802cf01cfbd01187e3.zip frameworks_base-4afbe2ec7560bfa2637841802cf01cfbd01187e3.tar.gz frameworks_base-4afbe2ec7560bfa2637841802cf01cfbd01187e3.tar.bz2 |
The test application falsely reports that the test result even if the test failed.
Change-Id: Ia632f04da73642dc4c1e3147b16664b5672108bc
Diffstat (limited to 'media/tests/MediaFrameworkTest')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java index b396223..0810643 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java @@ -181,9 +181,10 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med } // Note: This test is to assume the mediaserver's pid is 34 - private void stressVideoRecord(int frameRate, int width, int height, int videoFormat, + private boolean stressVideoRecord(int frameRate, int width, int height, int videoFormat, int outFormat, String outFile, boolean videoOnly) { // Video recording + boolean doesTestFail = false; for (int i = 0; i < NUM_PLAYBACk_IN_EACH_LOOP; i++) { MediaRecorder mRecorder = new MediaRecorder(); try { @@ -212,8 +213,11 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med } catch (Exception e) { Log.v("record video failed ", e.toString()); mRecorder.release(); + doesTestFail = true; + break; } } + return !doesTestFail; } public void stressAudioRecord(String filePath) { @@ -366,8 +370,8 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med Writer output = new BufferedWriter(new FileWriter(videoH263RecordOnlyMemoryOut, true)); output.write("H263 video record only\n"); for (int i = 0; i < NUM_STRESS_LOOP; i++) { - stressVideoRecord(20, 352, 288, MediaRecorder.VideoEncoder.H263, - MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true); + assertTrue(stressVideoRecord(20, 352, 288, MediaRecorder.VideoEncoder.H263, + MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true)); getMemoryWriteToLog(output, i); } output.write("\n"); @@ -386,8 +390,8 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med Writer output = new BufferedWriter(new FileWriter(videoMp4RecordOnlyMemoryOut, true)); output.write("MPEG4 video record only\n"); for (int i = 0; i < NUM_STRESS_LOOP; i++) { - stressVideoRecord(20, 352, 288, MediaRecorder.VideoEncoder.MPEG_4_SP, - MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true); + assertTrue(stressVideoRecord(20, 352, 288, MediaRecorder.VideoEncoder.MPEG_4_SP, + MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, true)); getMemoryWriteToLog(output, i); } output.write("\n"); @@ -407,8 +411,8 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med Writer output = new BufferedWriter(new FileWriter(videoRecordAudioMemoryOut, true)); output.write("Audio and h263 video record\n"); for (int i = 0; i < NUM_STRESS_LOOP; i++) { - stressVideoRecord(20, 352, 288, MediaRecorder.VideoEncoder.H263, - MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, false); + assertTrue(stressVideoRecord(20, 352, 288, MediaRecorder.VideoEncoder.H263, + MediaRecorder.OutputFormat.MPEG_4, MediaNames.RECORDED_VIDEO_3GP, false)); getMemoryWriteToLog(output, i); } output.write("\n"); |