Merge "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." into jb-mr2-dev

This commit is contained in:
Yu Shan Emily Lau
2013-03-20 00:58:31 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}