• 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 WMShellFlickerTestsPipAppsCSuite">
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="on"/>
29        <!-- Turns off Bluetooth -->
30        <option name="bluetooth" value="on"/>
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        <option name="run-command" value="settings put secure show_ime_with_hard_keyboard 1"/>
54        <option name="run-command" value="settings put system show_touches 1"/>
55        <option name="run-command" value="settings put system pointer_location 1"/>
56        <option name="run-command" value="settings put global package_verifier_user_consent -1"/>
57        <option name="teardown-command"
58                value="settings delete secure show_ime_with_hard_keyboard"/>
59        <option name="teardown-command" value="settings delete system show_touches"/>
60        <option name="teardown-command" value="settings delete system pointer_location"/>
61        <option name="teardown-command"
62                value="cmd overlay enable com.android.internal.systemui.navbar.gestural"/>
63        <option name="teardown-command"
64                value="settings put global package_verifier_user_consent 1"/>
65    </target_preparer>
66    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
67        <option name="cleanup-apks" value="true"/>
68        <option name="test-file-name" value="WMShellFlickerTestsPipAppsCSuite.apk"/>
69        <option name="test-file-name" value="FlickerTestApp.apk"/>
70    </target_preparer>
71
72    <!-- Needed for installing apk's from Play Store -->
73    <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
74        <option name="aapt-version" value="AAPT2"/>
75        <option name="throw-if-not-found" value="false"/>
76        <option name="install-arg" value="-d"/>
77        <option name="install-arg" value="-g"/>
78        <option name="install-arg" value="-r"/>
79        <option name="test-file-name" value="pstash://com.netflix.mediaclient"/>
80    </target_preparer>
81
82    <!-- Enable mocking GPS location by the test app -->
83    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
84        <option name="run-command"
85                value="appops set com.android.shell android:mock_location allow"/>
86        <option name="teardown-command"
87                value="appops set com.android.shell android:mock_location deny"/>
88    </target_preparer>
89
90    <!-- Use app crawler to log into Netflix -->
91    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
92        <option name="run-command"
93                value="am start -n com.netflix.mediaclient/com.netflix.mediaclient.ui.login.LoginActivity"/>
94    </target_preparer>
95    <test class="com.android.tradefed.testtype.HostTest" >
96        <option name="set-option" value="package-name:com.netflix.mediaclient"/>
97        <option name="set-option" value="ui-automator-mode:true"/>
98        <option name="class" value="com.android.csuite.tests.AppCrawlTest" />
99    </test>
100
101    <!-- Needed for pushing the trace config file -->
102    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
103    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
104        <option name="push-file"
105                key="trace_config.textproto"
106                value="/data/misc/perfetto-traces/trace_config.textproto"
107        />
108        <!--Install the content provider automatically when we push some file in sdcard folder.-->
109        <!--Needed to avoid the installation during the test suite.-->
110        <option name="push-file" key="trace_config.textproto" value="/sdcard/sample.textproto"/>
111    </target_preparer>
112    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
113        <option name="package" value="com.android.wm.shell.flicker.pip.apps"/>
114        <option name="shell-timeout" value="6600s"/>
115        <option name="test-timeout" value="6000s"/>
116        <option name="hidden-api-checks" value="false"/>
117        <option name="device-listeners" value="android.device.collectors.PerfettoListener"/>
118        <!-- PerfettoListener related arguments -->
119        <option name="instrumentation-arg" key="perfetto_config_text_proto" value="true"/>
120        <option name="instrumentation-arg"
121                key="perfetto_config_file"
122                value="trace_config.textproto"
123        />
124        <option name="instrumentation-arg" key="per_run" value="true"/>
125    </test>
126    <!-- Needed for pulling the collected trace config on to the host -->
127    <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
128        <option name="pull-pattern-keys" value="perfetto_file_path"/>
129        <option name="directory-keys"
130                value="/data/user/0/com.android.wm.shell.flicker.pip.apps/files"/>
131        <option name="collect-on-run-ended-only" value="true"/>
132        <option name="clean-up" value="true"/>
133    </metrics_collector>
134</configuration>
135