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