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