blob: 12cea1f65296c3c7d370918f3458e36570c8dd61 [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",
Kevin Lima14145a2024-03-19 18:56:34 +000026 ":launcher3-robo-src",
Thales Limaa1012902022-01-13 17:58:42 +000027 ],
Thales Lima9938c2f2022-07-25 14:38:16 +010028 exclude_srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -080029 ":launcher-non-quickstep-tests-src",
Thales Lima9938c2f2022-07-25 14:38:16 +010030 ],
31}
32
Kevin Lima14145a2024-03-19 18:56:34 +000033filegroup {
34 name: "launcher3-robo-src",
35 // multivalentTests directory is a shared folder for not only robolectric converted test
36 // classes but also shared helper classes.
37 srcs: [
38 "multivalentTests/src/**/*.java",
39 "multivalentTests/src/**/*.kt",
40 ],
41}
42
Jordan Silvae5fb55c2023-10-18 16:16:01 +000043// Source code used for screenshot tests
44filegroup {
Uwais Ashraf77b97c02023-12-27 11:44:16 +000045 name: "launcher-image-tests-helpers",
Jordan Silvae5fb55c2023-10-18 16:16:01 +000046 srcs: [
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +000047 "src/com/android/launcher3/celllayout/board/*.java",
48 "src/com/android/launcher3/celllayout/board/*.kt",
49 "src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java",
50 "src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
51 "src/com/android/launcher3/ui/PortraitLandscapeRunner.java",
52 "src/com/android/launcher3/ui/TestViewHelpers.java",
Colin Crossf156b6b2024-01-11 14:03:12 -080053 "multivalentTests/src/com/android/launcher3/util/LauncherLayoutBuilder.java",
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +000054 "src/com/android/launcher3/util/ModelTestExtensions.kt",
55 "src/com/android/launcher3/util/TestConstants.java",
Colin Crossf156b6b2024-01-11 14:03:12 -080056 "multivalentTests/src/com/android/launcher3/util/TestUtil.java",
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +000057 "src/com/android/launcher3/util/Wait.java",
Colin Crossf156b6b2024-01-11 14:03:12 -080058 "multivalentTests/src/com/android/launcher3/util/WidgetUtils.java",
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +000059 "src/com/android/launcher3/util/rule/*.java",
60 "src/com/android/launcher3/util/rule/*.kt",
Colin Crossf156b6b2024-01-11 14:03:12 -080061 "multivalentTests/src/com/android/launcher3/util/rule/*.java",
62 "multivalentTests/src/com/android/launcher3/util/rule/*.kt",
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +000063 "src/com/android/launcher3/util/viewcapture_analysis/*.java",
64 "src/com/android/launcher3/testcomponent/*.java",
65 "src/com/android/launcher3/testcomponent/*.kt",
Jordan Silvae5fb55c2023-10-18 16:16:01 +000066 ],
67}
68
Thales Lima9938c2f2022-07-25 14:38:16 +010069// Source code used for non-quickstep tests
70filegroup {
71 name: "launcher-non-quickstep-tests-src",
72 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -080073 "src/com/android/launcher3/nonquickstep/**/*.java",
74 "src/com/android/launcher3/nonquickstep/**/*.kt",
Thales Lima9938c2f2022-07-25 14:38:16 +010075 ],
Sunny Goyal4af8cf92021-07-29 15:48:24 -070076}
77
78// Source code used for oop test helpers
79filegroup {
80 name: "launcher-oop-tests-src",
81 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -080082 "src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java",
83 "src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java",
84 "src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java",
85 "src/com/android/launcher3/dragging/TaplDragTest.java",
86 "src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java",
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +000087 "src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
88 "src/com/android/launcher3/ui/PortraitLandscapeRunner.java",
Colin Crossf156b6b2024-01-11 14:03:12 -080089 "src/com/android/launcher3/ui/TaplTestsLauncher3Test.java",
90 "src/com/android/launcher3/ui/widget/TaplWidgetPickerTest.java",
91 "src/com/android/launcher3/ui/workspace/TaplWorkspaceTest.java",
92 "multivalentTests/src/com/android/launcher3/util/LauncherLayoutBuilder.java",
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +000093 "src/com/android/launcher3/util/TestConstants.java",
Colin Crossf156b6b2024-01-11 14:03:12 -080094 "multivalentTests/src/com/android/launcher3/util/TestUtil.java",
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +000095 "src/com/android/launcher3/util/Wait.java",
Colin Crossf156b6b2024-01-11 14:03:12 -080096 "multivalentTests/src/com/android/launcher3/util/WidgetUtils.java",
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +000097 "src/com/android/launcher3/util/rule/FailureWatcher.java",
98 "src/com/android/launcher3/util/rule/ViewCaptureRule.kt",
99 "src/com/android/launcher3/util/rule/SamplerRule.java",
100 "src/com/android/launcher3/util/rule/ScreenRecordRule.java",
101 "src/com/android/launcher3/util/rule/ShellCommandRule.java",
102 "src/com/android/launcher3/util/rule/TestIsolationRule.java",
Colin Crossf156b6b2024-01-11 14:03:12 -0800103 "multivalentTests/src/com/android/launcher3/util/rule/TestStabilityRule.java",
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +0000104 "src/com/android/launcher3/util/viewcapture_analysis/*.java",
105 "src/com/android/launcher3/testcomponent/BaseTestingActivity.java",
106 "src/com/android/launcher3/testcomponent/OtherBaseTestingActivity.java",
107 "src/com/android/launcher3/testcomponent/CustomShortcutConfigActivity.java",
108 "src/com/android/launcher3/testcomponent/TestCommandReceiver.java",
109 "src/com/android/launcher3/testcomponent/TestLauncherActivity.java",
110 "src/com/android/launcher3/testcomponent/ImeTestActivity.java",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700111 ],
112}
113
114// Library with all the dependencies for building quickstep
115android_library {
116 name: "Launcher3TestLib",
Colin Crossf156b6b2024-01-11 14:03:12 -0800117 srcs: [],
Sebastian Francoe7c3d3d2023-01-10 10:47:46 -0600118 asset_dirs: ["assets"],
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700119 resource_dirs: ["res"],
120 static_libs: [
Anushree Ganjamd1a28fe2023-08-23 21:40:57 -0700121 "flag-junit-base",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700122 "launcher-aosp-tapl",
Sunny Goyal177785e2021-07-29 15:48:24 -0700123 "androidx.test.core",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700124 "androidx.test.runner",
125 "androidx.test.rules",
126 "androidx.test.ext.junit",
127 "androidx.test.espresso.core",
128 "androidx.test.espresso.contrib",
129 "androidx.test.espresso.intents",
130 "androidx.test.uiautomator_uiautomator",
Brian Isganitis06139e02023-10-03 16:02:39 -0400131 "mockito-kotlin2",
Anushree Ganjam94efd7a2023-08-24 18:28:19 -0700132 "mockito-target-extended-minus-junit4",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700133 "launcher_log_protos_lite",
Krzysztof Kosiński6e3b7a62023-10-10 06:50:28 +0000134 "truth",
vadimt13839e42022-02-17 13:56:06 -0800135 "platform-test-rules",
Pat Manningda696612023-02-17 15:06:58 +0000136 "testables",
Anushree Ganjam2a14b972023-08-30 13:31:10 -0700137 "com_android_launcher3_flags_lib",
Jeremy Sim9e44e372023-10-10 14:54:39 -0700138 "com_android_wm_shell_flags_lib",
Willie Koomsonfedc18e2023-11-07 22:31:46 +0000139 "android.appwidget.flags-aconfig-java",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700140 ],
141 manifest: "AndroidManifest-common.xml",
142 platform_apis: true,
Colin Crossf156b6b2024-01-11 14:03:12 -0800143 // TODO(b/319712088): re-enable use_resource_processor
144 use_resource_processor: false,
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700145}
146
My Name5b59e752021-12-15 20:54:45 -0500147android_library {
148 name: "Launcher3TestResources",
149 resource_dirs: ["res"],
Colin Crossf156b6b2024-01-11 14:03:12 -0800150 // TODO(b/319712088): re-enable use_resource_processor
151 use_resource_processor: false,
My Name5b59e752021-12-15 20:54:45 -0500152}
153
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700154android_test {
155 name: "Launcher3Tests",
156 srcs: [
157 ":launcher-tests-src",
Thales Lima9938c2f2022-07-25 14:38:16 +0100158 ":launcher-non-quickstep-tests-src",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700159 ],
Anushree Ganjamd1a28fe2023-08-23 21:40:57 -0700160 static_libs: [
161 "Launcher3TestLib",
Anushree Ganjam2a14b972023-08-30 13:31:10 -0700162 "com_android_launcher3_flags_lib",
Anushree Ganjamd1a28fe2023-08-23 21:40:57 -0700163 ],
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700164 libs: [
165 "android.test.base",
166 "android.test.runner",
167 "android.test.mock",
168 ],
Anushree Ganjam94efd7a2023-08-24 18:28:19 -0700169 // Libraries used by mockito inline extended
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700170 jni_libs: [
171 "libdexmakerjvmtiagent",
172 "libstaticjvmtiagent",
173 ],
174 use_embedded_native_libs: false,
175 compile_multilib: "both",
176 instrumentation_for: "Launcher3",
177 manifest: "AndroidManifest.xml",
178 platform_apis: true,
179 test_config: "Launcher3Tests.xml",
Vadim Tryshev990a32e2023-03-02 21:51:21 +0000180 data: [":Launcher3"],
181 test_suites: ["general-tests"],
Sunny Goyalf5c42ea2021-03-12 16:00:40 -0800182}
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000183
184// Shared between tests and launcher
185android_library {
186 name: "launcher-testing-shared",
187 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -0800188 "multivalentTests/shared/com/android/launcher3/testing/shared/**/*.java",
Uwais Ashraff7c9e2c2024-02-28 11:47:56 +0000189 "multivalentTests/shared/com/android/launcher3/testing/shared/**/*.kt",
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000190 ],
Colin Crossf156b6b2024-01-11 14:03:12 -0800191 resource_dirs: [],
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000192 manifest: "multivalentTests/shared/AndroidManifest.xml",
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000193 sdk_version: "current",
194 min_sdk_version: min_launcher3_sdk_version,
Colin Crossf156b6b2024-01-11 14:03:12 -0800195}
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000196
197filegroup {
198 name: "launcher-testing-helpers",
199 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -0800200 "src/**/*.java",
201 "src/**/*.kt",
202 "multivalentTests/src/**/*.java",
203 "multivalentTests/src/**/*.kt",
Uwais Ashraf9c2f5a42024-03-04 09:49:39 +0000204 "src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
205 "tapl/com/android/launcher3/tapl/*.java",
206 "tapl/com/android/launcher3/tapl/*.kt",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000207 ],
208 exclude_srcs: [
209 // Test classes
210 "src/**/*Test.java",
211 "src/**/*Test.kt",
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000212 "multivalentTests/src/**/*Test.java",
213 "multivalentTests/src/**/*Test.kt",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000214 ],
215}
216
217android_library {
218 name: "Launcher3Lib",
219 srcs: [
220 ":launcher-src",
221 ":launcher-src_shortcuts_overrides",
222 ":launcher-src_ui_overrides",
223 ],
224 static_libs: [
225 "Launcher3CommonDepsLib",
226 ],
Colin Crossf156b6b2024-01-11 14:03:12 -0800227 // TODO(b/319712088): re-enable use_resource_processor
228 use_resource_processor: false,
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000229}
230
231android_robolectric_test {
232 enabled: true,
233 name: "Launcher3RoboTests",
234 srcs: [
Kevin Lima14145a2024-03-19 18:56:34 +0000235 ":launcher3-robo-src",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000236
237 // Test util classes
238 ":launcher-testing-helpers",
239 ":launcher-testing-shared",
240 ],
241 exclude_srcs: [
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000242 //"src/com/android/launcher3/util/CellContentDimensionsTest.kt", // Failing - b/316553889
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000243
244 // requires modification to work with inline mock maker
245 "src/com/android/launcher3/util/rule/StaticMockitoRule.java",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000246 ],
247 java_resource_dirs: ["config"],
248 static_libs: [
249 "flag-junit-base",
250 "com_android_launcher3_flags_lib",
251 "com_android_wm_shell_flags_lib",
252 "androidx.test.uiautomator_uiautomator",
253 "androidx.core_core-animation-testing",
254 "androidx.test.ext.junit",
Uwais Ashraff7c9e2c2024-02-28 11:47:56 +0000255 "mockito-robolectric-prebuilt",
256 "mockito-kotlin2",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000257 "platform-parametric-runner-lib",
258 "testables",
259 "Launcher3TestResources",
260 "SystemUISharedLib",
261 "launcher-testing-shared",
262 ],
263 libs: [
264 "android.test.runner",
265 "android.test.base",
266 "android.test.mock",
267 "truth",
268 ],
269 instrumentation_for: "Launcher3",
270 upstream: true,
271}