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/open_from_clipboard",
72 "//components/os_crypt",
73 "//components/packed_ct_ev_whitelist",
74 "//components/pairing",
75 "//components/password_manager/content/browser",
76 "//components/password_manager/core/browser",
77 "//components/password_manager/core/common",
78 "//components/pdf/browser",
79 "//components/pdf/common",
80 "//components/pdf/renderer",
81 "//components/plugins/common",
82 "//components/plugins/renderer",
83 "//components/policy",
85 "//components/precache/core",
86 "//components/precache/content",
87 "//components/proxy_config",
88 "//components/pref_registry",
89 "//components/query_parser",
90 "//components/rappor",
91 "//components/renderer_context_menu",
92 "//components/resources:components_resources",
93 "//components/search",
94 "//components/search_engines",
95 "//components/search_provider_logos",
96 "//components/security_interstitials/core",
97 "//components/sessions",
98 "//components/signin/core/browser",
99 "//components/startup_metric_utils",
100 "//components/strings",
101 "//components/sync_driver",
102 "//components/tracing",
103 "//components/tracing:startup_tracing",
104 "//components/translate/content/browser",
105 "//components/translate/content/common",
106 "//components/translate/content/renderer",
107 "//components/translate/core/browser",
108 "//components/translate/core/common",
109 "//components/ui/zoom:ui_zoom",
111 "//components/update_client",
112 "//components/upload_list",
113 "//components/url_formatter",
114 "//components/url_matcher",
115 "//components/user_manager",
116 "//components/user_prefs",
117 "//components/user_prefs/tracked:user_prefs_tracked",
118 "//components/variations",
119 "//components/version_info",
120 "//components/visitedlink/browser",
121 "//components/visitedlink/common",
122 "//components/visitedlink/renderer",
123 "//components/wallpaper",
124 "//components/web_cache/browser",
125 "//components/web_cache/common",
126 "//components/web_cache/renderer",
127 "//components/web_modal",
128 "//components/web_resource",
129 "//components/webcrypto",
130 "//components/webdata/common",
132 "//components/wifi_sync",
136 # TODO(agrieve): Add to main deps list once compile errors are resolved.
137 deps += [ "//components/devtools_service" ]
140 if (!is_android && !is_ios) {
142 "//components/proximity_auth",
143 "//components/proximity_auth/cryptauth",
147 if (!enable_configuration_policy) {
148 deps -= [ "//components/policy" ]
151 if (!is_win && !is_mac) {
152 deps -= [ "//components/wifi" ]
156 "//components/pairing",
157 "//components/wifi_sync",
161 if (!is_chromeos || !enable_extensions) {
162 deps -= [ "//components/chrome_apps" ]
167 "//components/history/content/browser",
168 "//components/keyed_service/content",
172 if (!enable_plugins) {
174 "//components/pdf/browser",
175 "//components/pdf/common",
176 "//components/pdf/renderer",
182 "//components/autofill/content/browser", # Blocked on content/blink.
183 "//components/autofill/content/common", # Blocked on content.
184 "//components/autofill/content/renderer", # Blocked on content/blink.
185 "//components/crash/app", # Should work, needs checking.
186 "//components/crash/browser", # Should work, needs checking.
187 "//components/captive_portal", # Should work, needs checking.
188 "//components/cloud_devices/common", # Should work, needs checking.
189 "//components/cdm/browser", # Blocked on content.
190 "//components/cdm/common", # Blocked on content.
191 "//components/cdm/renderer", # Blocked on content.
192 "//components/data_reduction_proxy/core/browser", # Should work, needs checking.
193 "//components/data_reduction_proxy/core/common", # Should work, needs checking.
194 "//components/dom_distiller/core", # Blocked on content.
195 "//components/domain_reliability", # Blocked on content.
196 "//components/favicon/core", # Blocked on keyed service.
197 "//components/favicon_base", # Should work, needs checking.
198 "//components/feedback", # Blocked on content.
199 "//components/google/core/browser", # Should work, needs checking.
200 "//components/history/core/browser", # Should work, needs checking.
201 "//components/history/core/common", # Should work, needs checking.
202 "//components/history/core/test", # Should work, needs checking.
203 "//components/infobars/core", # Should work, needs checking.
204 "//components/invalidation/impl", # Should work, needs checking.
205 "//components/json_schema", # Should work, needs checking.
206 "//components/keyed_service/content", # Blocked on content.
207 "//components/navigation_interception", # Blocked on content.
208 "//components/omnibox/browser", # Should work, needs checking.
209 "//components/password_manager/content/browser", # Blocked on content.
210 "//components/password_manager/core/browser", # Should work, needs checking.
211 "//components/password_manager/core/common", # Should work, needs checking.
212 "//components/plugins/renderer", # Blocked on blink.
213 "//components/power", # Blocked on content.
214 "//components/policy", # Blocked on content (indirectly via autofill).
215 "//components/precache/content", # Blocked on content.
216 "//components/precache/core", # Should work, needs checking.
217 "//components/rappor", # Should work, needs checking.
218 "//components/renderer_context_menu", # Blocked on content.
219 "//components/search_engines", # Should work, needs checking.
220 "//components/search_provider_logos", # Should work, needs checking.
221 "//components/sessions", # Blocked on content.
222 "//components/signin/core/browser", # Should work, needs checking.
223 "//components/translate/content/browser", # Blocked on content.
224 "//components/translate/content/common", # Blocked on content.
225 "//components/translate/content/renderer", # Blocked on content.
226 "//components/user_prefs", # Blocked on content.
227 "//components/visitedlink/browser", # Blocked on content.
228 "//components/visitedlink/common", # Blocked on content.
229 "//components/visitedlink/renderer", # Blocked on blink
230 "//components/web_cache/browser", # Blocked on content and blink.
231 "//components/web_cache/renderer", # Blocked on content and blink.
232 "//components/web_modal", # Blocked on content.
236 if (!is_ios && !is_android) {
238 "//components/copresence",
239 "//components/storage_monitor",
245 "//components/app_modal",
246 "//components/browsing_data",
247 "//components/guest_view/browser",
248 "//components/guest_view/common",
249 "//components/guest_view/renderer",
250 "//components/safe_json",
251 "//components/scheduler",
252 "//components/test_runner",
257 deps += [ "//components/constrained_window" ]
261 # TODO(GYP): Delete this after we've converted everything to GN.
262 # The _run targets exist only for compatibility w/ GYP.
263 group("components_unittests_run") {
266 ":components_unittests",
270 # To add a unit test to this target, make a "unit_test" source_set in your
271 # component (it's important to use a source_set instead of a static library or
272 # no tests will run) and add a reference here. You can add more than one unit
273 # test target if convenient.
274 test("components_unittests") {
276 "test/run_all_unittests.cc",
279 if (is_android || is_linux || is_mac || is_win) {
283 # TODO(dpranke): Remove the next two lines after GN has rolled to 339778.
284 "$root_out_dir/components_tests_resources.pak",
285 "$root_out_dir/ui_test.pak",
289 # Add only ":unit_tests" dependencies here. If your tests have dependencies
290 # (this would at least include the component itself), they should be on the
291 # test source set and not here.
293 "//components/auto_login_parser:unit_tests",
294 "//components/autofill/content/browser:unit_tests",
295 "//components/autofill/core/browser:unit_tests",
296 "//components/autofill/core/common:unit_tests",
297 "//components/bookmarks/browser:unit_tests",
298 "//components/bookmarks/managed:unit_tests",
299 "//components/captive_portal:unit_tests",
300 "//components/cloud_devices/common:unit_tests",
301 "//components/component_updater:unit_tests",
302 "//components/content_settings/core/browser:unit_tests",
303 "//components/content_settings/core/common:unit_tests",
304 "//components/crx_file:unit_tests",
305 "//components/data_reduction_proxy/content/browser:unit_tests",
306 "//components/data_reduction_proxy/core/browser:unit_tests",
307 "//components/data_reduction_proxy/core/common:unit_tests",
308 "//components/device_event_log:unit_tests",
309 "//components/devtools_http_handler:unit_tests",
310 "//components/dom_distiller/core:unit_tests",
311 "//components/domain_reliability:unit_tests",
312 "//components/favicon_base:unit_tests",
313 "//components/gcm_driver/crypto:unit_tests",
314 "//components/gcm_driver/instance_id:unit_tests",
315 "//components/gcm_driver:unit_tests",
316 "//components/google/core/browser:unit_tests",
317 "//components/invalidation/impl:unittests",
318 "//components/login:unit_tests",
319 "//components/metrics:unit_tests",
320 "//components/mime_util:unit_tests",
321 "//components/offline_pages:unit_tests",
322 "//components/omnibox/browser:unit_tests",
323 "//components/open_from_clipboard:unit_tests",
324 "//components/packed_ct_ev_whitelist:unit_tests",
325 "//components/sync_driver:unit_tests",
326 "//components/undo:unit_tests",
327 "//components/url_formatter:unit_tests",
328 "//components/update_client:unit_tests",
329 "//components/upload_list:unit_tests",
330 "//components/user_prefs/tracked:unit_tests",
331 "//components/variations:unit_tests",
332 "//components/web_resource:unit_tests",
333 "//components/webcrypto:unit_tests",
334 "//components/webdata/common:unit_tests",
336 # These are the deps required by the code in this target.
338 "//base/test:test_support",
339 "//components/policy:policy_component",
340 "//content/test:test_support",
343 "//ui/resources:ui_test_pak",
347 ":components_tests_pak",
348 "//third_party/mesa:osmesa",
349 "//ui/resources:ui_test_pak",
352 if (enable_rlz_support) {
353 deps += [ "//components/rlz:unit_tests" ]
357 isolate_file = "components_unittests.isolate"
359 deps += [ "//content/public/android:content_java" ]
361 "//components/gcm_driver:unit_tests",
362 "//components/gcm_driver/instance_id:unit_tests",
366 if (!is_android && !is_ios) {
367 deps += [ "//components/proximity_auth:unit_tests" ]
371 deps += [ "//components/ownership:unit_tests" ]
374 # TODO(GYP) need this target.
375 #'breakpad/app/crash_keys_win_unittest.cc',
377 # Precache tests need these defines.
378 #configs += [ "//components/precache/core:precache_config" ]
381 # TODO(GYP) enable this as above.
382 #deps += [ "//components/constrained_window:unit_tests" ]
385 deps += [ "//components/browser_watcher:unit_tests" ]
388 deps -= [ "//components/devtools_http_handler:unit_tests" ]
393 "//components/safe_json:unit_tests",
394 "//components/scheduler:unit_tests",
399 repack("components_tests_pak") {
401 "$root_gen_dir/components/components_resources.pak",
402 "$root_gen_dir/components/strings/components_strings_en-US.pak",
405 output = "$root_out_dir/components_tests_resources.pak"
408 "//components/resources",
409 "//components/strings",
413 # TODO(GYP): Delete this after we've converted everything to GN.
414 # The _run targets exist only for compatibility w/ GYP.
415 group("components_browsertests_run") {
418 ":components_browsertests",
422 test("components_browsertests") {
424 "autofill/content/browser/risk/fingerprint_browsertest.cc",
425 "autofill/content/renderer/password_form_conversion_utils_browsertest.cc",
426 "dom_distiller/content/browser/distillable_page_utils_browsertest.cc",
427 "dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc",
428 "password_manager/content/renderer/credential_manager_client_browsertest.cc",
432 "$root_out_dir/components_tests_resources.pak",
433 "$root_out_dir/content_shell.pak",
436 if (is_android || is_linux || is_mac || is_win) {
439 "dom_distiller/core/javascript/",
440 "//third_party/dom_distiller_js/dist/test/data/",
445 data += [ "$root_out_dir/Content Shell.app/" ]
448 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
451 "autofill/content/browser",
452 "autofill/content/renderer",
453 "content_settings/core/common",
454 "dom_distiller/content:content_browser",
455 "dom_distiller/core",
456 "dom_distiller/core:test_support",
457 "password_manager/content/browser",
458 "password_manager/content/common",
459 "password_manager/content/renderer",
462 "//base/test:test_support",
463 "//content/test:browsertest_support",
464 "//content/test:test_support",
465 "//device/bluetooth",
472 ":components_tests_pak",
473 "//third_party/mesa:osmesa",
477 sources += [ "test/android/browsertests_apk/components_browser_tests_jni_onload.cc" ]
478 sources -= [ "autofill/content/browser/risk/fingerprint_browsertest.cc" ]
479 deps += [ "//testing/android/native_test:native_test_support" ]
481 isolate_file = "components_browsertests.isolate"
485 # content_extractor_browsertest is a standalone content extraction tool built as
486 # a MANUAL component_browsertest.
487 sources += [ "dom_distiller/standalone/content_extractor_browsertest.cc" ]
489 "pref_registry:test_support",
490 "//base:prefs_test_support",
495 test("components_perftests") {
497 "scheduler/child/task_queue_manager_perftest.cc",
498 "visitedlink/test/visitedlink_perftest.cc",
501 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
502 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
506 "//base/test:test_support_perf",
509 "//content/test:test_support",
510 "//components/visitedlink/browser",