Compute if a layer is clipped outside CalcDrawProps
[chromium-blink-merge.git] / components / BUILD.gn
blob591d2fd4cdf575ffe6e70b368704c4f4627b2411
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 += [
353       "//components/safe_json:unit_tests",
354       "//components/scheduler:unit_tests",
355     ]
356   }
359 repack("components_tests_pak") {
360   sources = [
361     "$root_gen_dir/components/components_resources.pak",
362     "$root_gen_dir/components/strings/components_strings_en-US.pak",
363   ]
365   output = "$root_out_dir/components_tests_resources.pak"
367   deps = [
368     "//components/resources",
369     "//components/strings",
370   ]
373 test("components_browsertests") {
374   sources = [
375     "autofill/content/browser/risk/fingerprint_browsertest.cc",
376     "autofill/content/renderer/password_form_conversion_utils_browsertest.cc",
377     "dom_distiller/content/distillable_page_utils_browsertest.cc",
378     "dom_distiller/content/distiller_page_web_contents_browsertest.cc",
379     "password_manager/content/renderer/credential_manager_client_browsertest.cc",
380   ]
382   defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
384   deps = [
385     "autofill/content/browser",
386     "autofill/content/renderer",
387     "content_settings/core/common",
388     "dom_distiller/content",
389     "dom_distiller/core",
390     "dom_distiller/core:test_support",
391     "password_manager/content/browser",
392     "password_manager/content/common",
393     "password_manager/content/renderer",
394     "strings",
395     "//base",
396     "//base/test:test_support",
397     "//content/test:browsertest_support",
398     "//content/test:test_support",
399     "//device/bluetooth",
400     "//testing/gmock",
401     "//testing/gtest",
402     "//ui/base",
403   ]
405   data_deps = [ ":components_tests_pak" ]
407   if (is_android) {
408     sources += [ "test/android/browsertests_apk/components_browser_tests_jni_onload.cc" ]
409     sources -= [ "autofill/content/browser/risk/fingerprint_browsertest.cc" ]
410     deps += [ "//testing/android/native_test:native_test_support" ]
411     use_launcher = false
412     isolate_file = "components_browsertests.isolate"
413   }
415   if (is_linux) {
416     # content_extractor_browsertest is a standalone content extraction tool built as
417     # a MANUAL component_browsertest.
418     sources += [ "dom_distiller/standalone/content_extractor_browsertest.cc" ]
419     deps += [
420       "pref_registry:test_support",
421       "//base:prefs_test_support",
422     ]
423   }
426 test("components_perftests") {
427   sources = [
428     "scheduler/child/task_queue_manager_perftest.cc",
429     "visitedlink/test/visitedlink_perftest.cc",
430   ]
432   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
433   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
435   deps = [
436     "//base",
437     "//base/test:test_support_perf",
438     "//testing/gtest",
439     "//testing/perf",
440     "//content/test:test_support",
441     "//components/visitedlink/browser",
442   ]