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.stubs.system",
25        "telephony-common",
26        "android.test.base.stubs.system",
27        "android.test.mock.stubs.system",
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        "cellbroadcastreceiver_flags_lib",
36    ],
37    // Include all test java files.
38    srcs: [":cellbroadcastreceiver-shared-srcs-test"],
39    platform_apis: true,
40    min_sdk_version: "30",
41}
42
43// in order to have our tests run on OEM devices, the test apk here includes
44// module code within it and filters out tests which require UI.
45// For the full test apk which does not run on OEM devices, see CellBroadcastReceiverUnitTests
46android_test {
47    name: "CellBroadcastReceiverOemUnitTests",
48    defaults: ["CellBroadcastTestCommon"],
49    test_suites: [
50        "device-tests",
51        "mts-cellbroadcast",
52    ],
53    manifest: "AndroidManifest_OemTesting.xml",
54    test_config: "AndroidTest_Oem.xml",
55    aaptflags: [
56        "--custom-package com.android.cellbroadcastreceiver",
57    ],
58    static_libs: [
59        "androidx.legacy_legacy-support-v4",
60        "androidx.legacy_legacy-support-v13",
61        "androidx.recyclerview_recyclerview",
62        "androidx.preference_preference",
63        "androidx.appcompat_appcompat",
64        "androidx.legacy_legacy-preference-v14",
65        "SettingsLibSettingsTheme",
66        "SettingsLibCollapsingToolbarBaseActivity",
67        "SettingsLibMainSwitchPreference",
68        "SettingsLibTopIntroPreference",
69        "modules-utils-build_system",
70        "cellbroadcast-java-proto-lite",
71        "CellBroadcastCommon",
72        "cellbroadcastreceiver_flags_lib",
73    ],
74    min_sdk_version: "30",
75}
76
77// used to run mts coverage test
78android_test {
79    name: "CellBroadcastReceiverUnitTests",
80    certificate: "networkstack",
81    defaults: ["CellBroadcastTestCommon"],
82    instrumentation_for: "CellBroadcastApp",
83    test_suites: [
84        "device-tests",
85    ],
86    manifest: "AndroidManifest.xml",
87    test_config: "AndroidTest.xml",
88    min_sdk_version: "30",
89}
90
91android_test {
92    name: "CellBroadcastReceiverGoogleUnitTests",
93    certificate: "networkstack",
94    defaults: ["CellBroadcastTestCommon"],
95    instrumentation_for: "CellBroadcastApp",
96    test_suites: [
97        "general-tests",
98    ],
99    manifest: "AndroidManifest.xml",
100    target_sdk_version: "10000",
101    test_config: "AndroidTest_PixelExperience.xml",
102}
103
104android_test {
105    name: "CellBroadcastReceiverPlatformUnitTests",
106    certificate: "platform",
107    defaults: ["CellBroadcastTestCommon"],
108    instrumentation_for: "CellBroadcastAppPlatform",
109    test_suites: ["device-tests"],
110    data: [
111        ":CellBroadcastReceiverUnitTests",
112    ],
113}
114
115// used to share src with unit test app
116filegroup {
117    name: "cellbroadcastreceiver-shared-srcs-test",
118    srcs: [
119        "src/**/*.java",
120    ],
121}
122