1// Copyright 2016, The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_team: "trendy_team_fwk_telephony",
17    // See: http://go/android-license-faq
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21java_defaults {
22    name: "CellBroadcastTestCommon",
23    libs: [
24        "android.test.runner",
25        "telephony-common",
26        "android.test.base",
27        "android.test.mock",
28    ],
29    static_libs: [
30        "androidx.test.rules",
31        "androidx.test.espresso.core",
32        "androidx.test.uiautomator_uiautomator",
33        "mockito-target-minus-junit4",
34        "truth",
35    ],
36    // Include all test java files.
37    srcs: [":cellbroadcastreceiver-shared-srcs-test"],
38    platform_apis: true,
39    min_sdk_version: "30",
40}
41
42// in order to have our tests run on OEM devices, the test apk here includes
43// module code within it and filters out tests which require UI.
44// For the full test apk which does not run on OEM devices, see CellBroadcastReceiverUnitTests
45android_test {
46    name: "CellBroadcastReceiverOemUnitTests",
47    defaults: ["CellBroadcastTestCommon"],
48    test_suites: [
49        "device-tests",
50        "mts-cellbroadcast",
51    ],
52    manifest: "AndroidManifest_OemTesting.xml",
53    test_config: "AndroidTest_Oem.xml",
54    aaptflags: [
55        "--custom-package com.android.cellbroadcastreceiver",
56    ],
57    static_libs: [
58        "androidx.legacy_legacy-support-v4",
59        "androidx.legacy_legacy-support-v13",
60        "androidx.recyclerview_recyclerview",
61        "androidx.preference_preference",
62        "androidx.appcompat_appcompat",
63        "androidx.legacy_legacy-preference-v14",
64        "SettingsLibSettingsTheme",
65        "SettingsLibCollapsingToolbarBaseActivity",
66        "SettingsLibMainSwitchPreference",
67        "SettingsLibTopIntroPreference",
68        "modules-utils-build_system",
69        "cellbroadcast-java-proto-lite",
70        "CellBroadcastCommon",
71    ],
72    min_sdk_version: "30",
73}
74
75// used to run mts coverage test
76android_test {
77    name: "CellBroadcastReceiverUnitTests",
78    certificate: "networkstack",
79    defaults: ["CellBroadcastTestCommon"],
80    instrumentation_for: "CellBroadcastApp",
81    test_suites: [
82        "device-tests",
83        "mts-cellbroadcast",
84    ],
85    manifest: "AndroidManifest.xml",
86    test_config: "AndroidTest.xml",
87}
88
89android_test {
90    name: "CellBroadcastReceiverGoogleUnitTests",
91    certificate: "networkstack",
92    defaults: ["CellBroadcastTestCommon"],
93    instrumentation_for: "CellBroadcastApp",
94    test_suites: [
95        "general-tests",
96        "mts-cellbroadcast",
97    ],
98    manifest: "AndroidManifest.xml",
99    test_config: "AndroidTest_PixelExperience.xml",
100}
101
102android_test {
103    name: "CellBroadcastReceiverPlatformUnitTests",
104    certificate: "platform",
105    defaults: ["CellBroadcastTestCommon"],
106    instrumentation_for: "CellBroadcastAppPlatform",
107    test_suites: ["device-tests"],
108    data: [
109        ":CellBroadcastReceiverUnitTests",
110    ],
111}
112
113// used to share src with unit test app
114filegroup {
115    name: "cellbroadcastreceiver-shared-srcs-test",
116    srcs: [
117        "src/**/*.java",
118    ],
119}
120