Upload upstream chromium 108.0.5359.1
[platform/framework/web/chromium-efl.git] / services / BUILD.gn
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.
4
5 import("//build/config/ui.gni")
6 import("//testing/test.gni")
7 import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
8
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.
11 #
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
16
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
21   }
22
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.
25   deps = [
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",
32   ]
33
34   data_deps = [ "//testing/buildbot/filters:services_unittests_filters" ]
35
36   if (!is_ios) {
37     deps += [
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/proxy_resolver:tests",
46       "//services/resource_coordinator:tests",
47       "//services/shape_detection:tests",
48       "//services/tracing:tests",
49       "//services/viz/privileged/mojom:unit_tests",
50       "//services/viz/public/cpp/compositing:tests",
51       "//services/viz/public/cpp/gpu:tests",
52       "//services/viz/public/cpp/hit_test:tests",
53     ]
54   }
55
56   if (is_chromeos_ash || is_linux) {
57     deps += [ "//services/accessibility:tests" ]
58   }
59
60   if (is_win) {
61     deps += [ "//services/proxy_resolver_win:tests" ]
62   }
63
64   if (is_android) {
65     deps += [
66       "//components/signin/public/android:java",
67       "//services/data_decoder/public/cpp/android:safe_json_java",
68       "//services/device:java",
69       "//services/media_session/public/cpp/android:media_session_java",
70       "//services/tracing:tracing_test_helper_java",
71
72       # Some tests make network requests.
73       "//net/android:net_java",
74     ]
75
76     # Some tests need to initialize V8.
77     if (use_v8_context_snapshot) {
78       deps += [ "//tools/v8_context_snapshot:v8_context_snapshot_assets" ]
79     } else {
80       deps += [ "//v8:v8_external_startup_data_assets" ]
81     }
82   }
83
84   if (!is_android && !is_ios) {
85     # NOTE: We do not currently support standalone service binaries on Android
86     # or iOS, so any tests which use the ServiceTest framework to connect to
87     # standalone services must be added here.
88     deps += [ "//services/video_capture:tests" ]
89   }
90
91   if (is_fuchsia) {
92     test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
93
94     additional_manifest_fragments = [
95       "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
96       "//build/config/fuchsia/test/network.shard.test-cml",
97     ]
98   }
99 }
100
101 if (!is_ios) {
102   test("services_perftests") {
103     deps = [
104       "//services/device:perftests",
105       "//services/test:run_all_unittests",
106       "//services/viz/public/cpp/compositing:perftests",
107     ]
108   }
109 }
110
111 if (is_android) {
112   robolectric_binary("services_junit_tests") {
113     sources = [
114       "device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java",
115       "device/geolocation/android/junit/src/org/chromium/device/geolocation/LocationProviderTest.java",
116       "device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java",
117       "device/nfc/android/junit/src/org/chromium/device/nfc/NfcBlocklistTest.java",
118       "shape_detection/android/junit/src/org/chromium/shape_detection/BitmapUtilsTest.java",
119     ]
120     deps = [
121       "$google_play_services_package:google_play_services_base_java",
122       "$google_play_services_package:google_play_services_basement_java",
123       "$google_play_services_package:google_play_services_location_java",
124       "$google_play_services_package:google_play_services_vision_common_java",
125       "$google_play_services_package:google_play_services_vision_java",
126       "//base:base_java",
127       "//base:base_java_test_support",
128       "//base:base_junit_test_support",
129       "//mojo/public/java:base_java",
130       "//mojo/public/java:bindings_java",
131       "//mojo/public/java:system_java",
132       "//services/device/generic_sensor:java",
133       "//services/device/geolocation:geolocation_java",
134       "//services/device/nfc/android:java",
135       "//services/device/public/java:geolocation_java_test_support",
136       "//services/device/public/java:nfc_java",
137       "//services/device/public/mojom:generic_sensor_java",
138       "//services/device/public/mojom:mojom_java",
139       "//services/shape_detection:shape_detection_java",
140       "//skia/public/mojom:mojom_java",
141     ]
142   }
143
144   android_library("services_javatests") {
145     testonly = true
146     sources = [
147       "shape_detection/android/javatests/src/org/chromium/shape_detection/BarcodeDetectionImplTest.java",
148       "shape_detection/android/javatests/src/org/chromium/shape_detection/FaceDetectionImplTest.java",
149       "shape_detection/android/javatests/src/org/chromium/shape_detection/TestUtils.java",
150       "shape_detection/android/javatests/src/org/chromium/shape_detection/TextDetectionImplTest.java",
151     ]
152     deps = [
153       "$google_play_services_package:google_play_services_base_java",
154       "$google_play_services_package:google_play_services_basement_java",
155       "$google_play_services_package:google_play_services_vision_common_java",
156       "$google_play_services_package:google_play_services_vision_java",
157       "//base:base_java",
158       "//base:base_java_test_support",
159       "//mojo/public/java:base_java",
160       "//mojo/public/java:bindings_java",
161       "//mojo/public/mojom/base:base_java",
162       "//services/shape_detection:shape_detection_java",
163       "//services/shape_detection/public/mojom:mojom_java",
164       "//skia/public/mojom:mojom_java",
165       "//third_party/android_deps:chromium_play_services_availability_java",
166       "//third_party/android_support_test_runner:runner_java",
167       "//third_party/androidx:androidx_test_monitor_java",
168       "//third_party/androidx:androidx_test_runner_java",
169       "//third_party/hamcrest:hamcrest_library_java",
170       "//third_party/junit",
171       "//ui/gfx/geometry/mojom:mojom_java",
172     ]
173     data = [ "test/data/" ]
174   }
175 }