Reland "Add DefaultUITraceListener to InputTests"
This reverts commit 30385832d2a806a74b127bf481995954e53427f5.
Only collect traces per-class to reduce test module run time.
Bug: 332714237
Bug: 210460522
Change-Id: I8a7e36b9a20c31548c6287a5b4ed901ce18950db
diff --git a/tests/Input/Android.bp b/tests/Input/Android.bp
index f367c38..06c2651 100644
--- a/tests/Input/Android.bp
+++ b/tests/Input/Android.bp
@@ -48,6 +48,7 @@
"testables",
"testng",
"truth",
+ "ui-trace-collector",
],
libs: [
"android.test.mock",
diff --git a/tests/Input/AndroidTest.xml b/tests/Input/AndroidTest.xml
index 4a99bd4..bc9322f 100644
--- a/tests/Input/AndroidTest.xml
+++ b/tests/Input/AndroidTest.xml
@@ -22,6 +22,10 @@
<option name="shell-timeout" value="660s" />
<option name="test-timeout" value="600s" />
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
+ <option name="device-listeners" value="android.tools.collectors.DefaultUITraceListener"/>
+ <!-- DefaultUITraceListener args -->
+ <option name="instrumentation-arg" key="skip_test_success_metrics" value="true"/>
+ <option name="instrumentation-arg" key="per_class" value="true"/>
</test>
<object class="com.android.tradefed.testtype.suite.module.TestFailureModuleController"
type="module_controller">
@@ -32,6 +36,8 @@
<option name="pull-pattern-keys" value="input_.*" />
<!-- Pull files created by tests, like the output of screenshot tests -->
<option name="directory-keys" value="/sdcard/Download/InputTests" />
+ <!-- Pull perfetto traces from DefaultUITraceListener -->
+ <option name="pull-pattern-keys" value="perfetto_file_path*" />
<option name="collect-on-run-ended-only" value="false" />
</metrics_collector>
</configuration>