• 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        <!-- prevents the phone from restarting -->
28        <option name="force-skip-system-props" value="true"/>
29        <!-- set WM tracing verbose level to all -->
30        <option name="run-command" value="cmd window tracing level all"/>
31        <!-- set WM tracing to frame (avoid incomplete states) -->
32        <option name="run-command" value="cmd window tracing frame"/>
33        <!-- disable betterbug as it's log collection dialogues cause flakes in e2e tests -->
34        <option name="run-command" value="pm disable com.google.android.internal.betterbug"/>
35        <!-- ensure lock screen mode is swipe -->
36        <option name="run-command" value="locksettings set-disabled false"/>
37        <!-- restart launcher to activate TAPL -->
38        <option name="run-command"
39                value="setprop ro.test_harness 1 ; am force-stop com.google.android.apps.nexuslauncher"/>
40        <!-- Increase trace size: 20mb for WM and 80mb for SF -->
41        <option name="run-command" value="cmd window tracing size 20480"/>
42        <option name="run-command" value="su root service call SurfaceFlinger 1029 i32 81920"/>
43    </target_preparer>
44    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
45        <option name="test-user-token" value="%TEST_USER%"/>
46        <option name="run-command" value="rm -rf /data/user/%TEST_USER%/files/*"/>
47        <option name="run-command" value="settings put secure show_ime_with_hard_keyboard 1"/>
48        <option name="run-command" value="settings put system show_touches 1"/>
49        <option name="run-command" value="settings put system pointer_location 1"/>
50        <option name="run-command" value="settings put global package_verifier_user_consent -1"/>
51        <option name="teardown-command"
52                value="settings delete secure show_ime_with_hard_keyboard"/>
53        <option name="teardown-command" value="settings delete system show_touches"/>
54        <option name="teardown-command" value="settings delete system pointer_location"/>
55        <option name="teardown-command"
56                value="cmd overlay enable com.android.internal.systemui.navbar.gestural"/>
57        <option name="teardown-command"
58                value="settings put global package_verifier_user_consent 1"/>
59    </target_preparer>
60    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
61        <option name="cleanup-apks" value="true"/>
62        <option name="test-file-name" value="WMShellFlickerTestsPipAppsCSuite.apk"/>
63        <option name="test-file-name" value="FlickerTestApp.apk"/>
64    </target_preparer>
65
66    <!-- Needed for installing apk's from Play Store -->
67    <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
68        <option name="aapt-version" value="AAPT2"/>
69        <option name="throw-if-not-found" value="false"/>
70        <option name="install-arg" value="-d"/>
71        <option name="install-arg" value="-g"/>
72        <option name="install-arg" value="-r"/>
73        <option name="test-file-name" value="pstash://com.netflix.mediaclient"/>
74    </target_preparer>
75
76    <!-- Enable mocking GPS location by the test app -->
77    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
78        <option name="run-command"
79                value="appops set com.android.shell android:mock_location allow"/>
80        <option name="teardown-command"
81                value="appops set com.android.shell android:mock_location deny"/>
82    </target_preparer>
83
84    <!-- Use app crawler to log into Netflix -->
85    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
86        <option name="run-command"
87                value="am start -n com.netflix.mediaclient/com.netflix.mediaclient.ui.login.LoginActivity"/>
88    </target_preparer>
89    <test class="com.android.tradefed.testtype.HostTest" >
90        <option name="set-option" value="package-name:com.netflix.mediaclient"/>
91        <option name="set-option" value="ui-automator-mode:true"/>
92        <option name="class" value="com.android.csuite.tests.AppCrawlTest" />
93    </test>
94
95    <!-- Needed for pushing the trace config file -->
96    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
97    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
98        <option name="push-file"
99                key="trace_config.textproto"
100                value="/data/misc/perfetto-traces/trace_config.textproto"
101        />
102        <!--Install the content provider automatically when we push some file in sdcard folder.-->
103        <!--Needed to avoid the installation during the test suite.-->
104        <option name="push-file" key="trace_config.textproto" value="/sdcard/sample.textproto"/>
105    </target_preparer>
106    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
107        <option name="package" value="com.android.wm.shell.flicker.pip.apps"/>
108        <option name="shell-timeout" value="6600s"/>
109        <option name="test-timeout" value="6000s"/>
110        <option name="hidden-api-checks" value="false"/>
111        <option name="device-listeners" value="android.device.collectors.PerfettoListener"/>
112        <!-- PerfettoListener related arguments -->
113        <option name="instrumentation-arg" key="perfetto_config_text_proto" value="true"/>
114        <option name="instrumentation-arg"
115                key="perfetto_config_file"
116                value="trace_config.textproto"
117        />
118        <option name="instrumentation-arg" key="per_run" value="true"/>
119    </test>
120    <!-- Needed for pulling the collected trace config on to the host -->
121    <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
122        <option name="pull-pattern-keys" value="perfetto_file_path"/>
123        <option name="directory-keys"
124                value="/data/user/0/com.android.wm.shell.flicker.pip.apps/files"/>
125        <option name="collect-on-run-ended-only" value="true"/>
126        <option name="clean-up" value="true"/>
127    </metrics_collector>
128</configuration>
129