Loading tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java +12 −9 Original line number Diff line number Diff line Loading @@ -90,6 +90,8 @@ public class AppLaunch extends InstrumentationTestCase { // 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); Loading @@ -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; } Loading @@ -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); Loading Loading
tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java +12 −9 Original line number Diff line number Diff line Loading @@ -90,6 +90,8 @@ public class AppLaunch extends InstrumentationTestCase { // 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); Loading @@ -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; } Loading @@ -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); Loading