xref: /aosp_15_r20/external/cronet/test_runner/AndroidNetTest.xml (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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="Config for Cronet-unittests">
18    <!-- Cronet runs on S+ -->
19    <object type="module_controller"
20            class="com.android.tradefed.testtype.suite.module.Sdk31ModuleController" />
21    <!-- Use root for adb. -->
22    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
23    <!-- This is necessary for the APK to read/write to any file on disk. -->
24    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
25        <option name="run-command" value="setenforce 0" />
26        <option name="teardown-command" value="setenforce 1" />
27        <option name="throw-if-cmd-fail" value="true" />
28    </target_preparer>
29    <!-- Uploading the APK to device and installing it -->
30    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
31        <option name="cleanup-apks" value="true"/>
32        <option name="test-file-name" value="cronet_net_tester_app.apk"/>
33    </target_preparer>
34    <!-- Push the testing data to the specified directory before running tests -->
35    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
36        <option name="push-file" key="testdir" value="/storage/emulated/0/chromium_tests_root/net/third_party/quiche/src/quiche/common/platform/api/testdir/" />
37        <option name="push-file" key="data" value="/storage/emulated/0/chromium_tests_root/net/data/" />
38        <option name="push-file" key="anonymous_tokens" value="/storage/emulated/0/chromium_tests_root/third_party/anonymous_tokens/" />
39    </target_preparer>
40    <!-- Runs the test -->
41    <test class="com.android.tradefed.testtype.HostTest">
42        <option name="jar" value="net_unittests_tester.jar"/>
43        <option name="set-option" value="library-to-load:net_unittests__library"/>
44        <option name="enable-pretty-logs" value="false" />
45    </test>
46</configuration>