Inline NetLog IPv6 reachability events.
[chromium-blink-merge.git] / components / BUILD.gn
blob01503dc10791a29d1dbe5421351c7a69a687f8f0
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/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/component_updater",
31     "//components/content_settings/core/browser",
32     "//components/content_settings/core/common",
33     "//components/crash/app",
34     "//components/crash/browser",
35     "//components/crx_file",
36     "//components/data_reduction_proxy/core/browser",
37     "//components/data_reduction_proxy/core/common",
38     "//components/device_event_log",
39     "//components/devtools_discovery",
40     "//components/devtools_http_handler",
41     "//components/dom_distiller/core",
42     "//components/domain_reliability",
43     "//components/enhanced_bookmarks",
44     "//components/favicon/core",
45     "//components/favicon_base",
46     "//components/feedback",
47     "//components/gcm_driver",
48     "//components/google/core/browser",
49     "//components/history/content/browser",
50     "//components/history/core/browser",
51     "//components/history/core/common",
52     "//components/history/core/test",
53     "//components/infobars/core",
54     "//components/invalidation",
55     "//components/json_schema",
56     "//components/keyed_service/content",
57     "//components/language_usage_metrics",
58     "//components/leveldb_proto",
59     "//components/login",
60     "//components/metrics",
61     "//components/navigation_interception",
62     "//components/navigation_metrics",
63     "//components/network_time",
64     "//components/omnibox",
65     "//components/onc",
66     "//components/os_crypt",
67     "//components/packed_ct_ev_whitelist",
68     "//components/pairing",
69     "//components/password_manager/content/browser",
70     "//components/password_manager/core/browser",
71     "//components/password_manager/core/common",
72     "//components/pdf/browser",
73     "//components/pdf/common",
74     "//components/pdf/renderer",
75     "//components/plugins/common",
76     "//components/plugins/renderer",
77     "//components/policy",
78     "//components/power",
79     "//components/precache/core",
80     "//components/precache/content",
81     "//components/pref_registry",
82     "//components/query_parser",
83     "//components/rappor",
84     "//components/renderer_context_menu",
85     "//components/resources:components_resources",
86     "//components/search",
87     "//components/search_engines",
88     "//components/search_provider_logos",
89     "//components/sessions:sessions_content",
90     "//components/signin/core/browser",
91     "//components/startup_metric_utils",
92     "//components/strings",
93     "//components/sync_driver",
94     "//components/tracing",
95     "//components/translate/content/browser",
96     "//components/translate/content/common",
97     "//components/translate/content/renderer",
98     "//components/translate/core/browser",
99     "//components/translate/core/common",
100     "//components/ui/zoom:ui_zoom",
101     "//components/undo",
102     "//components/update_client",
103     "//components/url_fixer",
104     "//components/url_matcher",
105     "//components/user_manager",
106     "//components/user_prefs",
107     "//components/variations",
108     "//components/visitedlink/browser",
109     "//components/visitedlink/common",
110     "//components/visitedlink/renderer",
111     "//components/wallpaper",
112     "//components/web_cache/browser",
113     "//components/web_cache/common",
114     "//components/web_cache/renderer",
115     "//components/web_modal",
116     "//components/web_resource",
117     "//components/webcrypto",
118     "//components/webdata/common",
119     "//components/webui_generator",
120     "//components/wifi",
121     "//components/wifi_sync",
122   ]
124   if (!is_android && !is_ios) {
125     deps += [
126       "//components/proximity_auth",
127       "//components/proximity_auth/cryptauth",
128     ]
129   }
131   if (!enable_configuration_policy) {
132     deps -= [ "//components/policy" ]
133   }
135   if (!is_win && !is_mac) {
136     deps -= [ "//components/wifi" ]
137   }
138   if (!is_chromeos) {
139     deps -= [
140       "//components/pairing",
141       "//components/wifi_sync",
142     ]
143   }
144   if (is_ios) {
145     deps -= [
146       "//components/history/content/browser",
147       "//components/keyed_service/content",
148       "//components/webui_generator",
149     ]
150   }
152   if (!enable_plugins) {
153     deps -= [
154       "//components/pdf/browser",
155       "//components/pdf/common",
156       "//components/pdf/renderer",
157     ]
158   }
160   if (is_android) {
161     deps -= [
162       "//components/autofill/content/browser",  # Blocked on content/blink.
163       "//components/autofill/content/common",  # Blocked on content.
164       "//components/autofill/content/renderer",  # Blocked on content/blink.
165       "//components/crash/app",  # Should work, needs checking.
166       "//components/crash/browser",  # Should work, needs checking.
167       "//components/captive_portal",  # Should work, needs checking.
168       "//components/cloud_devices/common",  # Should work, needs checking.
169       "//components/cdm/browser",  # Blocked on content.
170       "//components/cdm/common",  # Blocked on content.
171       "//components/cdm/renderer",  # Blocked on content.
172       "//components/data_reduction_proxy/core/browser",  # Should work, needs checking.
173       "//components/data_reduction_proxy/core/common",  # Should work, needs checking.
174       "//components/dom_distiller/core",  # Blocked on content.
175       "//components/domain_reliability",  # Blocked on content.
176       "//components/favicon/core",  # Blocked on keyed service.
177       "//components/favicon_base",  # Should work, needs checking.
178       "//components/feedback",  # Blocked on content.
179       "//components/gcm_driver",  # Should work, needs checking.
180       "//components/google/core/browser",  # Should work, needs checking.
181       "//components/history/core/browser",  # Should work, needs checking.
182       "//components/history/core/common",  # Should work, needs checking.
183       "//components/history/core/test",  # Should work, needs checking.
184       "//components/infobars/core",  # Should work, needs checking.
185       "//components/invalidation",  # Should work, needs checking.
186       "//components/json_schema",  # Should work, needs checking.
187       "//components/keyed_service/content",  # Blocked on content.
188       "//components/navigation_interception",  # Blocked on content.
189       "//components/omnibox",  # Should work, needs checking.
190       "//components/password_manager/content/browser",  # Blocked on content.
191       "//components/password_manager/core/browser",  # Should work, needs checking.
192       "//components/password_manager/core/common",  # Should work, needs checking.
193       "//components/plugins/renderer",  # Blocked on blink.
194       "//components/power",  # Blocked on content.
195       "//components/policy",  # Blocked on content (indirectly via autofill).
196       "//components/precache/content",  # Blocked on content.
197       "//components/precache/core",  # Should work, needs checking.
198       "//components/rappor",  # Should work, needs checking.
199       "//components/renderer_context_menu",  # Blocked on content.
200       "//components/search_engines",  # Should work, needs checking.
201       "//components/search_provider_logos",  # Should work, needs checking.
202       "//components/sessions:sessions_content",  # Blocked on content.
203       "//components/signin/core/browser",  # Should work, needs checking.
204       "//components/translate/content/browser",  # Blocked on content.
205       "//components/translate/content/common",  # Blocked on content.
206       "//components/translate/content/renderer",  # Blocked on content.
207       "//components/user_prefs",  # Blocked on content.
208       "//components/visitedlink/browser",  # Blocked on content.
209       "//components/visitedlink/common",  # Blocked on content.
210       "//components/visitedlink/renderer",  # Blocked on blink
211       "//components/web_cache/browser",  # Blocked on content and blink.
212       "//components/web_cache/renderer",  # Blocked on content and blink.
213       "//components/web_modal",  # Blocked on content.
214     ]
215   }
217   if (!is_ios && !is_android) {
218     deps += [
219       "//components/copresence",
220       "//components/storage_monitor",
221     ]
222   }
224   if (!is_ios) {
225     deps += [
226       "//components/app_modal",
227       "//components/browsing_data",
228       "//components/scheduler",
229     ]
230   }
232   if (toolkit_views) {
233     deps += [ "//components/constrained_window" ]
234   }
237 # To add a unit test to this target, make a "unit_test" source_set in your
238 # component (it's important to use a source_set instead of a static library or
239 # no tests will run) and add a reference here. You can add more than one unit
240 # test target if convenient.
241 test("components_unittests") {
242   sources = [
243     "test/run_all_unittests.cc",
244   ]
246   # Add only ":unit_tests" dependencies here. If your tests have dependencies
247   # (this would at least include the component itself), they should be on the
248   # test source set and not here.
249   deps = [
250     "//components/auto_login_parser:unit_tests",
251     "//components/autofill/content/browser:unit_tests",
252     "//components/autofill/core/browser:unit_tests",
253     "//components/autofill/core/common:unit_tests",
254     "//components/bookmarks/browser:unit_tests",
255     "//components/bookmarks/managed:unit_tests",
256     "//components/captive_portal:unit_tests",
257     "//components/cloud_devices/common:unit_tests",
258     "//components/content_settings/core/browser:unit_tests",
259     "//components/content_settings/core/common:unit_tests",
260     "//components/crx_file:unit_tests",
261     "//components/data_reduction_proxy/content/browser:unit_tests",
262     "//components/data_reduction_proxy/core/browser:unit_tests",
263     "//components/data_reduction_proxy/core/common:unit_tests",
264     "//components/device_event_log:unit_tests",
265     "//components/devtools_http_handler:unit_tests",
266     "//components/dom_distiller/core:unit_tests",
267     "//components/domain_reliability:unit_tests",
268     "//components/favicon_base:unit_tests",
269     "//components/google/core/browser:unit_tests",
270     "//components/invalidation:unittests",
271     "//components/login:unit_tests",
272     "//components/metrics:unit_tests",
273     "//components/omnibox:unit_tests",
274     "//components/ownership:unit_tests",
275     "//components/packed_ct_ev_whitelist:unit_tests",
276     "//components/undo:unit_tests",
277     "//components/update_client:unit_tests",
278     "//components/variations:unit_tests",
279     "//components/web_resource:unit_tests",
280     "//components/webcrypto:unit_tests",
281     "//components/webdata/common:unit_tests",
283     # These are the deps required by the code in this target.
284     "//base",
285     "//base/test:test_support",
286     "//content/test:test_support",
287     "//ui/base",
288   ]
289   data_deps = [ ":components_tests_pak" ]
291   if (!is_android && !is_ios) {
292     deps += [ "//components/proximity_auth:unit_tests" ]
293   }
295   # TODO(GYP) need this target.
296   #'breakpad/app/crash_keys_win_unittest.cc',
298   # Precache tests need these defines.
299   #configs += [ "//components/precache/core:precache_config" ]
301   if (toolkit_views) {
302     # TODO(GYP) enable this as above.
303     #deps += [ "//components/constrained_window:unit_tests" ]
304   }
305   if (is_win) {
306     deps += [ "//components/browser_watcher:unit_tests" ]
307   }
308   if (is_ios) {
309     deps -= [ "//components/devtools_http_handler:unit_tests" ]
310   }
312   if (!is_ios) {
313     deps += [ "//components/scheduler:unit_tests" ]
314   }
317 repack("components_tests_pak") {
318   sources = [
319     "$root_gen_dir/components/components_resources.pak",
320     "$root_gen_dir/components/strings/components_strings_en-US.pak",
321     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
322     "$root_gen_dir/ui/resources/webui_resources.pak",
323     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
324     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
325   ]
327   output = "$root_out_dir/components_tests_resources.pak"
329   deps = [
330     "//components/resources",
331     "//components/strings",
332     "//ui/resources",
333     "//ui/strings",
334   ]
337 if (is_android) {
338   import("//build/config/android/rules.gni")
340   generate_jni("components_browsertests_jni_headers") {
341     jni_package = "components_browsertests/shell"
342     sources = [
343       "test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsActivity.java",
344     ]
345   }
348 test("components_browsertests") {
349   sources = [
350     "autofill/content/browser/risk/fingerprint_browsertest.cc",
351     "autofill/content/renderer/password_form_conversion_utils_browsertest.cc",
352     "dom_distiller/content/distillable_page_utils_browsertest.cc",
353     "dom_distiller/content/distiller_page_web_contents_browsertest.cc",
354     "password_manager/content/renderer/credential_manager_client_browsertest.cc",
355   ]
357   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
359   deps = [
360     "autofill/content/browser",
361     "autofill/content/renderer",
362     "content_settings/core/common",
363     "dom_distiller/content",
364     "dom_distiller/core",
365     "dom_distiller/core:test_support",
366     "password_manager/content/browser",
367     "password_manager/content/common",
368     "password_manager/content/renderer",
369     "strings",
370     "//base",
371     "//base/test:test_support",
372     "//content/test:browsertest_support",
373     "//content/test:test_support",
375     "//testing/gmock",
376     "//testing/gtest",
377     "//ui/base",
378   ]
380   data_deps = [ ":components_tests_pak" ]
382   if (is_android) {
383     sources += [
384       "test/android/browsertests_apk/components_browser_tests_android.cc",
385       "test/android/browsertests_apk/components_browser_tests_android.h",
386       "test/android/browsertests_apk/components_browser_tests_jni_onload.cc",
387     ]
388     sources -= [ "autofill/content/browser/risk/fingerprint_browsertest.cc" ]
389     deps += [
390       ":components_browsertests_jni_headers",
391       "//testing/android/native_test:native_test_util",
392     ]
394     use_launcher = false
395   }
397   if (is_linux) {
398     # content_extractor_browsertest is a standalone content extraction tool built as
399     # a MANUAL component_browsertest.
400     sources += [ "dom_distiller/standalone/content_extractor_browsertest.cc" ]
401     deps += [
402       "pref_registry:test_support",
403       "//base:prefs_test_support",
404     ]
405   }
408 test("components_perftests") {
409   sources = [
410     "scheduler/child/task_queue_manager_perftest.cc",
411     "visitedlink/test/visitedlink_perftest.cc",
412   ]
414   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
415   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
417   deps = [
418     "//base",
419     "//base/test:test_support_perf",
420     "//testing/gtest",
421     "//testing/perf",
422     "//content/test:test_support",
423     "//components/visitedlink/browser",
424   ]