blob: b053bbea3b26084d9894a99983340d0d78a7b18c [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",
26 "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
Jordan Silvae5fb55c2023-10-18 16:16:01 +000034// Source code used for screenshot tests
35filegroup {
Uwais Ashraf77b97c02023-12-27 11:44:16 +000036 name: "launcher-image-tests-helpers",
Jordan Silvae5fb55c2023-10-18 16:16:01 +000037 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -080038 "multivalentTests/src/com/android/launcher3/celllayout/board/*.java",
39 "multivalentTests/src/com/android/launcher3/celllayout/board/*.kt",
40 "multivalentTests/src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java",
41 "multivalentTests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
42 "multivalentTests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java",
43 "multivalentTests/src/com/android/launcher3/ui/TestViewHelpers.java",
44 "multivalentTests/src/com/android/launcher3/util/LauncherLayoutBuilder.java",
45 "multivalentTests/src/com/android/launcher3/util/ModelTestExtensions.kt",
46 "multivalentTests/src/com/android/launcher3/util/TestConstants.java",
47 "multivalentTests/src/com/android/launcher3/util/TestUtil.java",
48 "multivalentTests/src/com/android/launcher3/util/Wait.java",
49 "multivalentTests/src/com/android/launcher3/util/WidgetUtils.java",
50 "multivalentTests/src/com/android/launcher3/util/rule/*.java",
51 "multivalentTests/src/com/android/launcher3/util/rule/*.kt",
52 "multivalentTests/src/com/android/launcher3/util/rule/*.java",
53 "multivalentTests/src/com/android/launcher3/util/rule/*.kt",
54 "multivalentTests/src/com/android/launcher3/util/viewcapture_analysis/*.java",
55 "multivalentTests/src/com/android/launcher3/testcomponent/*.java",
56 "multivalentTests/src/com/android/launcher3/testcomponent/*.kt",
Jordan Silvae5fb55c2023-10-18 16:16:01 +000057 ],
58}
59
Thales Lima9938c2f2022-07-25 14:38:16 +010060// Source code used for non-quickstep tests
61filegroup {
62 name: "launcher-non-quickstep-tests-src",
63 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -080064 "src/com/android/launcher3/nonquickstep/**/*.java",
65 "src/com/android/launcher3/nonquickstep/**/*.kt",
Thales Lima9938c2f2022-07-25 14:38:16 +010066 ],
Sunny Goyal4af8cf92021-07-29 15:48:24 -070067}
68
69// Source code used for oop test helpers
70filegroup {
71 name: "launcher-oop-tests-src",
72 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -080073 "src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java",
74 "src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java",
75 "src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java",
76 "src/com/android/launcher3/dragging/TaplDragTest.java",
77 "src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java",
78 "multivalentTests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
79 "multivalentTests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java",
80 "src/com/android/launcher3/ui/TaplTestsLauncher3Test.java",
81 "src/com/android/launcher3/ui/widget/TaplWidgetPickerTest.java",
82 "src/com/android/launcher3/ui/workspace/TaplWorkspaceTest.java",
83 "multivalentTests/src/com/android/launcher3/util/LauncherLayoutBuilder.java",
84 "multivalentTests/src/com/android/launcher3/util/TestConstants.java",
85 "multivalentTests/src/com/android/launcher3/util/TestUtil.java",
86 "multivalentTests/src/com/android/launcher3/util/Wait.java",
87 "multivalentTests/src/com/android/launcher3/util/WidgetUtils.java",
88 "multivalentTests/src/com/android/launcher3/util/rule/FailureWatcher.java",
89 "multivalentTests/src/com/android/launcher3/util/rule/ViewCaptureRule.kt",
90 "multivalentTests/src/com/android/launcher3/util/rule/SamplerRule.java",
91 "multivalentTests/src/com/android/launcher3/util/rule/ScreenRecordRule.java",
92 "multivalentTests/src/com/android/launcher3/util/rule/ShellCommandRule.java",
93 "multivalentTests/src/com/android/launcher3/util/rule/TestIsolationRule.java",
94 "multivalentTests/src/com/android/launcher3/util/rule/TestStabilityRule.java",
95 "multivalentTests/src/com/android/launcher3/util/viewcapture_analysis/*.java",
96 "multivalentTests/src/com/android/launcher3/testcomponent/BaseTestingActivity.java",
97 "multivalentTests/src/com/android/launcher3/testcomponent/OtherBaseTestingActivity.java",
98 "multivalentTests/src/com/android/launcher3/testcomponent/CustomShortcutConfigActivity.java",
99 "multivalentTests/src/com/android/launcher3/testcomponent/TestCommandReceiver.java",
100 "multivalentTests/src/com/android/launcher3/testcomponent/TestLauncherActivity.java",
101 "multivalentTests/src/com/android/launcher3/testcomponent/ImeTestActivity.java",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700102 ],
103}
104
105// Library with all the dependencies for building quickstep
106android_library {
107 name: "Launcher3TestLib",
Colin Crossf156b6b2024-01-11 14:03:12 -0800108 srcs: [],
Sebastian Francoe7c3d3d2023-01-10 10:47:46 -0600109 asset_dirs: ["assets"],
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700110 resource_dirs: ["res"],
111 static_libs: [
Anushree Ganjamd1a28fe2023-08-23 21:40:57 -0700112 "flag-junit-base",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700113 "launcher-aosp-tapl",
Sunny Goyal177785e2021-07-29 15:48:24 -0700114 "androidx.test.core",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700115 "androidx.test.runner",
116 "androidx.test.rules",
117 "androidx.test.ext.junit",
118 "androidx.test.espresso.core",
119 "androidx.test.espresso.contrib",
120 "androidx.test.espresso.intents",
121 "androidx.test.uiautomator_uiautomator",
Brian Isganitis06139e02023-10-03 16:02:39 -0400122 "mockito-kotlin2",
Anushree Ganjam94efd7a2023-08-24 18:28:19 -0700123 "mockito-target-extended-minus-junit4",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700124 "launcher_log_protos_lite",
Krzysztof KosiƄski6e3b7a62023-10-10 06:50:28 +0000125 "truth",
vadimt13839e42022-02-17 13:56:06 -0800126 "platform-test-rules",
Pat Manningda696612023-02-17 15:06:58 +0000127 "testables",
Anushree Ganjam2a14b972023-08-30 13:31:10 -0700128 "com_android_launcher3_flags_lib",
Jeremy Sim9e44e372023-10-10 14:54:39 -0700129 "com_android_wm_shell_flags_lib",
Willie Koomsonfedc18e2023-11-07 22:31:46 +0000130 "android.appwidget.flags-aconfig-java",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700131 ],
132 manifest: "AndroidManifest-common.xml",
133 platform_apis: true,
Colin Crossf156b6b2024-01-11 14:03:12 -0800134 // TODO(b/319712088): re-enable use_resource_processor
135 use_resource_processor: false,
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700136}
137
My Name5b59e752021-12-15 20:54:45 -0500138android_library {
139 name: "Launcher3TestResources",
140 resource_dirs: ["res"],
Colin Crossf156b6b2024-01-11 14:03:12 -0800141 // TODO(b/319712088): re-enable use_resource_processor
142 use_resource_processor: false,
My Name5b59e752021-12-15 20:54:45 -0500143}
144
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700145android_test {
146 name: "Launcher3Tests",
147 srcs: [
148 ":launcher-tests-src",
Thales Lima9938c2f2022-07-25 14:38:16 +0100149 ":launcher-non-quickstep-tests-src",
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700150 ],
Anushree Ganjamd1a28fe2023-08-23 21:40:57 -0700151 static_libs: [
152 "Launcher3TestLib",
Anushree Ganjam2a14b972023-08-30 13:31:10 -0700153 "com_android_launcher3_flags_lib",
Anushree Ganjamd1a28fe2023-08-23 21:40:57 -0700154 ],
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700155 libs: [
156 "android.test.base",
157 "android.test.runner",
158 "android.test.mock",
159 ],
Anushree Ganjam94efd7a2023-08-24 18:28:19 -0700160 // Libraries used by mockito inline extended
Sunny Goyal4af8cf92021-07-29 15:48:24 -0700161 jni_libs: [
162 "libdexmakerjvmtiagent",
163 "libstaticjvmtiagent",
164 ],
165 use_embedded_native_libs: false,
166 compile_multilib: "both",
167 instrumentation_for: "Launcher3",
168 manifest: "AndroidManifest.xml",
169 platform_apis: true,
170 test_config: "Launcher3Tests.xml",
Vadim Tryshev990a32e2023-03-02 21:51:21 +0000171 data: [":Launcher3"],
172 test_suites: ["general-tests"],
Sunny Goyalf5c42ea2021-03-12 16:00:40 -0800173}
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000174
175// Shared between tests and launcher
176android_library {
177 name: "launcher-testing-shared",
178 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -0800179 "multivalentTests/shared/com/android/launcher3/testing/shared/**/*.java",
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000180 ],
Colin Crossf156b6b2024-01-11 14:03:12 -0800181 resource_dirs: [],
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000182 manifest: "multivalentTests/shared/AndroidManifest.xml",
Nicolo' Mazzucatoe8ee34a2023-01-24 15:41:10 +0000183 sdk_version: "current",
184 min_sdk_version: min_launcher3_sdk_version,
Colin Crossf156b6b2024-01-11 14:03:12 -0800185}
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000186
187filegroup {
188 name: "launcher-testing-helpers",
189 srcs: [
Colin Crossf156b6b2024-01-11 14:03:12 -0800190 "src/**/*.java",
191 "src/**/*.kt",
192 "multivalentTests/src/**/*.java",
193 "multivalentTests/src/**/*.kt",
194 "multivalentTests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
195 "multivalentTests/tapl/com/android/launcher3/tapl/*.java",
196 "multivalentTests/tapl/com/android/launcher3/tapl/*.kt",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000197 ],
198 exclude_srcs: [
199 // Test classes
200 "src/**/*Test.java",
201 "src/**/*Test.kt",
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000202 "multivalentTests/src/**/*Test.java",
203 "multivalentTests/src/**/*Test.kt",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000204 ],
205}
206
207android_library {
208 name: "Launcher3Lib",
209 srcs: [
210 ":launcher-src",
211 ":launcher-src_shortcuts_overrides",
212 ":launcher-src_ui_overrides",
213 ],
214 static_libs: [
215 "Launcher3CommonDepsLib",
216 ],
Colin Crossf156b6b2024-01-11 14:03:12 -0800217 // TODO(b/319712088): re-enable use_resource_processor
218 use_resource_processor: false,
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000219}
220
221android_robolectric_test {
222 enabled: true,
223 name: "Launcher3RoboTests",
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000224 // multivalentTests directory is a shared folder for not only robolectric converted test
225 // classes but also shared helper classes.
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000226 srcs: [
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000227 "multivalentTests/src/com/android/launcher3/util/*.java",
228 "multivalentTests/src/com/android/launcher3/util/*.kt",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000229
230 // Test util classes
231 ":launcher-testing-helpers",
232 ":launcher-testing-shared",
233 ],
234 exclude_srcs: [
Uwais Ashraf77b97c02023-12-27 11:44:16 +0000235 //"src/com/android/launcher3/util/CellContentDimensionsTest.kt", // Failing - b/316553889
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000236
237 // requires modification to work with inline mock maker
238 "src/com/android/launcher3/util/rule/StaticMockitoRule.java",
Uwais Ashraf861f2fd2023-12-19 10:09:25 +0000239 ],
240 java_resource_dirs: ["config"],
241 static_libs: [
242 "flag-junit-base",
243 "com_android_launcher3_flags_lib",
244 "com_android_wm_shell_flags_lib",
245 "androidx.test.uiautomator_uiautomator",
246 "androidx.core_core-animation-testing",
247 "androidx.test.ext.junit",
248 "inline-mockito-robolectric-prebuilt",
249 "platform-parametric-runner-lib",
250 "testables",
251 "Launcher3TestResources",
252 "SystemUISharedLib",
253 "launcher-testing-shared",
254 ],
255 libs: [
256 "android.test.runner",
257 "android.test.base",
258 "android.test.mock",
259 "truth",
260 ],
261 instrumentation_for: "Launcher3",
262 upstream: true,
263}