diff options
author | Yu Shan Emily Lau <yslau@google.com> | 2012-07-10 16:04:58 -0700 |
---|---|---|
committer | Yu Shan Emily Lau <yslau@google.com> | 2012-07-10 16:45:38 -0700 |
commit | e60393ae7168e97922dd7d4821a69d5546a6a522 (patch) | |
tree | ed22b705fad41102a298623e8a6695da69c89086 /media/tests/MediaFrameworkTest/src | |
parent | c17f92ce047e8d62fac829d1df5dae654f7e4de8 (diff) | |
download | frameworks_base-e60393ae7168e97922dd7d4821a69d5546a6a522.zip frameworks_base-e60393ae7168e97922dd7d4821a69d5546a6a522.tar.gz frameworks_base-e60393ae7168e97922dd7d4821a69d5546a6a522.tar.bz2 |
Remove the unnecssary intent call.
Change-Id: Ia0a460ca8532ccb2f4b0f0205d192b1ba907b5b6
Diffstat (limited to 'media/tests/MediaFrameworkTest/src')
-rw-r--r-- | media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/MediaPlayerStressTest.java | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/MediaPlayerStressTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/MediaPlayerStressTest.java index 25b6e7f..67da6ac 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/MediaPlayerStressTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/MediaPlayerStressTest.java @@ -24,6 +24,7 @@ import android.content.Intent; import android.hardware.Camera; import android.media.MediaPlayer; import android.media.MediaRecorder; +import android.os.Environment; import android.test.ActivityInstrumentationTestCase2; import android.test.suitebuilder.annotation.LargeTest; import android.util.Log; @@ -66,6 +67,9 @@ public class MediaPlayerStressTest extends ActivityInstrumentationTestCase2<Medi private int mTotalNotSeekable = 0; private int mTotalMetaDataUpdate = 0; + //Test result output file + private static final String PLAYBACK_RESULT = "PlaybackTestResult.txt"; + private void writeTestOutput(String filename, Writer output) throws Exception{ output.write("File Name: " + filename); output.write(" Complete: " + CodecTest.onCompleteSuccess); @@ -109,27 +113,19 @@ public class MediaPlayerStressTest extends ActivityInstrumentationTestCase2<Medi @LargeTest public void testVideoPlayback() throws Exception { String fileWithError = "Filename:\n"; - File playbackOutput = new File("/sdcard/PlaybackTestResult.txt"); + File playbackOutput = new File(Environment.getExternalStorageDirectory(), PLAYBACK_RESULT); Writer output = new BufferedWriter(new FileWriter(playbackOutput, true)); boolean testResult = true; // load directory files boolean onCompleteSuccess = false; File dir = new File(MediaNames.MEDIA_SAMPLE_POOL); - - Instrumentation inst = getInstrumentation(); - Intent intent = new Intent(); - - intent.setClass(getInstrumentation().getTargetContext(), MediaFrameworkTest.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - String[] children = dir.list(); if (children == null) { Log.v("MediaPlayerApiTest:testMediaSamples", "dir is empty"); return; } else { for (int i = 0; i < children.length; i++) { - Activity act = inst.startActivitySync(intent); //Get filename of directory String filename = children[i]; onCompleteSuccess = @@ -141,8 +137,6 @@ public class MediaPlayerStressTest extends ActivityInstrumentationTestCase2<Medi testResult = false; } Thread.sleep(3000); - //Call onCreat to recreate the surface - act.finish(); //Write test result to an output file writeTestOutput(filename,output); //Get the summary |