summaryrefslogtreecommitdiff
path: root/tests/src
diff options
context:
space:
mode:
authorgopinath <gelanchezhian@google.com>2017-05-11 10:27:03 -0700
committerGopinath Elanchezhian <gelanchezhian@google.com>2017-05-11 21:31:25 +0000
commit2ce9264380033a07c4a5b6104cc65406f5a5c090 (patch)
treeaf21f4778c34361899c07c2857788269908b873e /tests/src
parent4348cc0f92b088ab3b58001e1b370b69b86577a2 (diff)
downloadloganalysis-2ce9264380033a07c4a5b6104cc65406f5a5c090.tar.gz
Parser to handle only transition delay info.
Tests : java -cp out/host/linux-x86/framework/loganalysis-tests.jar:out/host/linux-x86/framework/loganalysis.jar org.junit.runner.JUnitCore com.android.loganalysis.UnitTests OK (253 tests) run google/template/local --template:map test performance/app-transitions --cold-apps Calculator --hot-apps Calculator --pre-launch-apps Calculator --apps-to-recents Calculator --hot-apps-from-recents Calculator --hot-apps-from-recents Calculator --launch-iteration 2 --no-bugreport-on-invocation-ended --alt-dir /usr/local/google/home/gelanchezhian/Desktop/local Test Sponge link: https://sponge.corp.google.com/invocation?tab=host_log.txt&show=&id=cd595d48-4beb-4bbf-86b0-7b17b4ae82a6&searchFor=&sortBy=STATUS Change-Id: I61163d67630e54f29248d56c2de1faf4dec45b41
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/loganalysis/parser/EventsLogParserTest.java24
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/src/com/android/loganalysis/parser/EventsLogParserTest.java b/tests/src/com/android/loganalysis/parser/EventsLogParserTest.java
index b568e57..f811580 100644
--- a/tests/src/com/android/loganalysis/parser/EventsLogParserTest.java
+++ b/tests/src/com/android/loganalysis/parser/EventsLogParserTest.java
@@ -71,7 +71,7 @@ public class EventsLogParserTest extends TestCase {
}
/**
- * Test for Cold launch transition delay info
+ * Test for Cold launch transition delay and starting window delay info
*/
public void testValidTransitionDelay() throws IOException {
List<String> lines = Arrays
@@ -93,6 +93,26 @@ public class EventsLogParserTest extends TestCase {
}
/**
+ * Test for only transition delay in hot launch
+ */
+ public void testOnlyTransitionDelay() throws IOException {
+ List<String> lines = Arrays
+ .asList("01-02 08:12:10.849 934 986 I sysui_multi_action: [319,42,322,208,325,84100,757,761,758,9,759,4,806,com.google.android.apps.maps,871,com.google.android.maps.MapsActivity,905,0]",
+ "01-02 08:12:16.895 1446 1446 I sysui_multi_action: [757,803,799,overview_trigger_nav_btn,802,1]",
+ "01-02 08:12:16.895 1446 1446 I sysui_multi_action: [757,803,799,overview_source_app,802,1]",
+ "01-02 08:12:16.895 1446 1446 I sysui_multi_action: [757,804,799,overview_source_app_index,801,8,802,1]");
+ List<TransitionDelayItem> transitionItems = (new EventsLogParser()).
+ parseTransitionDelayInfo(readInputBuffer(getTempFile(lines)));
+ assertEquals("Transition Delay items list should have one item", 1,
+ transitionItems.size());
+ assertEquals("Component name not parsed correctly",
+ "com.google.android.apps.maps/com.google.android.maps.MapsActivity",
+ transitionItems.get(0).getComponentName());
+ assertEquals("Transition delay is not parsed correctly", 42,
+ transitionItems.get(0).getTransitionDelay());
+ }
+
+ /**
* Test for same app transition delay items order after parsing from the events log
*/
public void testTransitionDelayOrder() throws IOException {
@@ -141,7 +161,7 @@ public class EventsLogParserTest extends TestCase {
*/
public void testInvalidTransitionPattern() throws IOException {
List<String> lines = Arrays
- .asList("01-02 08:11:58.691 934 986 I sysui_multi_action: [319,48,328,37,322,82,325,84088,757,761,758,9,759,4,806,com.google.android.calculator,871,com.android.calculator2.Calculator,905,0]",
+ .asList("01-02 08:11:58.691 934 986 I sysui_multi_action: [319,48,322,82,325,84088,757,761,758,9,759,4,807,com.google.android.calculator,871,com.android.calculator2.Calculator,905,0]",
"01-02 08:12:03.639 934 970 I sysui_multi_action: [757,803,799,window_time_0,802,5]",
"01-02 08:12:10.849 934 986 I sysui_multi_action: 319,42,321,59,322,208,325,84100,757,761,758,9,759,4,806,com.google.android.apps.maps,871,com.google.android.maps.MapsActivity,905,0]",
"01-02 08:12:16.895 1446 1446 I sysui_multi_action: [757,803,799,overview_trigger_nav_btn,802,1]",