summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGuang Zhu <guangzhu@google.com>2014-03-04 18:46:23 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-04 18:46:23 +0000
commita70d20f6037a5c3f6ee18244a3b547454beb8399 (patch)
tree85ba031ac1f2ba0122f6326620fc1360be6f3c3d /tests
parenta4bd2cbe509911729c9f185b045e54d7528d8836 (diff)
parent818f83d965be3cc1af88a1c700115bff0dccf3a3 (diff)
downloadframeworks_base-a70d20f6037a5c3f6ee18244a3b547454beb8399.zip
frameworks_base-a70d20f6037a5c3f6ee18244a3b547454beb8399.tar.gz
frameworks_base-a70d20f6037a5c3f6ee18244a3b547454beb8399.tar.bz2
am 818f83d9: am bf7b64bd: am be659185: use min app launch time in AppLaunch perf test
* commit '818f83d965be3cc1af88a1c700115bff0dccf3a3': use min app launch time in AppLaunch perf test
Diffstat (limited to 'tests')
-rw-r--r--tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
index 62f6aff..dfb8070 100644
--- a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
+++ b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java
@@ -85,11 +85,13 @@ public class AppLaunch extends InstrumentationTestCase {
// do initial app launch, without force stopping
for (String app : mNameToResultKey.keySet()) {
long launchTime = startApp(app, false);
- if (launchTime <=0 ) {
+ if (launchTime <= 0) {
mNameToLaunchTime.put(app, -1L);
// simply pass the app if launch isn't successful
// error should have already been logged by startApp
continue;
+ } else {
+ mNameToLaunchTime.put(app, launchTime);
}
sleep(INITIAL_LAUNCH_IDLE_TIMEOUT);
closeApp(app, false);
@@ -98,9 +100,9 @@ public class AppLaunch extends InstrumentationTestCase {
// do the real app launch now
for (int i = 0; i < mLaunchIterations; i++) {
for (String app : mNameToResultKey.keySet()) {
- long totalLaunchTime = mNameToLaunchTime.get(app);
+ long prevLaunchTime = mNameToLaunchTime.get(app);
long launchTime = 0;
- if (totalLaunchTime < 0) {
+ if (prevLaunchTime < 0) {
// skip if the app has previous failures
continue;
}
@@ -110,18 +112,19 @@ public class AppLaunch extends InstrumentationTestCase {
mNameToLaunchTime.put(app, -1L);
continue;
}
- totalLaunchTime += launchTime;
- mNameToLaunchTime.put(app, totalLaunchTime);
+ // keep the min launch time
+ if (launchTime < prevLaunchTime) {
+ mNameToLaunchTime.put(app, launchTime);
+ }
sleep(POST_LAUNCH_IDLE_TIMEOUT);
closeApp(app, true);
sleep(BETWEEN_LAUNCH_SLEEP_TIMEOUT);
}
}
for (String app : mNameToResultKey.keySet()) {
- long totalLaunchTime = mNameToLaunchTime.get(app);
- if (totalLaunchTime != -1) {
- mResult.putDouble(mNameToResultKey.get(app),
- ((double) totalLaunchTime) / mLaunchIterations);
+ long launchTime = mNameToLaunchTime.get(app);
+ if (launchTime != -1) {
+ mResult.putLong(mNameToResultKey.get(app), launchTime);
}
}
instrumentation.sendStatus(0, mResult);