Roll src/third_party/WebKit a2aeeb7:6373c4f (svn 198318:198336)
[chromium-blink-merge.git] / components / BUILD.gn
blob539002e77e17b49b4ff1359b936022d85c5a8e94
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/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/devtools_service",
43     "//components/dom_distiller/core",
44     "//components/domain_reliability",
45     "//components/enhanced_bookmarks",
46     "//components/favicon/core",
47     "//components/favicon_base",
48     "//components/feedback",
49     "//components/gcm_driver",
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",
62     "//components/login",
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",
70     "//components/onc",
71     "//components/os_crypt",
72     "//components/packed_ct_ev_whitelist",
73     "//components/pairing",
74     "//components/password_manager/content/browser",
75     "//components/password_manager/core/browser",
76     "//components/password_manager/core/common",
77     "//components/pdf/browser",
78     "//components/pdf/common",
79     "//components/pdf/renderer",
80     "//components/plugins/common",
81     "//components/plugins/renderer",
82     "//components/policy",
83     "//components/power",
84     "//components/precache/core",
85     "//components/precache/content",
86     "//components/proxy_config",
87     "//components/pref_registry",
88     "//components/query_parser",
89     "//components/rappor",
90     "//components/renderer_context_menu",
91     "//components/resources:components_resources",
92     "//components/search",
93     "//components/search_engines",
94     "//components/search_provider_logos",
95     "//components/sessions",
96     "//components/signin/core/browser",
97     "//components/startup_metric_utils",
98     "//components/strings",
99     "//components/sync_driver",
100     "//components/tracing",
101     "//components/tracing:startup_tracing",
102     "//components/translate/content/browser",
103     "//components/translate/content/common",
104     "//components/translate/content/renderer",
105     "//components/translate/core/browser",
106     "//components/translate/core/common",
107     "//components/ui/zoom:ui_zoom",
108     "//components/undo",
109     "//components/update_client",
110     "//components/url_fixer",
111     "//components/url_matcher",
112     "//components/user_manager",
113     "//components/user_prefs",
114     "//components/variations",
115     "//components/visitedlink/browser",
116     "//components/visitedlink/common",
117     "//components/visitedlink/renderer",
118     "//components/wallpaper",
119     "//components/web_cache/browser",
120     "//components/web_cache/common",
121     "//components/web_cache/renderer",
122     "//components/web_modal",
123     "//components/web_resource",
124     "//components/webcrypto",
125     "//components/webdata/common",
126     "//components/wifi",
127     "//components/wifi_sync",
128   ]
130   if (!is_android && !is_ios) {
131     deps += [
132       "//components/proximity_auth",
133       "//components/proximity_auth/cryptauth",
134     ]
135   }
137   if (!enable_configuration_policy) {
138     deps -= [ "//components/policy" ]
139   }
141   if (!is_win && !is_mac) {
142     deps -= [ "//components/wifi" ]
143   }
144   if (!is_chromeos) {
145     deps -= [
146       "//components/pairing",
147       "//components/wifi_sync",
148     ]
149   }
151   if (!is_chromeos || !enable_extensions) {
152     deps -= [ "//components/chrome_apps" ]
153   }
155   if (is_ios) {
156     deps -= [
157       "//components/history/content/browser",
158       "//components/keyed_service/content",
159     ]
160   }
162   if (!enable_plugins) {
163     deps -= [
164       "//components/pdf/browser",
165       "//components/pdf/common",
166       "//components/pdf/renderer",
167     ]
168   }
170   if (is_android) {
171     deps -= [
172       "//components/autofill/content/browser",  # Blocked on content/blink.
173       "//components/autofill/content/common",  # Blocked on content.
174       "//components/autofill/content/renderer",  # Blocked on content/blink.
175       "//components/crash/app",  # Should work, needs checking.
176       "//components/crash/browser",  # Should work, needs checking.
177       "//components/captive_portal",  # Should work, needs checking.
178       "//components/cloud_devices/common",  # Should work, needs checking.
179       "//components/cdm/browser",  # Blocked on content.
180       "//components/cdm/common",  # Blocked on content.
181       "//components/cdm/renderer",  # Blocked on content.
182       "//components/data_reduction_proxy/core/browser",  # Should work, needs checking.
183       "//components/data_reduction_proxy/core/common",  # Should work, needs checking.
184       "//components/dom_distiller/core",  # Blocked on content.
185       "//components/domain_reliability",  # Blocked on content.
186       "//components/favicon/core",  # Blocked on keyed service.
187       "//components/favicon_base",  # Should work, needs checking.
188       "//components/feedback",  # Blocked on content.
189       "//components/gcm_driver",  # Should work, needs checking.
190       "//components/gcm_driver/instance_id",  # Should work, needs checking.
191       "//components/google/core/browser",  # Should work, needs checking.
192       "//components/history/core/browser",  # Should work, needs checking.
193       "//components/history/core/common",  # Should work, needs checking.
194       "//components/history/core/test",  # Should work, needs checking.
195       "//components/infobars/core",  # Should work, needs checking.
196       "//components/invalidation/impl",  # Should work, needs checking.
197       "//components/json_schema",  # Should work, needs checking.
198       "//components/keyed_service/content",  # Blocked on content.
199       "//components/navigation_interception",  # Blocked on content.
200       "//components/omnibox",  # Should work, needs checking.
201       "//components/password_manager/content/browser",  # Blocked on content.
202       "//components/password_manager/core/browser",  # Should work, needs checking.
203       "//components/password_manager/core/common",  # Should work, needs checking.
204       "//components/plugins/renderer",  # Blocked on blink.
205       "//components/power",  # Blocked on content.
206       "//components/policy",  # Blocked on content (indirectly via autofill).
207       "//components/precache/content",  # Blocked on content.
208       "//components/precache/core",  # Should work, needs checking.
209       "//components/rappor",  # Should work, needs checking.
210       "//components/renderer_context_menu",  # Blocked on content.
211       "//components/search_engines",  # Should work, needs checking.
212       "//components/search_provider_logos",  # Should work, needs checking.
213       "//components/sessions",  # Blocked on content.
214       "//components/signin/core/browser",  # Should work, needs checking.
215       "//components/translate/content/browser",  # Blocked on content.
216       "//components/translate/content/common",  # Blocked on content.
217       "//components/translate/content/renderer",  # Blocked on content.
218       "//components/user_prefs",  # Blocked on content.
219       "//components/visitedlink/browser",  # Blocked on content.
220       "//components/visitedlink/common",  # Blocked on content.
221       "//components/visitedlink/renderer",  # Blocked on blink
222       "//components/web_cache/browser",  # Blocked on content and blink.
223       "//components/web_cache/renderer",  # Blocked on content and blink.
224       "//components/web_modal",  # Blocked on content.
225     ]
226   }
228   if (!is_ios && !is_android) {
229     deps += [
230       "//components/copresence",
231       "//components/storage_monitor",
232     ]
233   }
235   if (!is_ios) {
236     deps += [
237       "//components/app_modal",
238       "//components/browsing_data",
239       "//components/guest_view/browser",
240       "//components/guest_view/common",
241       "//components/guest_view/renderer",
242       "//components/safe_json",
243       "//components/scheduler",
244       "//components/test_runner",
245     ]
246   }
248   if (toolkit_views) {
249     deps += [ "//components/constrained_window" ]
250   }
253 # To add a unit test to this target, make a "unit_test" source_set in your
254 # component (it's important to use a source_set instead of a static library or
255 # no tests will run) and add a reference here. You can add more than one unit
256 # test target if convenient.
257 test("components_unittests") {
258   sources = [
259     "test/run_all_unittests.cc",
260   ]
262   # Add only ":unit_tests" dependencies here. If your tests have dependencies
263   # (this would at least include the component itself), they should be on the
264   # test source set and not here.
265   deps = [
266     "//components/auto_login_parser:unit_tests",
267     "//components/autofill/content/browser:unit_tests",
268     "//components/autofill/core/browser:unit_tests",
269     "//components/autofill/core/common:unit_tests",
270     "//components/bookmarks/browser:unit_tests",
271     "//components/bookmarks/managed:unit_tests",
272     "//components/captive_portal:unit_tests",
273     "//components/cloud_devices/common:unit_tests",
274     "//components/component_updater:unit_tests",
275     "//components/content_settings/core/browser:unit_tests",
276     "//components/content_settings/core/common:unit_tests",
277     "//components/crx_file:unit_tests",
278     "//components/data_reduction_proxy/content/browser:unit_tests",
279     "//components/data_reduction_proxy/core/browser:unit_tests",
280     "//components/data_reduction_proxy/core/common:unit_tests",
281     "//components/device_event_log:unit_tests",
282     "//components/devtools_http_handler:unit_tests",
283     "//components/dom_distiller/core:unit_tests",
284     "//components/domain_reliability:unit_tests",
285     "//components/favicon_base:unit_tests",
286     "//components/google/core/browser:unit_tests",
287     "//components/invalidation/impl:unittests",
288     "//components/login:unit_tests",
289     "//components/metrics:unit_tests",
290     "//components/mime_util:unit_tests",
291     "//components/offline_pages:unit_tests",
292     "//components/omnibox:unit_tests",
293     "//components/packed_ct_ev_whitelist:unit_tests",
294     "//components/undo:unit_tests",
295     "//components/update_client:unit_tests",
296     "//components/variations:unit_tests",
297     "//components/web_resource:unit_tests",
298     "//components/webcrypto:unit_tests",
299     "//components/webdata/common:unit_tests",
301     # These are the deps required by the code in this target.
302     "//base",
303     "//base/test:test_support",
304     "//content/test:test_support",
305     "//net",
306     "//ui/base",
307     "//ui/resources:ui_test_pak",
308   ]
310   if (is_android) {
311     isolate_file = "components_unittests.isolate"
312   }
314   data_deps = [ ":components_tests_pak" ]
316   if (is_android) {
317     deps += [ "//content/public/android:content_java" ]
318   }
320   if (!is_android && !is_ios) {
321     deps += [ "//components/proximity_auth:unit_tests" ]
322   }
324   if (is_chromeos) {
325     deps += [ "//components/ownership:unit_tests" ]
326   }
328   # TODO(GYP) need this target.
329   #'breakpad/app/crash_keys_win_unittest.cc',
331   # Precache tests need these defines.
332   #configs += [ "//components/precache/core:precache_config" ]
334   if (toolkit_views) {
335     # TODO(GYP) enable this as above.
336     #deps += [ "//components/constrained_window:unit_tests" ]
337   }
338   if (is_win) {
339     deps += [ "//components/browser_watcher:unit_tests" ]
340   }
341   if (is_ios) {
342     deps -= [ "//components/devtools_http_handler:unit_tests" ]
343   }
345   if (!is_ios) {
346     deps += [ "//components/scheduler:unit_tests" ]
347   }
350 repack("components_tests_pak") {
351   sources = [
352     "$root_gen_dir/components/components_resources.pak",
353     "$root_gen_dir/components/strings/components_strings_en-US.pak",
354   ]
356   output = "$root_out_dir/components_tests_resources.pak"
358   deps = [
359     "//components/resources",
360     "//components/strings",
361   ]
364 test("components_browsertests") {
365   sources = [
366     "autofill/content/browser/risk/fingerprint_browsertest.cc",
367     "autofill/content/renderer/password_form_conversion_utils_browsertest.cc",
368     "dom_distiller/content/distillable_page_utils_browsertest.cc",
369     "dom_distiller/content/distiller_page_web_contents_browsertest.cc",
370     "password_manager/content/renderer/credential_manager_client_browsertest.cc",
371   ]
373   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
375   deps = [
376     "autofill/content/browser",
377     "autofill/content/renderer",
378     "content_settings/core/common",
379     "dom_distiller/content",
380     "dom_distiller/core",
381     "dom_distiller/core:test_support",
382     "password_manager/content/browser",
383     "password_manager/content/common",
384     "password_manager/content/renderer",
385     "strings",
386     "//base",
387     "//base/test:test_support",
388     "//content/test:browsertest_support",
389     "//content/test:test_support",
390     "//device/bluetooth",
391     "//testing/gmock",
392     "//testing/gtest",
393     "//ui/base",
394   ]
396   data_deps = [ ":components_tests_pak" ]
398   if (is_android) {
399     sources += [ "test/android/browsertests_apk/components_browser_tests_jni_onload.cc" ]
400     sources -= [ "autofill/content/browser/risk/fingerprint_browsertest.cc" ]
401     deps += [ "//testing/android/native_test:native_test_support" ]
402     use_launcher = false
403     isolate_file = "components_browsertests.isolate"
404   }
406   if (is_linux) {
407     # content_extractor_browsertest is a standalone content extraction tool built as
408     # a MANUAL component_browsertest.
409     sources += [ "dom_distiller/standalone/content_extractor_browsertest.cc" ]
410     deps += [
411       "pref_registry:test_support",
412       "//base:prefs_test_support",
413     ]
414   }
417 test("components_perftests") {
418   sources = [
419     "scheduler/child/task_queue_manager_perftest.cc",
420     "visitedlink/test/visitedlink_perftest.cc",
421   ]
423   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
424   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
426   deps = [
427     "//base",
428     "//base/test:test_support_perf",
429     "//testing/gtest",
430     "//testing/perf",
431     "//content/test:test_support",
432     "//components/visitedlink/browser",
433   ]