summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-10-16 18:06:43 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-10-16 18:06:43 -0400
commitda2ecbebd226a0fbc5ed881c541b9126d30f9007 (patch)
tree055eea7204b6c4b5d766f6aebe7506561c6ddac1
parentd8f7a0e3de32a5f1378e1a13f6a9f94d62a620ac (diff)
parent999101368fc6b8163e0b9e320239e49ca62f3e4a (diff)
downloadframeworks_base-da2ecbebd226a0fbc5ed881c541b9126d30f9007.zip
frameworks_base-da2ecbebd226a0fbc5ed881c541b9126d30f9007.tar.gz
frameworks_base-da2ecbebd226a0fbc5ed881c541b9126d30f9007.tar.bz2
Merge change Idcaa1ef8 into eclair
* changes: 1) Add 10 seconds wait time before collecting the end memory. 2) Modified the player stress test, shorten the plabyack time.
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java2
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/MediaPlayerStressTest.java18
2 files changed, 12 insertions, 8 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 0ae354a..6e3f5e3 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java
@@ -309,6 +309,8 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi
}
public boolean validateMemoryResult (int startPid, int startMemory, Writer output) throws Exception {
+ //Wait for 10 seconds to make sure the memory settle.
+ Thread.sleep(10000);
mEndPid = getMediaserverPid();
mEndMemory = getMediaserverVsize();
Log.v(TAG, "End Memory " + mEndMemory);
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 90d6ffa..daa0ca7 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/MediaPlayerStressTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/MediaPlayerStressTest.java
@@ -41,7 +41,7 @@ public class MediaPlayerStressTest extends ActivityInstrumentationTestCase2<Medi
private static final int NUMBER_OF_RANDOM_REPOSITION_AND_PLAY = 10;
private static final int NUMBER_OF_RANDOM_REPOSITION_AND_PLAY_SHORT = 5;
private static final int NUMBER_OF_STRESS_LOOPS = 500;
- private static final int PLAYBACK_END_TOLERANCE = 5000;
+ private static final int PLAYBACK_END_TOLERANCE = 30000;
private static final int WAIT_UNTIL_PLAYBACK_FINISH = 515000 ;
public MediaPlayerStressTest() {
@@ -112,10 +112,11 @@ public class MediaPlayerStressTest extends ActivityInstrumentationTestCase2<Medi
if (random_no_of_seek == 0) {
random_no_of_seek = 1;
}
- // Random seek and play
+ Log.v(TAG, "random_seek = " + random_no_of_seek);
+ // Play for 10 seconds then random seekTo
for (int j = 0; j < random_no_of_seek; j++) {
random_play_time =
- generator.nextInt(video_duration / 2);
+ generator.nextInt(video_duration / 100);
Log.v(TAG, "Play time = " + random_play_time);
Thread.sleep(random_play_time);
random_seek_time =
@@ -123,12 +124,13 @@ public class MediaPlayerStressTest extends ActivityInstrumentationTestCase2<Medi
Log.v(TAG, "Seek time = " + random_seek_time);
mp.seekTo(random_seek_time);
}
- //wait until the movie finish and check the current position
- //Make sure the wait time is long enough
- long wait_until_playback_finish = video_duration - random_seek_time + PLAYBACK_END_TOLERANCE * 2;
- Thread.sleep(wait_until_playback_finish);
+ //Seek to 10s from the end of the video
+ mp.seekTo(video_duration - 10000);
+ //After reposition, play 30 seconds the video should be finished.
+ Thread.sleep(PLAYBACK_END_TOLERANCE);
Log.v(TAG, "CurrentPosition = " + mp.getCurrentPosition());
- if ( mp.isPlaying() || mp.getCurrentPosition() > (video_duration + PLAYBACK_END_TOLERANCE)){
+ if ( mp.isPlaying() || mp.getCurrentPosition()
+ > (video_duration)){
assertTrue("Current PlayTime greater than duration", false);
}
mp.release();