• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2023 The Android Open Source Project
4  ~
5  ~ Licensed under the Apache License, Version 2.0 (the "License");
6  ~ you may not use this file except in compliance with the License.
7  ~ You may obtain a copy of the License at
8  ~
9  ~      http://www.apache.org/licenses/LICENSE-2.0
10  ~
11  ~ Unless required by applicable law or agreed to in writing, software
12  ~ distributed under the License is distributed on an "AS IS" BASIS,
13  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  ~ See the License for the specific language governing permissions and
15  ~ limitations under the License.
16  -->
17<configuration description="Runs WindowManager Shell Flicker Tests {MODULE}">
18    <option name="test-tag" value="FlickerTests"/>
19    <!-- Needed for storing the perfetto trace files in the sdcard/test_results-->
20    <option name="isolated-storage" value="false"/>
21
22    <target_preparer class="com.android.tradefed.targetprep.DeviceSetup">
23        <!-- disable DeprecatedTargetSdk warning -->
24        <option name="run-command" value="setprop debug.wm.disable_deprecated_target_sdk_dialog 1"/>
25        <!-- keeps the screen on during tests -->
26        <option name="screen-always-on" value="on"/>
27        <!-- Turns off Wi-fi -->
28        <option name="wifi" value="off"/>
29        <!-- Turns off Bluetooth -->
30        <option name="bluetooth" value="off"/>
31        <!-- prevents the phone from restarting -->
32        <option name="force-skip-system-props" value="true"/>
33        <!-- set WM tracing verbose level to all -->
34        <option name="run-command" value="cmd window tracing level all"/>
35        <!-- set WM tracing to frame (avoid incomplete states) -->
36        <option name="run-command" value="cmd window tracing frame"/>
37        <!-- disable betterbug as it's log collection dialogues cause flakes in e2e tests -->
38        <option name="run-command" value="pm disable com.google.android.internal.betterbug"/>
39        <!-- ensure lock screen mode is swipe -->
40        <option name="run-command" value="locksettings set-disabled false"/>
41        <!-- restart launcher to activate TAPL -->
42        <option name="run-command"
43                value="setprop ro.test_harness 1 ; am force-stop com.google.android.apps.nexuslauncher"/>
44        <!-- Increase trace size: 20mb for WM and 80mb for SF -->
45        <option name="run-command" value="cmd window tracing size 20480"/>
46        <option name="run-command" value="su root service call SurfaceFlinger 1029 i32 81920"/>
47    </target_preparer>
48    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
49        <option name="test-user-token" value="%TEST_USER%"/>
50        <option name="run-command" value="rm -rf /data/user/%TEST_USER%/files/*"/>
51        <!-- Disable AOD -->
52        <option name="run-command" value="settings put secure doze_always_on 0"/>
53        <!-- Disable explore hub mode -->
54        <option name="run-command" value="settings put secure glanceable_hub_enabled 0"/>
55        <option name="run-command" value="settings put secure show_ime_with_hard_keyboard 1"/>
56        <option name="run-command" value="settings put system show_touches 1"/>
57        <option name="run-command" value="settings put system pointer_location 1"/>
58        <option name="teardown-command"
59                value="settings delete secure show_ime_with_hard_keyboard"/>
60        <option name="teardown-command" value="settings delete system show_touches"/>
61        <option name="teardown-command" value="settings delete system pointer_location"/>
62        <option name="teardown-command"
63                value="cmd overlay enable com.android.internal.systemui.navbar.gestural"/>
64    </target_preparer>
65    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
66        <option name="cleanup-apks" value="true"/>
67        <option name="test-file-name" value="{MODULE}.apk"/>
68        <option name="test-file-name" value="FlickerTestApp.apk"/>
69    </target_preparer>
70    <!-- Enable mocking GPS location by the test app -->
71    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
72        <option name="run-command"
73                value="appops set com.android.wm.shell.flicker.pip.apps android:mock_location allow"/>
74        <option name="teardown-command"
75                value="appops set com.android.wm.shell.flicker.pip.apps android:mock_location deny"/>
76    </target_preparer>
77
78    <!-- Needed for pushing the trace config file -->
79    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
80    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
81        <option name="push-file"
82                key="trace_config.textproto"
83                value="/data/misc/perfetto-traces/trace_config.textproto"
84        />
85        <!--Install the content provider automatically when we push some file in sdcard folder.-->
86        <!--Needed to avoid the installation during the test suite.-->
87        <option name="push-file" key="trace_config.textproto" value="/sdcard/sample.textproto"/>
88    </target_preparer>
89    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
90        <option name="package" value="{PACKAGE}"/>
91        <option name="shell-timeout" value="6600s"/>
92        <option name="test-timeout" value="6000s"/>
93        <option name="hidden-api-checks" value="false"/>
94        <option name="device-listeners" value="android.device.collectors.PerfettoListener"/>
95        <!-- PerfettoListener related arguments -->
96        <option name="instrumentation-arg" key="perfetto_config_text_proto" value="true"/>
97        <option name="instrumentation-arg"
98                key="perfetto_config_file"
99                value="trace_config.textproto"
100        />
101        <option name="instrumentation-arg" key="per_run" value="true"/>
102        <option name="instrumentation-arg" key="perfetto_persist_pid_track" value="true"/>
103    </test>
104    <!-- Needed for pulling the collected trace config on to the host -->
105    <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
106        <option name="pull-pattern-keys" value="perfetto_file_path"/>
107        <option name="directory-keys"
108                value="/data/user/0/com.android.wm.shell.flicker/files"/>
109        <option name="collect-on-run-ended-only" value="true"/>
110        <option name="clean-up" value="true"/>
111    </metrics_collector>
112</configuration>
113