1 # Copyright 2014 The Chromium Authors. All rights reserved.
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")
8 import("//tools/grit/repack.gni")
10 # Collection of all components. You wouldn't link to this, but this is rather
11 # to reference the files so they can be compiled by the build system.
12 group("all_components") {
13 testonly = true # You shouldn't actually link to this.
14 visibility = [ "//:*" ] # Only for the root targets to bring in.
17 "//components/auto_login_parser",
18 "//components/autofill/content/browser",
19 "//components/autofill/content/common",
20 "//components/autofill/content/renderer",
21 "//components/bookmarks/browser",
22 "//components/bookmarks/common",
23 "//components/bookmarks/managed",
24 "//components/bookmarks/test",
25 "//components/captive_portal",
26 "//components/cdm/browser",
27 "//components/cdm/common",
28 "//components/cdm/renderer",
29 "//components/cloud_devices/common",
30 "//components/chrome_apps",
31 "//components/component_updater",
32 "//components/content_settings/core/browser",
33 "//components/content_settings/core/common",
34 "//components/crash/app",
35 "//components/crash/browser",
36 "//components/crx_file",
37 "//components/data_reduction_proxy/core/browser",
38 "//components/data_reduction_proxy/core/common",
39 "//components/device_event_log",
40 "//components/devtools_discovery",
41 "//components/devtools_http_handler",
42 "//components/dom_distiller/core",
43 "//components/domain_reliability",
44 "//components/enhanced_bookmarks",
45 "//components/favicon/core",
46 "//components/favicon_base",
47 "//components/feedback",
48 "//components/gcm_driver",
49 "//components/gcm_driver/crypto",
50 "//components/gcm_driver/instance_id",
51 "//components/google/core/browser",
52 "//components/history/content/browser",
53 "//components/history/core/browser",
54 "//components/history/core/common",
55 "//components/history/core/test",
56 "//components/infobars/core",
57 "//components/invalidation/impl",
58 "//components/json_schema",
59 "//components/keyed_service/content",
60 "//components/language_usage_metrics",
61 "//components/leveldb_proto",
63 "//components/metrics",
64 "//components/mime_util",
65 "//components/navigation_interception",
66 "//components/navigation_metrics",
67 "//components/network_time",
68 "//components/offline_pages",
69 "//components/omnibox/browser",
71 "//components/os_crypt",
72 "//components/packed_ct_ev_whitelist",
73 "//components/pairing",
74 "//components/password_manager/content/browser",
75 "//components/password_manager/core/browser",
76 "//components/password_manager/core/common",
77 "//components/pdf/browser",
78 "//components/pdf/common",
79 "//components/pdf/renderer",
80 "//components/plugins/common",
81 "//components/plugins/renderer",
82 "//components/policy",
84 "//components/precache/core",
85 "//components/precache/content",
86 "//components/proxy_config",
87 "//components/pref_registry",
88 "//components/query_parser",
89 "//components/rappor",
90 "//components/renderer_context_menu",
91 "//components/resources:components_resources",
92 "//components/search",
93 "//components/search_engines",
94 "//components/search_provider_logos",
95 "//components/secure_display",
96 "//components/sessions",
97 "//components/signin/core/browser",
98 "//components/startup_metric_utils",
99 "//components/strings",
100 "//components/sync_driver",
101 "//components/tracing",
102 "//components/tracing:startup_tracing",
103 "//components/translate/content/browser",
104 "//components/translate/content/common",
105 "//components/translate/content/renderer",
106 "//components/translate/core/browser",
107 "//components/translate/core/common",
108 "//components/ui/zoom:ui_zoom",
110 "//components/update_client",
111 "//components/url_fixer",
112 "//components/url_matcher",
113 "//components/user_manager",
114 "//components/user_prefs",
115 "//components/variations",
116 "//components/visitedlink/browser",
117 "//components/visitedlink/common",
118 "//components/visitedlink/renderer",
119 "//components/wallpaper",
120 "//components/web_cache/browser",
121 "//components/web_cache/common",
122 "//components/web_cache/renderer",
123 "//components/web_modal",
124 "//components/web_resource",
125 "//components/webcrypto",
126 "//components/webdata/common",
128 "//components/wifi_sync",
132 # TODO(agrieve): Add to main deps list once compile errors are resolved.
133 deps += [ "//components/devtools_service" ]
136 if (!is_android && !is_ios) {
138 "//components/proximity_auth",
139 "//components/proximity_auth/cryptauth",
143 if (!enable_configuration_policy) {
144 deps -= [ "//components/policy" ]
147 if (!is_win && !is_mac) {
148 deps -= [ "//components/wifi" ]
152 "//components/pairing",
153 "//components/wifi_sync",
157 if (!is_chromeos || !enable_extensions) {
158 deps -= [ "//components/chrome_apps" ]
163 "//components/history/content/browser",
164 "//components/keyed_service/content",
168 if (!enable_plugins) {
170 "//components/pdf/browser",
171 "//components/pdf/common",
172 "//components/pdf/renderer",
178 "//components/autofill/content/browser", # Blocked on content/blink.
179 "//components/autofill/content/common", # Blocked on content.
180 "//components/autofill/content/renderer", # Blocked on content/blink.
181 "//components/crash/app", # Should work, needs checking.
182 "//components/crash/browser", # Should work, needs checking.
183 "//components/captive_portal", # Should work, needs checking.
184 "//components/cloud_devices/common", # Should work, needs checking.
185 "//components/cdm/browser", # Blocked on content.
186 "//components/cdm/common", # Blocked on content.
187 "//components/cdm/renderer", # Blocked on content.
188 "//components/data_reduction_proxy/core/browser", # Should work, needs checking.
189 "//components/data_reduction_proxy/core/common", # Should work, needs checking.
190 "//components/dom_distiller/core", # Blocked on content.
191 "//components/domain_reliability", # Blocked on content.
192 "//components/favicon/core", # Blocked on keyed service.
193 "//components/favicon_base", # Should work, needs checking.
194 "//components/feedback", # Blocked on content.
195 "//components/google/core/browser", # Should work, needs checking.
196 "//components/history/core/browser", # Should work, needs checking.
197 "//components/history/core/common", # Should work, needs checking.
198 "//components/history/core/test", # Should work, needs checking.
199 "//components/infobars/core", # Should work, needs checking.
200 "//components/invalidation/impl", # Should work, needs checking.
201 "//components/json_schema", # Should work, needs checking.
202 "//components/keyed_service/content", # Blocked on content.
203 "//components/navigation_interception", # Blocked on content.
204 "//components/omnibox/browser", # Should work, needs checking.
205 "//components/password_manager/content/browser", # Blocked on content.
206 "//components/password_manager/core/browser", # Should work, needs checking.
207 "//components/password_manager/core/common", # Should work, needs checking.
208 "//components/plugins/renderer", # Blocked on blink.
209 "//components/power", # Blocked on content.
210 "//components/policy", # Blocked on content (indirectly via autofill).
211 "//components/precache/content", # Blocked on content.
212 "//components/precache/core", # Should work, needs checking.
213 "//components/rappor", # Should work, needs checking.
214 "//components/renderer_context_menu", # Blocked on content.
215 "//components/search_engines", # Should work, needs checking.
216 "//components/search_provider_logos", # Should work, needs checking.
217 "//components/sessions", # Blocked on content.
218 "//components/signin/core/browser", # Should work, needs checking.
219 "//components/translate/content/browser", # Blocked on content.
220 "//components/translate/content/common", # Blocked on content.
221 "//components/translate/content/renderer", # Blocked on content.
222 "//components/user_prefs", # Blocked on content.
223 "//components/visitedlink/browser", # Blocked on content.
224 "//components/visitedlink/common", # Blocked on content.
225 "//components/visitedlink/renderer", # Blocked on blink
226 "//components/web_cache/browser", # Blocked on content and blink.
227 "//components/web_cache/renderer", # Blocked on content and blink.
228 "//components/web_modal", # Blocked on content.
232 if (!is_ios && !is_android) {
234 "//components/copresence",
235 "//components/storage_monitor",
241 "//components/app_modal",
242 "//components/browsing_data",
243 "//components/guest_view/browser",
244 "//components/guest_view/common",
245 "//components/guest_view/renderer",
246 "//components/safe_json",
247 "//components/scheduler",
248 "//components/test_runner",
253 deps += [ "//components/constrained_window" ]
257 # TODO(GYP): Delete this after we've converted everything to GN.
258 # The _run targets exist only for compatibility w/ GYP.
259 group("components_unittests_run") {
262 ":components_unittests",
266 # To add a unit test to this target, make a "unit_test" source_set in your
267 # component (it's important to use a source_set instead of a static library or
268 # no tests will run) and add a reference here. You can add more than one unit
269 # test target if convenient.
270 test("components_unittests") {
272 "test/run_all_unittests.cc",
275 if (is_android || is_linux || is_mac || is_win) {
279 # TODO(dpranke): Remove the next two lines after GN has rolled to 339778.
280 "$root_out_dir/components_tests_resources.pak",
281 "$root_out_dir/ui_test.pak",
285 # Add only ":unit_tests" dependencies here. If your tests have dependencies
286 # (this would at least include the component itself), they should be on the
287 # test source set and not here.
289 "//components/auto_login_parser:unit_tests",
290 "//components/autofill/content/browser:unit_tests",
291 "//components/autofill/core/browser:unit_tests",
292 "//components/autofill/core/common:unit_tests",
293 "//components/bookmarks/browser:unit_tests",
294 "//components/bookmarks/managed:unit_tests",
295 "//components/captive_portal:unit_tests",
296 "//components/cloud_devices/common:unit_tests",
297 "//components/component_updater:unit_tests",
298 "//components/content_settings/core/browser:unit_tests",
299 "//components/content_settings/core/common:unit_tests",
300 "//components/crx_file:unit_tests",
301 "//components/data_reduction_proxy/content/browser:unit_tests",
302 "//components/data_reduction_proxy/core/browser:unit_tests",
303 "//components/data_reduction_proxy/core/common:unit_tests",
304 "//components/device_event_log:unit_tests",
305 "//components/devtools_http_handler:unit_tests",
306 "//components/dom_distiller/core:unit_tests",
307 "//components/domain_reliability:unit_tests",
308 "//components/favicon_base:unit_tests",
309 "//components/gcm_driver:unit_tests",
310 "//components/gcm_driver/crypto:unit_tests",
311 "//components/gcm_driver/instance_id:unit_tests",
312 "//components/google/core/browser:unit_tests",
313 "//components/invalidation/impl:unittests",
314 "//components/login:unit_tests",
315 "//components/metrics:unit_tests",
316 "//components/mime_util:unit_tests",
317 "//components/offline_pages:unit_tests",
318 "//components/omnibox/browser:unit_tests",
319 "//components/packed_ct_ev_whitelist:unit_tests",
320 "//components/undo:unit_tests",
321 "//components/secure_display:unit_tests",
322 "//components/update_client:unit_tests",
323 "//components/variations:unit_tests",
324 "//components/webcrypto:unit_tests",
325 "//components/web_resource:unit_tests",
326 "//components/webdata/common:unit_tests",
328 # These are the deps required by the code in this target.
330 "//base/test:test_support",
331 "//content/test:test_support",
334 "//ui/resources:ui_test_pak",
338 ":components_tests_pak",
339 "//third_party/mesa:osmesa",
340 "//ui/resources:ui_test_pak",
343 if (enable_rlz_support) {
344 deps += [ "//components/rlz:unit_tests" ]
348 isolate_file = "components_unittests.isolate"
350 deps += [ "//content/public/android:content_java" ]
352 "//components/gcm_driver:unit_tests",
353 "//components/gcm_driver/instance_id:unit_tests",
357 if (!is_android && !is_ios) {
358 deps += [ "//components/proximity_auth:unit_tests" ]
362 deps += [ "//components/ownership:unit_tests" ]
365 # TODO(GYP) need this target.
366 #'breakpad/app/crash_keys_win_unittest.cc',
368 # Precache tests need these defines.
369 #configs += [ "//components/precache/core:precache_config" ]
372 # TODO(GYP) enable this as above.
373 #deps += [ "//components/constrained_window:unit_tests" ]
376 deps += [ "//components/browser_watcher:unit_tests" ]
379 deps -= [ "//components/devtools_http_handler:unit_tests" ]
384 "//components/safe_json:unit_tests",
385 "//components/scheduler:unit_tests",
390 repack("components_tests_pak") {
392 "$root_gen_dir/components/components_resources.pak",
393 "$root_gen_dir/components/strings/components_strings_en-US.pak",
396 output = "$root_out_dir/components_tests_resources.pak"
399 "//components/resources",
400 "//components/strings",
404 # TODO(GYP): Delete this after we've converted everything to GN.
405 # The _run targets exist only for compatibility w/ GYP.
406 group("components_browsertests_run") {
409 ":components_browsertests",
413 test("components_browsertests") {
415 "autofill/content/browser/risk/fingerprint_browsertest.cc",
416 "autofill/content/renderer/password_form_conversion_utils_browsertest.cc",
417 "dom_distiller/content/browser/distillable_page_utils_browsertest.cc",
418 "dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc",
419 "password_manager/content/renderer/credential_manager_client_browsertest.cc",
423 "$root_out_dir/components_tests_resources.pak",
424 "$root_out_dir/content_shell.pak",
427 if (is_android || is_linux || is_mac || is_win) {
430 "dom_distiller/core/javascript/",
431 "//third_party/dom_distiller_js/dist/test/data/",
436 data += [ "$root_out_dir/Content Shell.app/" ]
439 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
442 "autofill/content/browser",
443 "autofill/content/renderer",
444 "content_settings/core/common",
445 "dom_distiller/content:content_browser",
446 "dom_distiller/core",
447 "dom_distiller/core:test_support",
448 "password_manager/content/browser",
449 "password_manager/content/common",
450 "password_manager/content/renderer",
453 "//base/test:test_support",
454 "//content/test:browsertest_support",
455 "//content/test:test_support",
456 "//device/bluetooth",
463 ":components_tests_pak",
464 "//third_party/mesa:osmesa",
468 sources += [ "test/android/browsertests_apk/components_browser_tests_jni_onload.cc" ]
469 sources -= [ "autofill/content/browser/risk/fingerprint_browsertest.cc" ]
470 deps += [ "//testing/android/native_test:native_test_support" ]
472 isolate_file = "components_browsertests.isolate"
476 # content_extractor_browsertest is a standalone content extraction tool built as
477 # a MANUAL component_browsertest.
478 sources += [ "dom_distiller/standalone/content_extractor_browsertest.cc" ]
480 "pref_registry:test_support",
481 "//base:prefs_test_support",
486 test("components_perftests") {
488 "scheduler/child/task_queue_manager_perftest.cc",
489 "visitedlink/test/visitedlink_perftest.cc",
492 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
493 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
497 "//base/test:test_support_perf",
500 "//content/test:test_support",
501 "//components/visitedlink/browser",