Make castv2 performance test work.
[chromium-blink-merge.git] / components / BUILD.gn
blob93aa8249b13221f689d796b8f45235dc13b0ecdc
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/dom_distiller/core",
40     "//components/domain_reliability",
41     "//components/enhanced_bookmarks",
42     "//components/favicon/core",
43     "//components/favicon_base",
44     "//components/feedback",
45     "//components/gcm_driver",
46     "//components/google/core/browser",
47     "//components/history/content/browser",
48     "//components/history/core/browser",
49     "//components/history/core/common",
50     "//components/history/core/test",
51     "//components/infobars/core",
52     "//components/invalidation",
53     "//components/json_schema",
54     "//components/keyed_service/content",
55     "//components/language_usage_metrics",
56     "//components/leveldb_proto",
57     "//components/login",
58     "//components/metrics",
59     "//components/navigation_interception",
60     "//components/navigation_metrics",
61     "//components/network_time",
62     "//components/omnibox",
63     "//components/onc",
64     "//components/os_crypt",
65     "//components/packed_ct_ev_whitelist",
66     "//components/pairing",
67     "//components/password_manager/content/browser",
68     "//components/password_manager/core/browser",
69     "//components/password_manager/core/common",
70     "//components/pdf/browser",
71     "//components/pdf/common",
72     "//components/pdf/renderer",
73     "//components/plugins/renderer",
74     "//components/policy",
75     "//components/power",
76     "//components/precache/core",
77     "//components/precache/content",
78     "//components/pref_registry",
79     "//components/proximity_auth",
80     "//components/proximity_auth/cryptauth",
81     "//components/query_parser",
82     "//components/rappor",
83     "//components/renderer_context_menu",
84     "//components/resources:components_resources",
85     "//components/search",
86     "//components/search_engines",
87     "//components/search_provider_logos",
88     "//components/sessions:sessions_content",
89     "//components/signin/core/browser",
90     "//components/startup_metric_utils",
91     "//components/strings",
92     "//components/sync_driver",
93     "//components/tracing",
94     "//components/translate/content/browser",
95     "//components/translate/content/common",
96     "//components/translate/content/renderer",
97     "//components/translate/core/browser",
98     "//components/translate/core/common",
99     "//components/ui/zoom:ui_zoom",
100     "//components/update_client",
101     "//components/url_fixer",
102     "//components/url_matcher",
103     "//components/user_manager",
104     "//components/user_prefs",
105     "//components/variations",
106     "//components/visitedlink/browser",
107     "//components/visitedlink/common",
108     "//components/visitedlink/renderer",
109     "//components/wallpaper",
110     "//components/web_cache/browser",
111     "//components/web_cache/common",
112     "//components/web_cache/renderer",
113     "//components/web_modal",
114     "//components/web_resource",
115     "//components/webdata/common",
116     "//components/webui_generator",
117     "//components/wifi",
118     "//components/wifi_sync",
119   ]
121   if (!enable_configuration_policy) {
122     deps -= [ "//components/policy" ]
123   }
125   if (!is_win && !is_mac) {
126     deps -= [ "//components/wifi" ]
127   }
128   if (!is_chromeos) {
129     deps -= [
130       "//components/pairing",
131       "//components/wifi_sync",
132     ]
133   }
134   if (is_ios) {
135     deps -= [
136       "//components/history/content/browser",
137       "//components/keyed_service/content",
138       "//components/webui_generator",
139     ]
140   }
142   if (!enable_plugins) {
143     deps -= [
144       "//components/pdf/browser",
145       "//components/pdf/common",
146       "//components/pdf/renderer",
147     ]
148   }
150   if (is_android) {
151     deps -= [
152       "//components/autofill/content/browser",  # Blocked on content/blink.
153       "//components/autofill/content/common",  # Blocked on content.
154       "//components/autofill/content/renderer",  # Blocked on content/blink.
155       "//components/crash/app",  # Should work, needs checking.
156       "//components/crash/browser",  # Should work, needs checking.
157       "//components/captive_portal",  # Should work, needs checking.
158       "//components/cloud_devices/common",  # Should work, needs checking.
159       "//components/cdm/browser",  # Blocked on content.
160       "//components/cdm/common",  # Blocked on content.
161       "//components/cdm/renderer",  # Blocked on content.
162       "//components/data_reduction_proxy/core/browser",  # Should work, needs checking.
163       "//components/data_reduction_proxy/core/common",  # Should work, needs checking.
164       "//components/dom_distiller/core",  # Blocked on content.
165       "//components/domain_reliability",  # Blocked on content.
166       "//components/favicon/core",  # Blocked on keyed service.
167       "//components/favicon_base",  # Should work, needs checking.
168       "//components/feedback",  # Blocked on content.
169       "//components/gcm_driver",  # Should work, needs checking.
170       "//components/google/core/browser",  # Should work, needs checking.
171       "//components/history/core/browser",  # Should work, needs checking.
172       "//components/history/core/common",  # Should work, needs checking.
173       "//components/history/core/test",  # Should work, needs checking.
174       "//components/infobars/core",  # Should work, needs checking.
175       "//components/invalidation",  # Should work, needs checking.
176       "//components/json_schema",  # Should work, needs checking.
177       "//components/keyed_service/content",  # Blocked on content.
178       "//components/navigation_interception",  # Blocked on content.
179       "//components/omnibox",  # Should work, needs checking.
180       "//components/password_manager/content/browser",  # Blocked on content.
181       "//components/password_manager/core/browser",  # Should work, needs checking.
182       "//components/password_manager/core/common",  # Should work, needs checking.
183       "//components/plugins/renderer",  # Blocked on blink.
184       "//components/power",  # Blocked on content.
185       "//components/policy",  # Blocked on content (indirectly via autofill).
186       "//components/precache/content",  # Blocked on content.
187       "//components/precache/core",  # Should work, needs checking.
188       "//components/rappor",  # Should work, needs checking.
189       "//components/renderer_context_menu",  # Blocked on content.
190       "//components/search_engines",  # Should work, needs checking.
191       "//components/search_provider_logos",  # Should work, needs checking.
192       "//components/sessions:sessions_content",  # Blocked on content.
193       "//components/signin/core/browser",  # Should work, needs checking.
194       "//components/translate/content/browser",  # Blocked on content.
195       "//components/translate/content/common",  # Blocked on content.
196       "//components/translate/content/renderer",  # Blocked on content.
197       "//components/user_prefs",  # Blocked on content.
198       "//components/visitedlink/browser",  # Blocked on content.
199       "//components/visitedlink/common",  # Blocked on content.
200       "//components/visitedlink/renderer",  # Blocked on blink
201       "//components/web_cache/browser",  # Blocked on content and blink.
202       "//components/web_cache/renderer",  # Blocked on content and blink.
203       "//components/web_modal",  # Blocked on content.
204     ]
205   }
207   if (!is_ios && !is_android) {
208     deps += [
209       "//components/copresence",
210       "//components/storage_monitor",
211     ]
212   }
214   if (!is_ios) {
215     deps += [
216       "//components/app_modal",
217       "//components/browsing_data",
218     ]
219   }
221   if (toolkit_views) {
222     deps += [ "//components/constrained_window" ]
223   }
226 # To add a unit test to this target, make a "unit_test" source_set in your
227 # component (it's important to use a source_set instead of a static library or
228 # no tests will run) and add a reference here. You can add more than one unit
229 # test target if convenient.
230 test("components_unittests") {
231   sources = [
232     "test/run_all_unittests.cc",
233   ]
235   # Add only ":unit_tests" dependencies here. If your tests have dependencies
236   # (this would at least include the component itself), they should be on the
237   # test source set and not here.
238   deps = [
239     "//components/auto_login_parser:unit_tests",
240     "//components/autofill/content/browser:unit_tests",
241     "//components/autofill/core/browser:unit_tests",
242     "//components/autofill/core/common:unit_tests",
243     "//components/bookmarks/browser:unit_tests",
244     "//components/bookmarks/managed:unit_tests",
245     "//components/captive_portal:unit_tests",
246     "//components/cloud_devices/common:unit_tests",
247     "//components/content_settings/core/browser:unit_tests",
248     "//components/content_settings/core/common:unit_tests",
249     "//components/crx_file:unit_tests",
250     "//components/data_reduction_proxy/content/browser:unit_tests",
251     "//components/data_reduction_proxy/core/browser:unit_tests",
252     "//components/data_reduction_proxy/core/common:unit_tests",
253     "//components/device_event_log:unit_tests",
254     "//components/dom_distiller/core:unit_tests",
255     "//components/domain_reliability:unit_tests",
256     "//components/favicon_base:unit_tests",
257     "//components/google/core/browser:unit_tests",
258     "//components/invalidation:unittests",
259     "//components/login:unit_tests",
260     "//components/metrics:unit_tests",
261     "//components/omnibox:unit_tests",
262     "//components/ownership:unit_tests",
263     "//components/packed_ct_ev_whitelist:unit_tests",
264     "//components/proximity_auth:unit_tests",
265     "//components/update_client:unit_tests",
266     "//components/variations:unit_tests",
267     "//components/web_resource:unit_tests",
268     "//components/webdata/common:unit_tests",
270     # These are the deps required by the code in this target.
271     "//base",
272     "//base/test:test_support",
273     "//content/test:test_support",
274     "//ui/base",
275   ]
276   data_deps = [ ":components_tests_pak" ]
278   # TODO(GYP) need this target.
279   #'breakpad/app/crash_keys_win_unittest.cc',
281   # Precache tests need these defines.
282   #configs += [ "//components/precache/core:precache_config" ]
284   if (toolkit_views) {
285     # TODO(GYP) enable this as above.
286     #deps += [ "//components/constrained_window:unit_tests" ]
287   }
288   if (is_win) {
289     deps += [ "//components/browser_watcher:unit_tests" ]
290   }
293 repack("components_tests_pak") {
294   sources = [
295     "$root_gen_dir/components/components_resources.pak",
296     "$root_gen_dir/components/strings/components_strings_en-US.pak",
297     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
298     "$root_gen_dir/ui/resources/webui_resources.pak",
299     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
300     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
301   ]
303   output = "$root_out_dir/components_tests_resources.pak"
305   deps = [
306     "//components/resources",
307     "//components/strings",
308     "//ui/resources",
309     "//ui/strings",
310   ]
313 test("components_browsertests") {
314   sources = [
315     "autofill/content/browser/risk/fingerprint_browsertest.cc",
316     "autofill/content/renderer/password_form_conversion_utils_browsertest.cc",
317     "dom_distiller/content/distillable_page_utils_browsertest.cc",
318     "dom_distiller/content/distiller_page_web_contents_browsertest.cc",
319     "password_manager/content/renderer/credential_manager_client_browsertest.cc",
320   ]
322   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
324   deps = [
325     "autofill/content/browser",
326     "autofill/content/renderer",
327     "content_settings/core/common",
328     "dom_distiller/content",
329     "dom_distiller/core",
330     "dom_distiller/core:test_support",
331     "password_manager/content/browser",
332     "password_manager/content/common",
333     "password_manager/content/renderer",
334     "strings",
335     "//base",
336     "//base/test:test_support",
337     "//content/test:browsertest_support",
338     "//content/test:test_support",
340     "//testing/gmock",
341     "//testing/gtest",
342     "//ui/base",
343   ]
345   data_deps = [ ":components_tests_pak" ]
347   if (is_android) {
348     sources -= [ "autofill/content/browser/risk/fingerprint_browsertest.cc" ]
349   }
351   if (is_linux) {
352     # content_extractor_browsertest is a standalone content extraction tool built as
353     # a MANUAL component_browsertest.
354     sources += [ "dom_distiller/standalone/content_extractor_browsertest.cc" ]
355     deps += [
356       "pref_registry:test_support",
357       "//base:prefs_test_support",
358     ]
359   }
362 test("components_perftests") {
363   sources = [
364     "visitedlink/test/visitedlink_perftest.cc",
365   ]
367   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
368   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
370   deps = [
371     "//base",
372     "//base/test:test_support_perf",
373     "//testing/gtest",
374     "//content/test:test_support",
375     "//components/visitedlink/browser",
376   ]