xref: /aosp_15_r20/external/cronet/test_runner/AndroidTest.xml (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1<?xml version="1.0" encoding="utf-8"?><!--
2  ~ Copyright (C) 2023 The Android Open Source Project
3  ~
4  ~ Licensed under the Apache License, Version 2.0 (the "License");
5  ~ you may not use this file except in compliance with the License.
6  ~ You may obtain a copy of the License at
7  ~
8  ~      http://www.apache.org/licenses/LICENSE-2.0
9  ~
10  ~ Unless required by applicable law or agreed to in writing, software
11  ~ distributed under the License is distributed on an "AS IS" BASIS,
12  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  ~ See the License for the specific language governing permissions and
14  ~ limitations under the License.
15  -->
16<configuration description="Config for Cronet-unittests">
17    <!-- Cronet runs on S+ -->
18    <object type="module_controller"
19            class="com.android.tradefed.testtype.suite.module.Sdk31ModuleController" />
20    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
21    <!-- Allow the testing APK to read/write to any file. This is needed for /data/local/tmp read/write access -->
22    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
23        <option name="run-command" value="setenforce 0" />
24        <option name="teardown-command" value="setenforce 1" />
25        <option name="throw-if-cmd-fail" value="true" />
26    </target_preparer>
27    <!-- Uploading the APK to device and installing it -->
28    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
29        <option name="cleanup-apks" value="true"/>
30        <option name="test-file-name" value="cronet_tester_app.apk"/>
31    </target_preparer>
32    <!-- Runs the test -->
33    <test class="com.android.tradefed.testtype.HostTest">
34        <option name="jar" value="cronet_unittests_tester.jar" />
35        <option name="set-option" value="library-to-load:cronet_unittests_android__library" />
36        <option name="enable-pretty-logs" value="false" />
37    </test>
38</configuration>