1 # Copyright 2016 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//testing/test.gni")
9 # One Big Target for services to register their unit test sources. This exists
10 # to avoid having to maintain a separate test binary for every service.
12 # To add tests for a new service, please define a "tests" source_set in the
13 # service subdirectory and add it as a dependency here.
14 test("services_unittests") {
15 use_xvfb = use_xvfb_in_this_config
17 # The tracing unittests require this for testing unwinding. See
18 # stack_unwinder_android_unittest.cc.
19 if (is_android && can_unwind_with_cfi_table && is_official_build) {
20 add_unwind_tables_in_apk = true
23 # If your service does not run on iOS, its tests should go in the !iOS
24 # section below. If you are unsure, contact blundell@chromium.org.
26 "//services/cert_verifier:tests",
27 "//services/cert_verifier/cert_net_url_loader:tests",
28 "//services/metrics/public/cpp:tests",
29 "//services/network:tests",
30 "//services/network/public/cpp:tests",
31 "//services/test:run_all_unittests",
34 data_deps = [ "//testing/buildbot/filters:services_unittests_filters" ]
38 "//services/audio:tests",
39 "//services/data_decoder:tests",
40 "//services/device:tests",
41 "//services/image_annotation:tests",
42 "//services/image_annotation/public/cpp:tests",
43 "//services/media_session:tests",
44 "//services/media_session/public/cpp:tests",
45 "//services/on_device_model:tests",
46 "//services/preferences/tracked:unit_tests",
47 "//services/proxy_resolver:tests",
48 "//services/resource_coordinator:tests",
49 "//services/shape_detection:tests",
50 "//services/tracing:tests",
51 "//services/viz/privileged/mojom:unit_tests",
52 "//services/viz/public/cpp/compositing:tests",
53 "//services/viz/public/cpp/gpu:tests",
54 "//services/viz/public/cpp/hit_test:tests",
55 "//services/webnn:tests",
59 [ "//services/tracing:services_tracing_perfetto_bundle_data" ]
63 if (is_android && (current_cpu == "arm" || current_cpu == "arm64")) {
64 deps += [ "//base:base_profiler_test_support_library" ]
67 if (is_chromeos_ash || is_linux || is_fuchsia) {
68 deps += [ "//services/accessibility:tests" ]
72 deps += [ "//services/proxy_resolver_win:tests" ]
77 "//components/signin/public/android:java",
78 "//services/data_decoder/public/cpp/android:safe_json_java",
79 "//services/device:java",
80 "//services/media_session/public/cpp/android:media_session_java",
81 "//services/tracing:tracing_test_helper_java",
83 # Some tests make network requests.
84 "//net/android:net_java",
86 # Some tests need to initialize V8.
87 "//gin:v8_snapshot_assets",
91 if (!is_android && !is_ios) {
92 # NOTE: We do not currently support standalone service binaries on Android
93 # or iOS, so any tests which use the ServiceTest framework to connect to
94 # standalone services must be added here.
95 deps += [ "//services/video_capture:tests" ]
99 additional_manifest_fragments = [
100 "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
101 "//build/config/fuchsia/test/network.shard.test-cml",
107 test("services_perftests") {
109 "//services/device:perftests",
110 "//services/test:run_all_unittests",
111 "//services/viz/public/cpp/compositing:perftests",
117 robolectric_binary("services_junit_tests") {
119 "device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java",
120 "device/geolocation/android/junit/src/org/chromium/device/geolocation/LocationProviderTest.java",
121 "device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java",
122 "device/nfc/android/junit/src/org/chromium/device/nfc/NfcBlocklistTest.java",
123 "shape_detection/android/junit/src/org/chromium/shape_detection/BitmapUtilsTest.java",
126 "$google_play_services_package:google_play_services_base_java",
127 "$google_play_services_package:google_play_services_basement_java",
128 "$google_play_services_package:google_play_services_location_java",
129 "$google_play_services_package:google_play_services_vision_common_java",
130 "$google_play_services_package:google_play_services_vision_java",
132 "//base:base_java_test_support",
133 "//base:base_junit_test_support",
134 "//mojo/public/java:base_java",
135 "//mojo/public/java:bindings_java",
136 "//mojo/public/java:system_java",
137 "//mojo/public/mojom/base:base_java",
138 "//services/device/generic_sensor:java",
139 "//services/device/geolocation:geolocation_java",
140 "//services/device/nfc/android:java",
141 "//services/device/public/java:device_feature_list_java",
142 "//services/device/public/java:geolocation_java_test_support",
143 "//services/device/public/java:nfc_java",
144 "//services/device/public/mojom:generic_sensor_java",
145 "//services/device/public/mojom:mojom_java",
146 "//services/shape_detection:shape_detection_java",
147 "//skia/public/mojom:mojom_java",
151 android_library("services_javatests") {
154 "shape_detection/android/javatests/src/org/chromium/shape_detection/BarcodeDetectionImplTest.java",
155 "shape_detection/android/javatests/src/org/chromium/shape_detection/FaceDetectionImplTest.java",
156 "shape_detection/android/javatests/src/org/chromium/shape_detection/TestUtils.java",
157 "shape_detection/android/javatests/src/org/chromium/shape_detection/TextDetectionImplTest.java",
160 "$google_play_services_package:google_play_services_base_java",
161 "$google_play_services_package:google_play_services_basement_java",
162 "$google_play_services_package:google_play_services_vision_common_java",
163 "$google_play_services_package:google_play_services_vision_java",
165 "//base:base_java_test_support",
166 "//mojo/public/java:base_java",
167 "//mojo/public/java:bindings_java",
168 "//mojo/public/mojom/base:base_java",
169 "//services/shape_detection:shape_detection_java",
170 "//services/shape_detection/public/mojom:mojom_java",
171 "//skia/public/mojom:mojom_java",
172 "//third_party/android_deps:chromium_play_services_availability_java",
173 "//third_party/androidx:androidx_test_runner_java",
174 "//third_party/hamcrest:hamcrest_java",
175 "//third_party/hamcrest:hamcrest_library_java",
176 "//third_party/junit",
177 "//ui/gfx/geometry/mojom:mojom_java",
179 data = [ "test/data/" ]