blob: 35a227523bfa06343af985b0afb8f0cacd01ec12 [file] [log] [blame]
Sunny Goyalf5c42ea2021-03-12 16:00:40 -08001// Copyright (C) 2021 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.
Bob Badoura7548b52022-01-27 22:04:48 -080014
Bob Badour390b27e2021-03-19 04:22:23 -070015package {
16 // See: http://go/android-license-faq
Bob Badoura7548b52022-01-27 22:04:48 -080017 default_applicable_licenses: ["Android-Apache-2.0"],
Bob Badour390b27e2021-03-19 04:22:23 -070018}
19
Sunny Goyal4af8cf92021-07-29 15:48:24 -070020// Source code used for test
Sunny Goyalf5c42ea2021-03-12 16:00:40 -080021filegroup {
Sunny Goyal4af8cf92021-07-29 15:48:24 -070022 name: "launcher-tests-src",
Thales Limaa1012902022-01-13 17:58:42 +000023 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -080024 "src/**/*.java",
25 "src/**/*.kt",
Sunny Goyal0f4bc922024-05-06 11:31:26 -070026 "multivalentTests/src/**/*.java",
27 "multivalentTests/src/**/*.kt",
Thales Limaa1012902022-01-13 17:58:42 +000028 ],
Thales Lima9938c2f2022-07-25 14:38:16 +010029 exclude_srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -080030 ":launcher-non-quickstep-tests-src",
Thales Lima9938c2f2022-07-25 14:38:16 +010031 ],
32}
33
Kevin Lima14145a2024-03-19 18:56:34 +000034filegroup {
35 name: "launcher3-robo-src",
36 // multivalentTests directory is a shared folder for not only robolectric converted test
37 // classes but also shared helper classes.
38 srcs: [
39 "multivalentTests/src/**/*.java",
40 "multivalentTests/src/**/*.kt",
Sunny Goyal0f4bc922024-05-06 11:31:26 -070041 "src_deviceless/**/*.java",
42 "src_deviceless/**/*.kt",
Kevin Lima14145a2024-03-19 18:56:34 +000043 ],
44}
45
Thales Lima9938c2f2022-07-25 14:38:16 +010046// Source code used for non-quickstep tests
47filegroup {
48 name: "launcher-non-quickstep-tests-src",
49 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -080050 "src/com/android/launcher3/nonquickstep/**/*.java",
51 "src/com/android/launcher3/nonquickstep/**/*.kt",
Thales Lima9938c2f2022-07-25 14:38:16 +010052 ],
Sunny Goyal4af8cf92021-07-29 15:48:24 -070053}
54
55// Source code used for oop test helpers
56filegroup {
57 name: "launcher-oop-tests-src",
58 srcs: [
Sunny Goyal5ca50492024-03-18 14:50:48 -070059 ":launcher-testing-helpers",
Colin Crossf156b6b2024-01-11 14:03:12 -080060 "src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java",
61 "src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java",
62 "src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java",
63 "src/com/android/launcher3/dragging/TaplDragTest.java",
64 "src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java",
Colin Crossf156b6b2024-01-11 14:03:12 -080065 "src/com/android/launcher3/ui/TaplTestsLauncher3Test.java",
66 "src/com/android/launcher3/ui/widget/TaplWidgetPickerTest.java",
67 "src/com/android/launcher3/ui/workspace/TaplWorkspaceTest.java",
Sunny Goyal4af8cf92021-07-29 15:48:24 -070068 ],
69}
70
71// Library with all the dependencies for building quickstep
72android_library {
73 name: "Launcher3TestLib",
Jordan Silva4afa1952024-08-06 16:54:59 +010074 defaults: [
75 "launcher_compose_tests_defaults",
76 ],
Colin Crossf156b6b2024-01-11 14:03:12 -080077 srcs: [],
Sebastian Francoe7c3d3d2023-01-10 10:47:46 -060078 asset_dirs: ["assets"],
Sunny Goyal4af8cf92021-07-29 15:48:24 -070079 resource_dirs: ["res"],
80 static_libs: [
Anushree Ganjamd1a28fe2023-08-23 21:40:57 -070081 "flag-junit-base",
Sunny Goyal4af8cf92021-07-29 15:48:24 -070082 "launcher-aosp-tapl",
Sunny Goyal177785e2021-07-29 15:48:24 -070083 "androidx.test.core",
Sunny Goyal4af8cf92021-07-29 15:48:24 -070084 "androidx.test.runner",
85 "androidx.test.rules",
86 "androidx.test.ext.junit",
87 "androidx.test.espresso.core",
88 "androidx.test.espresso.contrib",
89 "androidx.test.espresso.intents",
90 "androidx.test.uiautomator_uiautomator",
Brian Isganitis06139e02023-10-03 16:02:39 -040091 "mockito-kotlin2",
Anushree Ganjam94efd7a2023-08-24 18:28:19 -070092 "mockito-target-extended-minus-junit4",
Sunny Goyal4af8cf92021-07-29 15:48:24 -070093 "launcher_log_protos_lite",
Krzysztof KosiƄski6e3b7a62023-10-10 06:50:28 +000094 "truth",
Uwais Ashraf6e9927e2024-03-25 10:53:06 +000095 "kotlinx_coroutines_test",
vadimt13839e42022-02-17 13:56:06 -080096 "platform-test-rules",
Pat Manningda696612023-02-17 15:06:58 +000097 "testables",
Anushree Ganjam2a14b972023-08-30 13:31:10 -070098 "com_android_launcher3_flags_lib",
Jeremy Sim9e44e372023-10-10 14:54:39 -070099 "com_android_wm_shell_flags_lib",
Willie Koomsonfedc18e2023-11-07 22:31:46 +0000100 "android.appwidget.flags-aconfig-java",
Sunny Goyal0b7f4cf2024-10-17 09:44:25 -0700101 "platform-parametric-runner-lib",
102 "kotlin-reflect",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700103 ],
104 manifest: "AndroidManifest-common.xml",
105 platform_apis: true,
Colin Crossf156b6b2024-01-11 14:03:12 -0800106 // TODO(b/319712088): re-enable use_resource_processor
107 use_resource_processor: false,
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700108}
109
My Name5b59e752021-12-15 20:54:45 -0500110android_library {
111 name: "Launcher3TestResources",
112 resource_dirs: ["res"],
Sihua Ma1593bb42024-04-26 18:42:58 +0000113 asset_dirs: ["assets"],
Colin Crossf156b6b2024-01-11 14:03:12 -0800114 // TODO(b/319712088): re-enable use_resource_processor
115 use_resource_processor: false,
Sunny Goyal0b7f4cf2024-10-17 09:44:25 -0700116 static_libs: [
117 "kotlin-reflect",
118 ],
My Name5b59e752021-12-15 20:54:45 -0500119}
120
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700121android_test {
122 name: "Launcher3Tests",
Jordan Silva4afa1952024-08-06 16:54:59 +0100123 defaults: [
124 "launcher_compose_tests_defaults",
125 ],
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700126 srcs: [
127 ":launcher-tests-src",
Thales Lima9938c2f2022-07-25 14:38:16 +0100128 ":launcher-non-quickstep-tests-src",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700129 ],
Anushree Ganjamd1a28fe2023-08-23 21:40:57 -0700130 static_libs: [
131 "Launcher3TestLib",
Anushree Ganjam2a14b972023-08-30 13:31:10 -0700132 "com_android_launcher3_flags_lib",
Anushree Ganjamd1a28fe2023-08-23 21:40:57 -0700133 ],
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700134 libs: [
Jihoon Kang9f8e4b62024-08-30 00:29:41 +0000135 "android.test.base.stubs.system",
136 "android.test.runner.stubs.system",
137 "android.test.mock.stubs.system",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700138 ],
Anushree Ganjam94efd7a2023-08-24 18:28:19 -0700139 // Libraries used by mockito inline extended
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700140 jni_libs: [
141 "libdexmakerjvmtiagent",
142 "libstaticjvmtiagent",
143 ],
144 use_embedded_native_libs: false,
145 compile_multilib: "both",
146 instrumentation_for: "Launcher3",
147 manifest: "AndroidManifest.xml",
148 platform_apis: true,
149 test_config: "Launcher3Tests.xml",
Vadim Tryshev990a32e2023-03-02 21:51:21 +0000150 data: [":Launcher3"],
Anushree Ganjamef2c5c02024-10-22 11:52:31 -0700151 plugins: ["dagger2-compiler"],
Vadim Tryshev990a32e2023-03-02 21:51:21 +0000152 test_suites: ["general-tests"],
Sunny Goyalf5c42ea2021-03-12 16:00:40 -0800153}
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000154
155// Shared between tests and launcher
156android_library {
157 name: "launcher-testing-shared",
158 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -0800159 "multivalentTests/shared/com/android/launcher3/testing/shared/**/*.java",
Uwais Ashraff7c9e2c2024-02-28 11:47:56 +0000160 "multivalentTests/shared/com/android/launcher3/testing/shared/**/*.kt",
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000161 ],
Colin Crossf156b6b2024-01-11 14:03:12 -0800162 resource_dirs: [],
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000163 manifest: "multivalentTests/shared/AndroidManifest.xml",
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000164 sdk_version: "current",
165 min_sdk_version: min_launcher3_sdk_version,
Colin Crossf156b6b2024-01-11 14:03:12 -0800166}
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000167
168filegroup {
Sihua Maa9e43242024-08-23 22:13:33 +0000169 name: "launcher-testing-helpers-robo",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000170 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -0800171 "src/**/*.java",
172 "src/**/*.kt",
173 "multivalentTests/src/**/*.java",
174 "multivalentTests/src/**/*.kt",
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +0000175 "src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
176 "tapl/com/android/launcher3/tapl/*.java",
177 "tapl/com/android/launcher3/tapl/*.kt",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000178 ],
179 exclude_srcs: [
180 // Test classes
181 "src/**/*Test.java",
182 "src/**/*Test.kt",
Sihua Ma58e85732024-07-26 16:41:49 +0000183 "src/**/RoboApiWrapper.kt",
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000184 "multivalentTests/src/**/*Test.java",
185 "multivalentTests/src/**/*Test.kt",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000186 ],
187}
188
Sihua Ma58e85732024-07-26 16:41:49 +0000189filegroup {
190 name: "launcher-testing-helpers",
191 srcs: [
Sihua Maa9e43242024-08-23 22:13:33 +0000192 ":launcher-testing-helpers-robo",
Sihua Ma58e85732024-07-26 16:41:49 +0000193 "src/**/RoboApiWrapper.kt",
194 ],
195}
196
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000197android_robolectric_test {
198 enabled: true,
199 name: "Launcher3RoboTests",
200 srcs: [
Kevin Lima14145a2024-03-19 18:56:34 +0000201 ":launcher3-robo-src",
Sihua Maa9e43242024-08-23 22:13:33 +0000202 ":launcher-testing-helpers-robo",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000203 ],
204 exclude_srcs: [
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000205 //"src/com/android/launcher3/util/CellContentDimensionsTest.kt", // Failing - b/316553889
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000206
207 // requires modification to work with inline mock maker
208 "src/com/android/launcher3/util/rule/StaticMockitoRule.java",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000209 ],
210 java_resource_dirs: ["config"],
211 static_libs: [
212 "flag-junit-base",
Uwais Ashraf784b4f22024-05-21 15:42:34 +0000213 "flag-junit",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000214 "com_android_launcher3_flags_lib",
215 "com_android_wm_shell_flags_lib",
216 "androidx.test.uiautomator_uiautomator",
217 "androidx.core_core-animation-testing",
218 "androidx.test.ext.junit",
Sihua Ma350c29a2024-05-23 22:03:42 +0000219 "androidx.test.espresso.core",
220 "androidx.test.espresso.contrib",
221 "androidx.test.espresso.intents",
Sihua Ma444b8e62024-03-21 21:50:20 +0000222 "androidx.test.rules",
Uwais Ashraf7a0150d2024-04-08 20:59:23 +0000223 "uiautomator-helpers",
Uwais Ashraf029de6d2024-05-21 11:59:05 +0000224 "inline-mockito-robolectric-prebuilt",
225 "mockito-kotlin-nodeps",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000226 "platform-parametric-runner-lib",
Uwais Ashraf784b4f22024-05-21 15:42:34 +0000227 "platform-test-rules-deviceless",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000228 "testables",
229 "Launcher3TestResources",
230 "SystemUISharedLib",
231 "launcher-testing-shared",
Sihua Made5ef622024-06-08 01:15:40 +0000232 "android.appwidget.flags-aconfig-java",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000233 ],
234 libs: [
Jihoon Kang9f8e4b62024-08-30 00:29:41 +0000235 "android.test.runner.stubs.system",
236 "android.test.base.stubs.system",
237 "android.test.mock.stubs.system",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000238 "truth",
239 ],
240 instrumentation_for: "Launcher3",
Anushree Ganjamef2c5c02024-10-22 11:52:31 -0700241 plugins: ["dagger2-compiler"],
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000242 upstream: true,
Kevin Liua75ea0b2024-05-08 01:43:53 +0000243 strict_mode: false,
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000244}