summaryrefslogtreecommitdiffstats
path: root/media/tests/MediaFrameworkTest
diff options
context:
space:
mode:
authorYu Shan Emily Lau <yslau@google.com>2013-03-19 16:53:38 -0700
committerYu Shan Emily Lau <yslau@google.com>2013-03-19 17:42:50 -0700
commit780dc88ddbc1d7a8d4a634e556a5bba04992a412 (patch)
tree03f970f1065832c5748bd59f43e91dab49ca6df5 /media/tests/MediaFrameworkTest
parent984505d8168713469fb36bb50da50a2638751122 (diff)
downloadframeworks_base-780dc88ddbc1d7a8d4a634e556a5bba04992a412.zip
frameworks_base-780dc88ddbc1d7a8d4a634e556a5bba04992a412.tar.gz
frameworks_base-780dc88ddbc1d7a8d4a634e556a5bba04992a412.tar.bz2
Fix the media memeory stress test.
The media memory stress test used the ps mediaserver to capture the memory usage of mediaserver. As the media.log is enabled recently, when runnign the ps mediaserver, it will show both entries. The fix is simply skip the first two lines and parse the laste output. Change-Id: Ib2a4ba7936505b4ea24463bf8a5af2c499b71138
Diffstat (limited to 'media/tests/MediaFrameworkTest')
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java4
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java10
2 files changed, 12 insertions, 2 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java
index a80fc13..53eb990 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaTestUtil.java
@@ -101,7 +101,9 @@ public class MediaTestUtil {
Log.v(TAG, e.toString());
}
String[] poList = memoryUsage.split("\r|\n|\r\n");
- String memusage = poList[1].concat("\n");
+ // Skip the first two lines since there
+ // is a new media.log introudced recently.
+ String memusage = poList[2].concat("\n");
return memusage;
}
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 1c60401..be12c7f 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java
@@ -328,7 +328,15 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase2<Med
Log.v(TAG, e.toString());
}
String[] poList = memoryUsage.split("\r|\n|\r\n");
- String memusage = poList[1].concat("\n");
+ // A new media.log is enabled with ro.test_harness is set.
+ // The output of "ps mediaserver" will include the
+ // media.log process in the first line. Update the parsing
+ // to only read the thrid line.
+ // Smaple ps mediaserver output:
+ // USER PID PPID VSIZE RSS WCHAN PC NAME
+ // media 131 1 13676 4796 ffffffff 400b1bd0 S media.log
+ // media 219 131 37768 6892 ffffffff 400b236c S /system/bin/mediaserver
+ String memusage = poList[2].concat("\n");
return memusage;
}