summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Neas <kneas@google.com>2018-02-21 15:37:21 -0800
committerKevin Neas <kneas@google.com>2018-02-21 15:38:50 -0800
commit2f72369ee9abde548786087f7612b2528abee6c8 (patch)
treecc096d3a2f8ed8f8fc38276cf5c8c49c73c72fd6
parentbf65339444bcaf9ee987940101a39d7339f76ea7 (diff)
Updating AppLaunchWear to correctly parse the launch message.
When we don't kill Home, we get an Warning message: "Warning: Activity not started, its current task has ben brought to the front" This causes the current parser to think the app didn't launch, because it's looking in the wrong line. Adding +1 to each line, in the cases where we launch Home Test: locally Change-Id: Ie232a57921ed7cf82a6f17b607fbb47591bcdbed
-rw-r--r--tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java24
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java b/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java
index b3f2686289b1..38c298c5e9ff 100644
--- a/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java
+++ b/tests/AppLaunchWear/src/com/android/tests/applaunch/AppLaunch.java
@@ -103,6 +103,7 @@ public class AppLaunch extends InstrumentationTestCase {
private static final String DROP_CACHE_SCRIPT = "/data/local/tmp/dropCache.sh";
private static final String APP_LAUNCH_CMD = "am start -W -n";
private static final String SUCCESS_MESSAGE = "Status: ok";
+ private static final String WARNING_MESSAGE = "Warning: Activity not started";
private static final String COMPILE_SUCCESS = "Success";
private static final String THIS_TIME = "ThisTime:";
private static final String LAUNCH_ITERATION = "LAUNCH_ITERATION - %d";
@@ -790,6 +791,17 @@ public class AppLaunch extends InstrumentationTestCase {
TotalTime: 357
WaitTime: 377
Complete*/
+ /* WHEN NOT KILLING HOME :
+ Starting: Intent { cmp=com.google.android.wearable.app/
+ com.google.android.clockwork.home.calendar.AgendaActivity }
+ Warning: Activity not started, its current task has been brought to the front
+ Status: ok
+ Activity: com.google.android.wearable.app/
+ com.google.android.clockwork.home.calendar.AgendaActivity
+ ThisTime: 209
+ TotalTime: 209
+ WaitTime: 285
+ Complete*/
/* WITH SIMPLEPERF :
Performance counter statistics,
6595722690,cpu-cycles,4.511040,GHz,(100%),
@@ -799,28 +811,32 @@ public class AppLaunch extends InstrumentationTestCase {
inputStream));
String line = null;
int lineCount = 1;
+ int addLineForWarning = 0;
mBufferedWriter.newLine();
mBufferedWriter.write(headerInfo);
mBufferedWriter.newLine();
while ((line = bufferedReader.readLine()) != null) {
- if (lineCount == 2 && line.contains(SUCCESS_MESSAGE)) {
+ if (lineCount == 2 && line.contains(WARNING_MESSAGE)) {
+ addLineForWarning = 1;
+ }
+ if (lineCount == (2 + addLineForWarning) && line.contains(SUCCESS_MESSAGE)) {
launchSuccess = true;
}
// Parse TotalTime which is the launch time
- if (launchSuccess && lineCount == 5) {
+ if (launchSuccess && lineCount == (5 + addLineForWarning)) {
String launchSplit[] = line.split(":");
launchTime = launchSplit[1].trim();
}
if (mSimplePerfAppOnly) {
// Parse simpleperf output.
- if (lineCount == 9) {
+ if (lineCount == (9 + addLineForWarning)) {
if (!line.contains("cpu-cycles")) {
Log.e(TAG, "Error in simpleperf output");
} else {
cpuCycles = line.split(",")[0].trim();
}
- } else if (lineCount == 10) {
+ } else if (lineCount == (10 + addLineForWarning)) {
if (!line.contains("major-faults")) {
Log.e(TAG, "Error in simpleperf output");
} else {