Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / components / BUILD.gn
blob4964c3155f2260b764e2082f90ada4e77f5b6577
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.
16   deps = [
17     "//components/about_handler",
18     "//components/auto_login_parser",
19     "//components/autofill/content/browser",
20     "//components/autofill/content/common",
21     "//components/autofill/content/renderer",
22     "//components/bookmarks/browser",
23     "//components/bookmarks/common",
24     "//components/bookmarks/managed",
25     "//components/bookmarks/test",
26     "//components/captive_portal",
27     "//components/cdm/browser",
28     "//components/cdm/common",
29     "//components/cdm/renderer",
30     "//components/cloud_devices/common",
31     "//components/chrome_apps",
32     "//components/component_updater",
33     "//components/compression",
34     "//components/content_settings/core/browser",
35     "//components/content_settings/core/common",
36     "//components/crash/app",
37     "//components/crash/browser",
38     "//components/crx_file",
39     "//components/data_reduction_proxy/core/browser",
40     "//components/data_reduction_proxy/core/common",
41     "//components/device_event_log",
42     "//components/devtools_discovery",
43     "//components/devtools_http_handler",
44     "//components/dom_distiller/core",
45     "//components/domain_reliability",
46     "//components/enhanced_bookmarks",
47     "//components/favicon/core",
48     "//components/favicon_base",
49     "//components/feedback",
50     "//components/gcm_driver",
51     "//components/gcm_driver/crypto",
52     "//components/gcm_driver/instance_id",
53     "//components/google/core/browser",
54     "//components/history/content/browser",
55     "//components/history/core/browser",
56     "//components/history/core/common",
57     "//components/history/core/test",
58     "//components/infobars/core",
59     "//components/invalidation/impl",
60     "//components/json_schema",
61     "//components/keyed_service/content",
62     "//components/language_usage_metrics",
63     "//components/leveldb_proto",
64     "//components/login",
65     "//components/memory_pressure",
66     "//components/metrics",
67     "//components/mime_util",
68     "//components/navigation_interception",
69     "//components/navigation_metrics",
70     "//components/network_hints/browser",
71     "//components/network_hints/common",
72     "//components/network_hints/renderer",
73     "//components/network_time",
74     "//components/offline_pages",
75     "//components/omnibox/browser",
76     "//components/onc",
77     "//components/open_from_clipboard",
78     "//components/os_crypt",
79     "//components/packed_ct_ev_whitelist",
80     "//components/pairing",
81     "//components/password_manager/content/browser",
82     "//components/password_manager/core/browser",
83     "//components/password_manager/core/common",
84     "//components/pdf/browser",
85     "//components/pdf/common",
86     "//components/pdf/renderer",
87     "//components/plugins/common",
88     "//components/plugins/renderer",
89     "//components/policy",
90     "//components/power",
91     "//components/precache/core",
92     "//components/precache/content",
93     "//components/proxy_config",
94     "//components/pref_registry",
95     "//components/query_parser",
96     "//components/rappor",
97     "//components/renderer_context_menu",
98     "//components/resources:components_resources",
99     "//components/search",
100     "//components/search_engines",
101     "//components/search_provider_logos",
102     "//components/security_interstitials/core",
103     "//components/sessions",
104     "//components/signin/core/browser",
105     "//components/startup_metric_utils",
106     "//components/strings",
107     "//components/sync_driver",
108     "//components/tracing",
109     "//components/tracing:startup_tracing",
110     "//components/translate/content/browser",
111     "//components/translate/content/common",
112     "//components/translate/content/renderer",
113     "//components/translate/core/browser",
114     "//components/translate/core/common",
115     "//components/ui/zoom",
116     "//components/undo",
117     "//components/update_client",
118     "//components/upload_list",
119     "//components/url_formatter",
120     "//components/url_matcher",
121     "//components/user_manager",
122     "//components/user_prefs",
123     "//components/user_prefs/tracked:user_prefs_tracked",
124     "//components/variations",
125     "//components/variations/service",
126     "//components/version_info",
127     "//components/visitedlink/browser",
128     "//components/visitedlink/common",
129     "//components/visitedlink/renderer",
130     "//components/wallpaper",
131     "//components/web_cache/browser",
132     "//components/web_cache/common",
133     "//components/web_cache/renderer",
134     "//components/web_modal",
135     "//components/web_resource",
136     "//components/webcrypto",
137     "//components/webdata/common",
138     "//components/wifi",
139     "//components/wifi_sync",
140   ]
142   if (!is_android) {
143     # TODO(agrieve): Add to main deps list once compile errors are resolved.
144     deps += [ "//components/devtools_service" ]
145   }
147   if (!is_android && !is_ios) {
148     deps += [
149       "//components/audio_modem",
150       "//components/proximity_auth",
151       "//components/proximity_auth/cryptauth",
152     ]
153   }
155   if (!enable_configuration_policy) {
156     deps -= [ "//components/policy" ]
157   }
159   if (!is_win && !is_mac) {
160     deps -= [ "//components/wifi" ]
161   }
162   if (!is_chromeos) {
163     deps -= [
164       "//components/pairing",
165       "//components/wifi_sync",
166     ]
167   }
169   if (!is_chromeos || !enable_extensions) {
170     deps -= [ "//components/chrome_apps" ]
171   }
173   if (is_ios) {
174     deps -= [
175       "//components/history/content/browser",
176       "//components/keyed_service/content",
177       "//components/network_hints/renderer",
178     ]
179   }
181   if (!enable_plugins) {
182     deps -= [
183       "//components/pdf/browser",
184       "//components/pdf/common",
185       "//components/pdf/renderer",
186     ]
187   }
189   if (is_android) {
190     deps -= [
191       "//components/autofill/content/browser",  # Blocked on content/blink.
192       "//components/autofill/content/common",  # Blocked on content.
193       "//components/autofill/content/renderer",  # Blocked on content/blink.
194       "//components/crash/app",  # Should work, needs checking.
195       "//components/crash/browser",  # Should work, needs checking.
196       "//components/captive_portal",  # Should work, needs checking.
197       "//components/cloud_devices/common",  # Should work, needs checking.
198       "//components/cdm/browser",  # Blocked on content.
199       "//components/cdm/common",  # Blocked on content.
200       "//components/cdm/renderer",  # Blocked on content.
201       "//components/data_reduction_proxy/core/browser",  # Should work, needs checking.
202       "//components/data_reduction_proxy/core/common",  # Should work, needs checking.
203       "//components/dom_distiller/core",  # Blocked on content.
204       "//components/domain_reliability",  # Blocked on content.
205       "//components/favicon/core",  # Blocked on keyed service.
206       "//components/favicon_base",  # Should work, needs checking.
207       "//components/feedback",  # Blocked on content.
208       "//components/google/core/browser",  # Should work, needs checking.
209       "//components/history/core/browser",  # Should work, needs checking.
210       "//components/history/core/common",  # Should work, needs checking.
211       "//components/history/core/test",  # Should work, needs checking.
212       "//components/infobars/core",  # Should work, needs checking.
213       "//components/invalidation/impl",  # Should work, needs checking.
214       "//components/json_schema",  # Should work, needs checking.
215       "//components/keyed_service/content",  # Blocked on content.
216       "//components/navigation_interception",  # Blocked on content.
217       "//components/omnibox/browser",  # Should work, needs checking.
218       "//components/password_manager/content/browser",  # Blocked on content.
219       "//components/password_manager/core/browser",  # Should work, needs checking.
220       "//components/password_manager/core/common",  # Should work, needs checking.
221       "//components/plugins/renderer",  # Blocked on blink.
222       "//components/power",  # Blocked on content.
223       "//components/policy",  # Blocked on content (indirectly via autofill).
224       "//components/precache/content",  # Blocked on content.
225       "//components/precache/core",  # Should work, needs checking.
226       "//components/rappor",  # Should work, needs checking.
227       "//components/renderer_context_menu",  # Blocked on content.
228       "//components/search_engines",  # Should work, needs checking.
229       "//components/search_provider_logos",  # Should work, needs checking.
230       "//components/sessions",  # Blocked on content.
231       "//components/signin/core/browser",  # Should work, needs checking.
232       "//components/translate/content/browser",  # Blocked on content.
233       "//components/translate/content/common",  # Blocked on content.
234       "//components/translate/content/renderer",  # Blocked on content.
235       "//components/user_prefs",  # Blocked on content.
236       "//components/visitedlink/browser",  # Blocked on content.
237       "//components/visitedlink/common",  # Blocked on content.
238       "//components/visitedlink/renderer",  # Blocked on blink
239       "//components/web_cache/browser",  # Blocked on content and blink.
240       "//components/web_cache/renderer",  # Blocked on content and blink.
241       "//components/web_modal",  # Blocked on content.
242     ]
243   }
245   if (!is_ios && !is_android) {
246     deps += [
247       "//components/copresence",
248       "//components/storage_monitor",
249     ]
250   }
252   if (!is_ios) {
253     deps += [
254       "//components/app_modal",
255       "//components/browsing_data",
256       "//components/guest_view/browser",
257       "//components/guest_view/common",
258       "//components/guest_view/renderer",
259       "//components/safe_json",
260       "//components/scheduler",
261       "//components/test_runner",
262     ]
263   }
265   if (toolkit_views) {
266     deps += [ "//components/constrained_window" ]
267   }
270 # TODO(GYP): Delete this after we've converted everything to GN.
271 # The _run targets exist only for compatibility w/ GYP.
272 group("components_unittests_run") {
273   testonly = true
274   deps = [
275     ":components_unittests",
276   ]
279 # To add a unit test to this target, make a "unit_test" source_set in your
280 # component (it's important to use a source_set instead of a static library or
281 # no tests will run) and add a reference here. You can add more than one unit
282 # test target if convenient.
283 test("components_unittests") {
284   sources = [
285     "test/run_all_unittests.cc",
286   ]
288   if (is_android || is_linux || is_mac || is_win) {
289     data = [
290       "test/data/",
292       # TODO(dpranke): Remove the next two lines after GN has rolled to 339778.
293       "$root_out_dir/components_tests_resources.pak",
294       "$root_out_dir/ui_test.pak",
295     ]
296   }
298   # Add only ":unit_tests" dependencies here. If your tests have dependencies
299   # (this would at least include the component itself), they should be on the
300   # test source set and not here.
301   deps = [
302     "//components/auto_login_parser:unit_tests",
303     "//components/autofill/content/browser:unit_tests",
304     "//components/autofill/content/renderer:unit_tests",
305     "//components/autofill/core/browser:unit_tests",
306     "//components/autofill/core/common:unit_tests",
307     "//components/bookmarks/browser:unit_tests",
308     "//components/bookmarks/managed:unit_tests",
309     "//components/captive_portal:unit_tests",
310     "//components/cloud_devices/common:unit_tests",
311     "//components/component_updater:unit_tests",
312     "//components/content_settings/core/browser:unit_tests",
313     "//components/content_settings/core/common:unit_tests",
314     "//components/crx_file:unit_tests",
315     "//components/data_reduction_proxy/content/browser:unit_tests",
316     "//components/data_reduction_proxy/core/browser:unit_tests",
317     "//components/data_reduction_proxy/core/common:unit_tests",
318     "//components/device_event_log:unit_tests",
319     "//components/devtools_http_handler:unit_tests",
320     "//components/dom_distiller/content:unit_tests",
321     "//components/dom_distiller/core:unit_tests",
322     "//components/domain_reliability:unit_tests",
323     "//components/enhanced_bookmarks:unit_tests",
324     "//components/favicon/content:unit_tests",
325     "//components/favicon/core:unit_tests",
326     "//components/favicon_base:unit_tests",
327     "//components/gcm_driver/crypto:unit_tests",
328     "//components/gcm_driver/instance_id:unit_tests",
329     "//components/gcm_driver:unit_tests",
330     "//components/google/core/browser:unit_tests",
331     "//components/history/content/browser:unit_tests",
332     "//components/history/core/browser:unit_tests",
333     "//components/history/core/common:unit_tests",
334     "//components/invalidation/impl:unit_tests",
335     "//components/json_schema:unit_tests",
336     "//components/keyed_service/content:unit_tests",
337     "//components/keyed_service/core:unit_tests",
338     "//components/language_usage_metrics:unit_tests",
339     "//components/leveldb_proto:unit_tests",
340     "//components/login:unit_tests",
341     "//components/memory_pressure:unit_tests",
342     "//components/metrics:unit_tests",
343     "//components/mime_util:unit_tests",
344     "//components/network_time:unit_tests",
345     "//components/offline_pages:unit_tests",
346     "//components/omnibox/browser:unit_tests",
347     "//components/open_from_clipboard:unit_tests",
348     "//components/os_crypt:unit_tests",
349     "//components/packed_ct_ev_whitelist:unit_tests",
350     "//components/password_manager/content/browser:unit_tests",
351     "//components/password_manager/core/browser:unit_tests",
352     "//components/password_manager/core/common:unit_tests",
353     "//components/password_manager/sync/browser:unit_tests",
354     "//components/precache/content:unit_tests",
355     "//components/precache/core:unit_tests",
356     "//components/proxy_config:unit_tests",
357     "//components/query_parser:unit_tests",
358     "//components/rappor:unit_tests",
359     "//components/search:unit_tests",
360     "//components/search_engines:unit_tests",
361     "//components/search_provider_logos:unit_tests",
362     "//components/signin/core/browser:unit_tests",
363     "//components/suggestions:unit_tests",
364     "//components/sync_driver:unit_tests",
365     "//components/translate/core/browser:unit_tests",
366     "//components/translate/core/common:unit_tests",
367     "//components/translate/core/language_detection:unit_tests",
368     "//components/undo:unit_tests",
369     "//components/url_formatter:unit_tests",
370     "//components/url_matcher:unit_tests",
371     "//components/update_client:unit_tests",
372     "//components/upload_list:unit_tests",
373     "//components/user_prefs/tracked:unit_tests",
374     "//components/variations:unit_tests",
375     "//components/wallpaper:unit_tests",
376     "//components/web_resource:unit_tests",
377     "//components/webcrypto:unit_tests",
378     "//components/webdata/common:unit_tests",
380     # These are the deps required by the code in this target.
381     "//base",
382     "//base/test:test_support",
383     "//components/policy:policy_component",
384     "//content/test:test_support",
385     "//net",
386     "//ui/base",
387     "//ui/resources:ui_test_pak",
388   ]
390   data_deps = [
391     ":components_tests_pak",
392     "//third_party/mesa:osmesa",
393     "//ui/resources:ui_test_pak",
394   ]
396   if (enable_rlz_support) {
397     deps += [ "//components/rlz:unit_tests" ]
398   }
400   if (is_android) {
401     isolate_file = "components_unittests.isolate"
403     deps += [ "//content/public/android:content_java" ]
404     deps -= [
405       "//components/gcm_driver:unit_tests",
406       "//components/gcm_driver/instance_id:unit_tests",
407       "//components/password_manager/content/browser:unit_tests",
408       "//components/password_manager/core/browser:unit_tests",
409       "//components/password_manager/core/common:unit_tests",
410       "//components/password_manager/sync/browser:unit_tests",
411     ]
412   }
414   if (!is_android && !is_ios) {
415     deps += [
416       "//components/audio_modem:unit_tests",
417       "//components/copresence:unit_tests",
418       "//components/feedback:unit_tests",
419       "//components/proximity_auth:unit_tests",
420       "//components/sessions:unit_tests",
421       "//components/storage_monitor:unit_tests",
422     ]
423   }
425   if (is_chromeos) {
426     deps += [ "//components/ownership:unit_tests" ]
427   }
429   # TODO(GYP) need this target.
430   #'breakpad/app/crash_keys_win_unittest.cc',
432   if (enable_configuration_policy) {
433     deps += [
434       "//components/policy/core/browser:unit_tests",
435       "//components/policy/core/common:unit_tests",
436     ]
437   }
439   if (toolkit_views) {
440     # TODO bug 522654 Enable this when the undefined symbol is fixed in
441     # web_modal such that this links.
442     #deps += [ "//components/constrained_window:unit_tests" ]
443   }
444   if (is_win) {
445     deps += [ "//components/browser_watcher:unit_tests" ]
446   }
447   if (is_ios) {
448     deps += [ "//components/signin/core/browser:unit_tests" ]
449     deps -= [ "//components/devtools_http_handler:unit_tests" ]
450   } else {
451     # Non-iOS tests.
452     deps += [
453       "//components/error_page/renderer:unit_tests",
454       "//components/guest_view/browser:unit_tests",
455       "//components/navigation_interception:unit_tests",
456       "//components/network_hints/renderer:unit_tests",
457       "//components/power:unit_tests",
458       "//components/safe_json:unit_tests",
459       "//components/scheduler:unit_tests",
460       "//components/ui/zoom:unit_tests",
461       "//components/visitedlink/test:unit_tests",
462       "//components/web_cache/browser:unit_tests",
463     ]
464   }
466   if (enable_basic_printing || enable_print_preview) {
467     deps += [
468       "//components/printing/browser",
469       "//components/printing/common",
470       "//components/printing/renderer",
471     ]
472   }
475 repack("components_tests_pak") {
476   sources = [
477     "$root_gen_dir/components/components_resources.pak",
478     "$root_gen_dir/components/strings/components_strings_en-US.pak",
479   ]
481   output = "$root_out_dir/components_tests_resources.pak"
483   deps = [
484     "//components/resources",
485     "//components/strings",
486   ]
489 # TODO(GYP): Delete this after we've converted everything to GN.
490 # The _run targets exist only for compatibility w/ GYP.
491 group("components_browsertests_run") {
492   testonly = true
493   deps = [
494     ":components_browsertests",
495   ]
498 test("components_browsertests") {
499   sources = [
500     "autofill/content/browser/risk/fingerprint_browsertest.cc",
501     "autofill/content/renderer/password_form_conversion_utils_browsertest.cc",
502     "dom_distiller/content/browser/distillable_page_utils_browsertest.cc",
503     "dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc",
504     "dom_distiller/content/browser/test/dom_distiller_js_browsertest.cc",
505     "password_manager/content/renderer/credential_manager_client_browsertest.cc",
506   ]
508   data = [
509     "$root_out_dir/components_tests_resources.pak",
510     "$root_out_dir/content_shell.pak",
511   ]
513   if (is_android || is_linux || is_mac || is_win) {
514     data += [
515       "test/data/",
516       "dom_distiller/core/javascript/",
517       "//third_party/dom_distiller_js/dist/test/data/",
518     ]
519   }
521   if (is_mac) {
522     data += [ "$root_out_dir/Content Shell.app/" ]
523   }
525   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
527   deps = [
528     "autofill/content/browser",
529     "autofill/content/renderer",
530     "content_settings/core/common",
531     "dom_distiller/content:content_browser",
532     "dom_distiller/core",
533     "dom_distiller/core:test_support",
534     "password_manager/content/browser",
535     "password_manager/content/common",
536     "password_manager/content/renderer",
537     "strings",
538     "//base",
539     "//base/test:test_support",
540     "//content/test:browsertest_support",
541     "//content/test:test_support",
542     "//device/bluetooth",
543     "//testing/gmock",
544     "//testing/gtest",
545     "//ui/base",
546   ]
548   data_deps = [
549     ":components_tests_pak",
550     "//third_party/mesa:osmesa",
551   ]
553   if (is_android) {
554     sources += [ "test/android/browsertests_apk/components_browser_tests_jni_onload.cc" ]
555     sources -= [ "autofill/content/browser/risk/fingerprint_browsertest.cc" ]
556     deps += [ "//testing/android/native_test:native_test_support" ]
557     use_launcher = false
558     isolate_file = "components_browsertests.isolate"
559   }
561   if (is_linux) {
562     # content_extractor_browsertest is a standalone content extraction tool built as
563     # a MANUAL component_browsertest.
564     sources += [ "dom_distiller/standalone/content_extractor_browsertest.cc" ]
565     deps += [
566       "pref_registry:test_support",
567       "//base:prefs_test_support",
568     ]
569   }
571   if (enable_basic_printing || enable_print_preview) {
572     sources += [ "printing/test/print_web_view_helper_browsertest.cc" ]
573     deps += [ "//components/printing/test:test_support" ]
574   }
577 test("components_perftests") {
578   sources = [
579     "scheduler/child/task_queue_manager_perftest.cc",
580     "visitedlink/test/visitedlink_perftest.cc",
581   ]
583   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
584   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
586   deps = [
587     "//base",
588     "//base/test:test_support_perf",
589     "//testing/gtest",
590     "//testing/perf",
591     "//content/test:test_support",
592     "//components/visitedlink/browser",
593   ]