summaryrefslogtreecommitdiff
path: root/tests/AppLaunchWear
diff options
context:
space:
mode:
authorKevin Neas <kneas@google.com>2018-02-21 12:31:40 -0800
committerKevin Neas <kneas@google.com>2018-02-21 12:34:43 -0800
commite8520b4fc9154afcf377e1e4bfafaa9c0a852884 (patch)
treefb4d38fa527afac42597f9ddf16966d6e55e840e /tests/AppLaunchWear
parent026cd5e3da3f0c21cdde0741a11ad0212555cee7 (diff)
Updating AppLaunchWear with more logging and logic.
Agenda keeps failing. Need to more logging to know why Contacts keeps getting killed. Again, need more logging Test: local Change-Id: I6930892d8a2eaa7ad410284fba9ed1c4980820f7
Diffstat (limited to 'tests/AppLaunchWear')
-rw-r--r--tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java b/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java
index acb5d77113b8..b3f2686289b1 100644
--- a/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java
+++ b/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java
@@ -231,12 +231,14 @@ public class AppLaunch extends InstrumentationTestCase {
dropCache();
String appPkgName = mNameToIntent.get(launch.getApp())
.getComponent().getPackageName();
+ Log.v(TAG, String.format("\nApp name: %s", launch.getApp()));
Log.v(TAG, String.format("Adding app package name: %s", appPkgName));
// App launch times for trial launch will not be used for final
// launch time calculations.
if (launch.getLaunchReason().equals(TRIAL_LAUNCH)) {
// In the "applaunch.txt" file, trail launches is referenced using
// "TRIAL_LAUNCH"
+ Log.v(TAG, "Trial Launch");
if (SPEED_PROFILE_FILTER.equals(launch.getCompilerFilter())) {
assertTrue(String.format("Not able to compile the app : %s", appPkgName),
compileApp(VERIFY_FILTER, appPkgName));
@@ -246,8 +248,14 @@ public class AppLaunch extends InstrumentationTestCase {
}
// We only need to run a trial for the speed-profile filter, but we always
// run one for "applaunch.txt" consistency.
- AppLaunchResult launchResult =
- startApp(launch.getApp(), true, launch.getLaunchReason());
+ AppLaunchResult launchResult = null;
+ if (appPkgName.contains(WEARABLE_HOME_PACKAGE)) {
+ Log.v(TAG, "Home package detected. Not killing app");
+ launchResult = startApp(launch.getApp(), false, launch.getLaunchReason());
+ } else {
+ Log.v(TAG, "Will kill app before launch");
+ launchResult = startApp(launch.getApp(), true, launch.getLaunchReason());
+ }
if (launchResult.mLaunchTime < 0) {
addLaunchResult(launch, new AppLaunchResult());
// simply pass the app if launch isn't successful
@@ -268,6 +276,7 @@ public class AppLaunch extends InstrumentationTestCase {
// App launch times used for final calculation
else if (launch.getLaunchReason().contains(LAUNCH_ITERATION_PREFIX)) {
+ Log.v(TAG, "Launch iteration prefix.");
AppLaunchResult launchResults = null;
if (hasFailureOnFirstLaunch(launch)) {
// skip if the app has failures while launched first
@@ -295,6 +304,7 @@ public class AppLaunch extends InstrumentationTestCase {
// App launch times for trace launch will not be used for final
// launch time calculations.
else if (launch.getLaunchReason().contains(TRACE_ITERATION_PREFIX)) {
+ Log.v(TAG, "Trace iteration prefix");
AtraceLogger atraceLogger = AtraceLogger
.getAtraceLoggerInstance(getInstrumentation());
// Start the trace
@@ -302,7 +312,13 @@ public class AppLaunch extends InstrumentationTestCase {
atraceLogger.atraceStart(traceCategoriesSet, traceBufferSize,
traceDumpInterval, rootTraceSubDir,
String.format("%s-%s", launch.getApp(), launch.getLaunchReason()));
- startApp(launch.getApp(), true, launch.getLaunchReason());
+ if (appPkgName.contains(WEARABLE_HOME_PACKAGE)) {
+ Log.v(TAG, "Home package detected. Not killing app");
+ startApp(launch.getApp(), false, launch.getLaunchReason());
+ } else {
+ Log.v(TAG, "Will kill app before launch");
+ startApp(launch.getApp(), true, launch.getLaunchReason());
+ }
sleep(POST_LAUNCH_IDLE_TIMEOUT);
} finally {
// Stop the trace