BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / components / BUILD.gn
blob2b6718d276d0fa8bdc9f0d52fdfe5153a47ce166
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/certificate_reporting",
32     "//components/cloud_devices/common",
33     "//components/chrome_apps",
34     "//components/component_updater",
35     "//components/compression",
36     "//components/content_settings/core/browser",
37     "//components/content_settings/core/common",
38     "//components/crash/content/app",
39     "//components/crash/content/browser",
40     "//components/crx_file",
41     "//components/data_reduction_proxy/core/browser",
42     "//components/data_reduction_proxy/core/common",
43     "//components/device_event_log",
44     "//components/devtools_discovery",
45     "//components/devtools_http_handler",
46     "//components/dom_distiller/core",
47     "//components/domain_reliability",
48     "//components/enhanced_bookmarks",
49     "//components/favicon/core",
50     "//components/favicon_base",
51     "//components/feedback",
52     "//components/gcm_driver",
53     "//components/gcm_driver/crypto",
54     "//components/gcm_driver/instance_id",
55     "//components/google/core/browser",
56     "//components/history/content/browser",
57     "//components/history/core/browser",
58     "//components/history/core/common",
59     "//components/history/core/test",
60     "//components/infobars/core",
61     "//components/invalidation/impl",
62     "//components/json_schema",
63     "//components/keyed_service/content",
64     "//components/language_usage_metrics",
65     "//components/leveldb_proto",
66     "//components/login",
67     "//components/memory_pressure",
68     "//components/metrics",
69     "//components/mime_util",
70     "//components/navigation_interception",
71     "//components/navigation_metrics",
72     "//components/net_log",
73     "//components/network_hints/browser",
74     "//components/network_hints/common",
75     "//components/network_hints/renderer",
76     "//components/network_time",
77     "//components/offline_pages",
78     "//components/omnibox/browser",
79     "//components/onc",
80     "//components/open_from_clipboard",
81     "//components/os_crypt",
82     "//components/packed_ct_ev_whitelist",
83     "//components/pairing",
84     "//components/password_manager/content/browser",
85     "//components/password_manager/core/browser",
86     "//components/password_manager/core/common",
87     "//components/pdf/browser",
88     "//components/pdf/common",
89     "//components/pdf/renderer",
90     "//components/plugins/common",
91     "//components/plugins/renderer",
92     "//components/policy",
93     "//components/power",
94     "//components/precache/core",
95     "//components/precache/content",
96     "//components/proxy_config",
97     "//components/pref_registry",
98     "//components/query_parser",
99     "//components/rappor",
100     "//components/renderer_context_menu",
101     "//components/resources:components_resources",
102     "//components/search",
103     "//components/search_engines",
104     "//components/search_provider_logos",
105     "//components/security_interstitials/core",
106     "//components/sessions",
107     "//components/signin/core/browser",
108     "//components/ssl_errors",
109     "//components/startup_metric_utils",
110     "//components/strings",
111     "//components/sync_driver",
112     "//components/syncable_prefs",
113     "//components/tracing",
114     "//components/tracing:startup_tracing",
115     "//components/translate/content/browser",
116     "//components/translate/content/common",
117     "//components/translate/content/renderer",
118     "//components/translate/core/browser",
119     "//components/translate/core/common",
120     "//components/ui/zoom",
121     "//components/undo",
122     "//components/update_client",
123     "//components/upload_list",
124     "//components/url_formatter",
125     "//components/url_matcher",
126     "//components/user_manager",
127     "//components/user_prefs",
128     "//components/user_prefs/tracked:user_prefs_tracked",
129     "//components/variations",
130     "//components/variations/service",
131     "//components/version_info",
132     "//components/visitedlink/browser",
133     "//components/visitedlink/common",
134     "//components/visitedlink/renderer",
135     "//components/wallpaper",
136     "//components/web_cache/browser",
137     "//components/web_cache/common",
138     "//components/web_cache/renderer",
139     "//components/web_modal",
140     "//components/web_resource",
141     "//components/webdata/common",
142     "//components/wifi",
143     "//components/wifi_sync",
144   ]
146   if (!is_android && !is_ios) {
147     deps += [
148       "//components/audio_modem",
149       "//components/proximity_auth",
150       "//components/proximity_auth/cryptauth",
151       "//components/webusb",
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/content/app",  # Should work, needs checking.
195       "//components/crash/content/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/certificate_transparency",
257       "//components/guest_view/browser",
258       "//components/guest_view/common",
259       "//components/guest_view/renderer",
260       "//components/page_load_metrics/browser",
261       "//components/page_load_metrics/common",
262       "//components/page_load_metrics/renderer",
263       "//components/safe_json",
264       "//components/scheduler",
265       "//components/test_runner",
266       "//components/webcrypto",
267     ]
268   }
270   if (toolkit_views) {
271     deps += [ "//components/constrained_window" ]
272   }
275 # TODO(GYP): Delete this after we've converted everything to GN.
276 # The _run targets exist only for compatibility w/ GYP.
277 group("components_unittests_run") {
278   testonly = true
279   deps = [
280     ":components_unittests",
281   ]
284 # To add a unit test to this target, make a "unit_test" source_set in your
285 # component (it's important to use a source_set instead of a static library or
286 # no tests will run) and add a reference here. You can add more than one unit
287 # test target if convenient.
288 test("components_unittests") {
289   sources = [
290     "test/run_all_unittests.cc",
291   ]
293   if (is_android || is_linux || is_mac || is_win) {
294     data = [
295       "test/data/",
297       # TODO(dpranke): Remove the next two lines after GN has rolled to 339778.
298       "$root_out_dir/components_tests_resources.pak",
299       "$root_out_dir/ui_test.pak",
300     ]
301   }
303   # Add only ":unit_tests" dependencies here. If your tests have dependencies
304   # (this would at least include the component itself), they should be on the
305   # test source set and not here.
306   deps = [
307     "//components/auto_login_parser:unit_tests",
308     "//components/autofill/content/browser:unit_tests",
309     "//components/autofill/content/renderer:unit_tests",
310     "//components/autofill/core/browser:unit_tests",
311     "//components/autofill/core/common:unit_tests",
312     "//components/bookmarks/browser:unit_tests",
313     "//components/bookmarks/managed:unit_tests",
314     "//components/bubble:unit_tests",
315     "//components/captive_portal:unit_tests",
316     "//components/certificate_transparency:unit_tests",
317     "//components/cloud_devices/common:unit_tests",
318     "//components/component_updater:unit_tests",
319     "//components/content_settings/core/browser:unit_tests",
320     "//components/content_settings/core/common:unit_tests",
321     "//components/crx_file:unit_tests",
322     "//components/data_reduction_proxy/content/browser:unit_tests",
323     "//components/data_reduction_proxy/core/browser:unit_tests",
324     "//components/data_reduction_proxy/core/common:unit_tests",
325     "//components/device_event_log:unit_tests",
326     "//components/devtools_http_handler:unit_tests",
327     "//components/dom_distiller/content:unit_tests",
328     "//components/dom_distiller/core:unit_tests",
329     "//components/domain_reliability:unit_tests",
330     "//components/enhanced_bookmarks:unit_tests",
331     "//components/favicon/content:unit_tests",
332     "//components/favicon/core:unit_tests",
333     "//components/favicon_base:unit_tests",
334     "//components/gcm_driver/crypto:unit_tests",
335     "//components/gcm_driver/instance_id:unit_tests",
336     "//components/gcm_driver:unit_tests",
337     "//components/google/core/browser:unit_tests",
338     "//components/history/content/browser:unit_tests",
339     "//components/history/core/browser:unit_tests",
340     "//components/history/core/common:unit_tests",
341     "//components/invalidation/impl:unit_tests",
342     "//components/json_schema:unit_tests",
343     "//components/keyed_service/content:unit_tests",
344     "//components/keyed_service/core:unit_tests",
345     "//components/language_usage_metrics:unit_tests",
346     "//components/leveldb_proto:unit_tests",
347     "//components/login:unit_tests",
348     "//components/memory_pressure:unit_tests",
349     "//components/metrics:unit_tests",
350     "//components/mime_util:unit_tests",
351     "//components/net_log:unit_tests",
352     "//components/network_time:unit_tests",
353     "//components/offline_pages:unit_tests",
354     "//components/omnibox/browser:unit_tests",
355     "//components/open_from_clipboard:unit_tests",
356     "//components/os_crypt:unit_tests",
357     "//components/packed_ct_ev_whitelist:unit_tests",
358     "//components/password_manager/content/browser:unit_tests",
359     "//components/password_manager/core/browser:unit_tests",
360     "//components/password_manager/core/common:unit_tests",
361     "//components/password_manager/sync/browser:unit_tests",
362     "//components/precache/content:unit_tests",
363     "//components/precache/core:unit_tests",
364     "//components/proxy_config:unit_tests",
365     "//components/query_parser:unit_tests",
366     "//components/rappor:unit_tests",
367     "//components/search:unit_tests",
368     "//components/search_engines:unit_tests",
369     "//components/search_provider_logos:unit_tests",
370     "//components/signin/core/browser:unit_tests",
371     "//components/suggestions:unit_tests",
372     "//components/sync_driver:unit_tests",
373     "//components/syncable_prefs:unit_tests",
374     "//components/translate/core/browser:unit_tests",
375     "//components/translate/core/common:unit_tests",
376     "//components/translate/core/language_detection:unit_tests",
377     "//components/undo:unit_tests",
378     "//components/url_formatter:unit_tests",
379     "//components/url_matcher:unit_tests",
380     "//components/update_client:unit_tests",
381     "//components/upload_list:unit_tests",
382     "//components/user_prefs/tracked:unit_tests",
383     "//components/variations:unit_tests",
384     "//components/variations/service:unit_tests",
385     "//components/wallpaper:unit_tests",
386     "//components/web_resource:unit_tests",
387     "//components/webcrypto:unit_tests",
388     "//components/webdata/common:unit_tests",
390     # These are the deps required by the code in this target.
391     "//base",
392     "//base/test:test_support",
393     "//components/policy:policy_component",
394     "//content/test:test_support",
395     "//net",
396     "//ui/base",
397     "//ui/resources:ui_test_pak",
398   ]
400   data_deps = [
401     ":components_tests_pak",
402     "//third_party/mesa:osmesa",
403     "//ui/resources:ui_test_pak",
404   ]
406   if (enable_rlz_support) {
407     deps += [ "//components/rlz:unit_tests" ]
408   }
410   if (is_android) {
411     isolate_file = "components_unittests.isolate"
413     deps += [ "//content/public/android:content_java" ]
414     deps -= [
415       "//components/gcm_driver:unit_tests",
416       "//components/gcm_driver/instance_id:unit_tests",
417       "//components/password_manager/content/browser:unit_tests",
418       "//components/password_manager/core/browser:unit_tests",
419       "//components/password_manager/core/common:unit_tests",
420       "//components/password_manager/sync/browser:unit_tests",
421     ]
422   }
424   if (!is_android && !is_ios) {
425     deps += [
426       "//components/audio_modem:unit_tests",
427       "//components/copresence:unit_tests",
428       "//components/feedback:unit_tests",
429       "//components/proximity_auth:unit_tests",
430       "//components/sessions:unit_tests",
431       "//components/storage_monitor:unit_tests",
432       "//components/tracing:unit_tests",
433       "//components/webusb:unit_tests",
434     ]
435   }
437   if (is_chromeos) {
438     deps += [ "//components/ownership:unit_tests" ]
439   }
441   # TODO(GYP) need this target.
442   #'breakpad/app/crash_keys_win_unittest.cc',
444   if (enable_configuration_policy) {
445     deps += [
446       "//components/policy/core/browser:unit_tests",
447       "//components/policy/core/common:unit_tests",
448     ]
449   }
451   if (toolkit_views) {
452     # TODO bug 522654 Enable this when the undefined symbol is fixed in
453     # web_modal such that this links.
454     #deps += [ "//components/constrained_window:unit_tests" ]
455   }
456   if (is_win) {
457     deps += [ "//components/browser_watcher:unit_tests" ]
458   }
459   if (is_ios) {
460     deps += [ "//components/signin/core/browser:unit_tests" ]
461     deps -= [ "//components/devtools_http_handler:unit_tests" ]
462   } else {
463     # Non-iOS tests.
464     deps += [
465       "//components/error_page/renderer:unit_tests",
466       "//components/guest_view/browser:unit_tests",
467       "//components/navigation_interception:unit_tests",
468       "//components/network_hints/renderer:unit_tests",
469       "//components/page_load_metrics/browser:unit_tests",
470       "//components/page_load_metrics/renderer:unit_tests",
471       "//components/power:unit_tests",
472       "//components/safe_json:unit_tests",
473       "//components/scheduler:unit_tests",
474       "//components/test_runner:test_runner",
475       "//components/ui/zoom:unit_tests",
476       "//components/visitedlink/test:unit_tests",
477       "//components/web_cache/browser:unit_tests",
478     ]
479   }
481   if (enable_basic_printing || enable_print_preview) {
482     deps += [
483       "//components/printing/browser",
484       "//components/printing/common",
485       "//components/printing/renderer",
486     ]
487   }
490 repack("components_tests_pak") {
491   sources = [
492     "$root_gen_dir/components/components_resources.pak",
493     "$root_gen_dir/components/strings/components_strings_en-US.pak",
494   ]
496   output = "$root_out_dir/components_tests_resources.pak"
498   deps = [
499     "//components/resources",
500     "//components/strings",
501   ]
504 # TODO(GYP): Delete this after we've converted everything to GN.
505 # The _run targets exist only for compatibility w/ GYP.
506 group("components_browsertests_run") {
507   testonly = true
508   deps = [
509     ":components_browsertests",
510   ]
513 test("components_browsertests") {
514   sources = [
515     "autofill/content/browser/risk/fingerprint_browsertest.cc",
516     "autofill/content/renderer/password_form_conversion_utils_browsertest.cc",
517     "dom_distiller/content/browser/distillable_page_utils_browsertest.cc",
518     "dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc",
519     "dom_distiller/content/browser/test/dom_distiller_js_browsertest.cc",
520     "password_manager/content/renderer/credential_manager_client_browsertest.cc",
521   ]
523   data = [
524     "$root_out_dir/components_tests_resources.pak",
525     "$root_out_dir/content_shell.pak",
526   ]
528   if (is_android || is_linux || is_mac || is_win) {
529     data += [
530       "test/data/",
531       "dom_distiller/core/javascript/",
532       "//third_party/dom_distiller_js/dist/test/data/",
533     ]
534   }
536   if (is_mac) {
537     data += [ "$root_out_dir/Content Shell.app/" ]
538   }
540   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
542   deps = [
543     "autofill/content/browser",
544     "autofill/content/renderer",
545     "content_settings/core/common",
546     "dom_distiller/content:content_browser",
547     "dom_distiller/core",
548     "dom_distiller/core:test_support",
549     "password_manager/content/browser",
550     "password_manager/content/common",
551     "password_manager/content/renderer",
552     "strings",
553     "//base",
554     "//base/test:test_support",
555     "//content/test:browsertest_support",
556     "//content/test:test_support",
557     "//device/bluetooth",
558     "//testing/gmock",
559     "//testing/gtest",
560     "//ui/base",
561   ]
563   data_deps = [
564     ":components_tests_pak",
565     "//third_party/mesa:osmesa",
566   ]
568   if (is_android) {
569     sources += [ "test/android/browsertests_apk/components_browser_tests_jni_onload.cc" ]
570     sources -= [ "autofill/content/browser/risk/fingerprint_browsertest.cc" ]
571     deps += [ "//testing/android/native_test:native_test_support" ]
572     use_launcher = false
573     isolate_file = "components_browsertests.isolate"
574   }
576   if (is_linux) {
577     # content_extractor_browsertest is a standalone content extraction tool built as
578     # a MANUAL component_browsertest.
579     sources += [ "dom_distiller/standalone/content_extractor_browsertest.cc" ]
580     deps += [
581       "pref_registry:test_support",
582       "//base:prefs_test_support",
583     ]
584   }
586   if (enable_basic_printing || enable_print_preview) {
587     sources += [ "printing/test/print_web_view_helper_browsertest.cc" ]
588     deps += [ "//components/printing/test:test_support" ]
589   }
592 test("components_perftests") {
593   sources = [
594     "scheduler/child/task_queue_manager_perftest.cc",
595     "visitedlink/test/visitedlink_perftest.cc",
596   ]
598   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
599   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
601   deps = [
602     "//base",
603     "//base/test:test_support_perf",
604     "//testing/gtest",
605     "//testing/perf",
606     "//content/test:test_support",
607     "//components/visitedlink/browser",
608   ]