blob: d969b54dbf596b602671074019dc3c6b10790aac [file] [log] [blame]
Motomu Utsumiceb2a752022-10-04 18:38:04 +09001//
2// Copyright (C) 2019 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
17package {
18 default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
Patrick Rohrf0f0ac02023-01-18 02:54:41 -080021// cronet_test_java_defaults can be used to specify a java_defaults target that
22// either enables or disables Cronet tests. This is used to disable Cronet
23// tests on tm-mainline-prod where the required APIs are not present.
24cronet_test_java_defaults = "CronetTestJavaDefaultsEnabled"
25// This is a placeholder comment to avoid merge conflicts
26// as cronet_test_java_defaults may have different values
27// depending on the branch
28
Patrick Rohr68394242023-01-18 06:19:02 -080029java_defaults {
30 name: "CronetTestJavaDefaultsEnabled",
31 enabled: true,
Dan Stahraf33f012023-03-02 16:09:07 +000032 // TODO(danstahr): move to unconditional static_libs once the T branch is abandoned
33 static_libs: [
34 "truth",
35 ],
Patrick Rohr68394242023-01-18 06:19:02 -080036}
37
38java_defaults {
39 name: "CronetTestJavaDefaultsDisabled",
40 enabled: false,
41}
42
43java_defaults {
44 name: "CronetTestJavaDefaults",
45 defaults: [cronet_test_java_defaults],
46}
47
Chidera Olibiee3e2e7f2023-02-08 19:12:10 +000048android_library {
49 name: "CtsNetHttpTestsLib",
Dan Stahraf33f012023-03-02 16:09:07 +000050 defaults: [
51 "cts_defaults",
52 "CronetTestJavaDefaults",
53 ],
Chidera Olibie4fad0c32022-11-23 18:53:54 +000054 sdk_version: "test_current",
Chidera Olibied66799a2023-01-24 20:22:56 +000055 min_sdk_version: "30",
Chidera Olibiebe5cf702022-12-14 19:42:34 +000056 srcs: [
57 "src/**/*.java",
58 "src/**/*.kt",
59 ],
Motomu Utsumiceb2a752022-10-04 18:38:04 +090060 static_libs: [
Chidera Olibie0a5befb2023-02-14 14:53:37 +000061 "androidx.test.ext.junit",
Chidera Olibie4fad0c32022-11-23 18:53:54 +000062 "ctstestrunner-axt",
Chidera Olibiebe5cf702022-12-14 19:42:34 +000063 "ctstestserver",
Motomu Utsumiceb2a752022-10-04 18:38:04 +090064 "junit",
Stefano Duo7351f472023-01-16 15:56:58 +000065 "hamcrest-library",
Chidera Olibie0a5befb2023-02-14 14:53:37 +000066 "kotlin-test",
Motomu Utsumiceb2a752022-10-04 18:38:04 +090067 ],
68 libs: [
Motomu Utsumiceb2a752022-10-04 18:38:04 +090069 "android.test.base",
Motomu Utsumiceb2a752022-10-04 18:38:04 +090070 "androidx.annotation_annotation",
Patrick Rohr04a633a2023-01-17 23:36:16 -080071 "framework-tethering",
Chidera Olibiebe5cf702022-12-14 19:42:34 +000072 "org.apache.http.legacy",
Motomu Utsumiceb2a752022-10-04 18:38:04 +090073 ],
Chidera Olibied66799a2023-01-24 20:22:56 +000074 lint: { test: true }
Chidera Olibiee3e2e7f2023-02-08 19:12:10 +000075}
Motomu Utsumiceb2a752022-10-04 18:38:04 +090076
Chidera Olibiee3e2e7f2023-02-08 19:12:10 +000077android_test {
78 name: "CtsNetHttpTestCases",
79 defaults: [
80 "cts_defaults",
81 "CronetTestJavaDefaults",
82 ],
83 sdk_version: "test_current",
Chidera Olibiee3e2e7f2023-02-08 19:12:10 +000084 static_libs: ["CtsNetHttpTestsLib"],
Chidera Olibie4fad0c32022-11-23 18:53:54 +000085 // Tag this as a cts test artifact
86 test_suites: [
87 "cts",
88 "general-tests",
89 "mts-tethering"
Motomu Utsumiceb2a752022-10-04 18:38:04 +090090 ],
91}