BUILD.gn 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680
  1. # Copyright (c) 2013 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.
  4. # This is the root build file for GN. GN will start processing by loading this
  5. # file, and recursively load all dependencies until all dependencies are either
  6. # resolved or known not to exist (which will cause the build to fail). So if
  7. # you add a new build file, there must be some path of dependencies from this
  8. # file to your new one or GN won't know about it.
  9. import("//build/config/chromeos/ui_mode.gni")
  10. import("//build/config/compiler/compiler.gni")
  11. import("//build/config/dcheck_always_on.gni")
  12. import("//build/config/features.gni")
  13. import("//build/config/rust.gni")
  14. import("//build/config/sanitizers/sanitizers.gni")
  15. import("//build/config/ui.gni")
  16. import("//build/gn_logs.gni")
  17. import("//build/util/generate_wrapper.gni")
  18. import("//chrome/browser/buildflags.gni")
  19. import("//chrome/browser/media/router/features.gni")
  20. import("//components/nacl/features.gni")
  21. import("//device/vr/buildflags/buildflags.gni")
  22. import("//extensions/buildflags/buildflags.gni")
  23. import("//gpu/vulkan/features.gni")
  24. import("//media/gpu/args.gni")
  25. import("//media/media_options.gni")
  26. import("//pdf/features.gni")
  27. import("//ppapi/buildflags/buildflags.gni")
  28. import("//printing/buildflags/buildflags.gni")
  29. import("//remoting/remoting_enable.gni")
  30. import("//third_party/closure_compiler/compile_js.gni")
  31. import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
  32. import("//ui/base/ui_features.gni")
  33. import("//ui/gl/features.gni")
  34. import("//v8/gni/v8.gni")
  35. if (is_android) {
  36. import("//build/config/android/config.gni")
  37. }
  38. if (is_linux) {
  39. import("build/config/linux/gtk/gtk.gni")
  40. }
  41. if (!is_ios) {
  42. import("//v8/gni/snapshot_toolchain.gni")
  43. }
  44. declare_args() {
  45. # A list of extra dependencies to add to the root target. This allows a
  46. # checkout to add additional targets without explicitly changing any checked-
  47. # in files.
  48. root_extra_deps = []
  49. }
  50. if (is_official_build) {
  51. # An official (maximally optimized!) component (optimized for build times)
  52. # build doesn't make sense and usually doesn't work.
  53. assert(!is_component_build)
  54. }
  55. # This file defines the following two main targets:
  56. #
  57. # "gn_all" is used to create explicit dependencies from the root BUILD.gn to
  58. # each top-level component that we wish to include when building everything via
  59. # "all". This is required since the set of targets built by "all" is determined
  60. # automatically based on reachability from the root BUILD.gn (for details, see
  61. # crbug.com/503241). Builders should typically use "all", or list targets
  62. # explicitly, rather than relying on "gn_all".
  63. #
  64. # "gn_visibility": targets that are normally not visible to top-level targets,
  65. # but are built anyway by "all". Since we don't want any such targets, we have
  66. # this placeholder to make sure hidden targets that aren't otherwise depended
  67. # on yet are accounted for.
  68. group("gn_all") {
  69. testonly = true
  70. deps = [
  71. ":gn_visibility",
  72. "//base:base_perftests",
  73. "//base:base_unittests",
  74. "//chrome/installer",
  75. "//chrome/updater",
  76. "//codelabs",
  77. "//components:components_unittests",
  78. "//components/gwp_asan:gwp_asan_unittests",
  79. "//infra/orchestrator:orchestrator_all",
  80. "//net:net_unittests",
  81. "//services:services_unittests",
  82. "//services/service_manager/public/cpp",
  83. "//skia:skia_unittests",
  84. "//sql:sql_unittests",
  85. "//third_party/angle/src/tests:angle_end2end_tests",
  86. "//third_party/angle/src/tests:angle_unittests",
  87. "//third_party/angle/src/tests:angle_white_box_tests",
  88. "//third_party/flatbuffers:flatbuffers_unittests",
  89. "//third_party/liburlpattern:liburlpattern_unittests",
  90. "//tools/binary_size:binary_size_trybot_py",
  91. "//tools/ipc_fuzzer:ipc_fuzzer_all",
  92. "//tools/metrics:metrics_metadata",
  93. "//ui/base:ui_base_unittests",
  94. "//ui/color:color_unittests",
  95. "//ui/gfx:gfx_unittests",
  96. "//url:url_unittests",
  97. ]
  98. if (!is_component_build) {
  99. deps += [ "//third_party/abseil-cpp:absl_tests" ]
  100. }
  101. if (!is_android && !is_chromecast) {
  102. deps += [
  103. "//crypto:crypto_unittests",
  104. "//google_apis/gcm:gcm_unit_tests",
  105. ]
  106. }
  107. if (enable_js_type_check) {
  108. deps += [ ":webui_closure_compile" ]
  109. }
  110. if (!is_ios && !is_android && !is_chromecast) {
  111. deps += [
  112. "//ui/accessibility:accessibility_perftests",
  113. "//ui/accessibility:accessibility_unittests",
  114. "//ui/accessibility/extensions:extension_tests",
  115. "//ui/accessibility/extensions:extensions",
  116. ]
  117. }
  118. if (!is_ios && !is_android && !is_chromecast) {
  119. deps += [
  120. "//content/nw:nwjs",
  121. "//chrome",
  122. "//chrome/browser/ui/color:dump_colors",
  123. "//chrome/test:browser_tests",
  124. "//chrome/test:interactive_ui_tests",
  125. "//chrome/test:sync_integration_tests",
  126. "//components/subresource_filter/tools:subresource_filter_tools",
  127. "//components/zucchini:zucchini",
  128. "//components/zucchini:zucchini_unittests",
  129. "//gpu/gles2_conform_support:gles2_conform_test",
  130. "//gpu/khronos_glcts_support:khronos_glcts_test",
  131. "//net:hpack_example_generator",
  132. "//third_party/vulkan-deps/spirv-tools/src:SPIRV-Tools",
  133. "//tools/aggregation_service:aggregation_service_tool",
  134. "//tools/attribution_reporting:attribution_reporting_simulator",
  135. "//tools/perf/clear_system_cache",
  136. "//tools/polymer:polymer_tools_python_unittests",
  137. "//tools/privacy_budget:privacy_budget_tools",
  138. ]
  139. }
  140. if (enable_plugins) {
  141. deps += [
  142. "//ppapi:ppapi_unittests",
  143. "//ppapi/examples",
  144. ]
  145. }
  146. if (is_chromeos_lacros) {
  147. deps += [
  148. "//chrome/test:lacros_chrome_browsertests",
  149. "//chrome/test:lacros_chrome_unittests",
  150. ]
  151. }
  152. if (!is_ios) {
  153. deps += [
  154. ":chromedriver",
  155. "//cc:cc_unittests",
  156. "//chrome/test:unit_tests",
  157. "//components:components_browsertests",
  158. "//components/policy:policy_templates",
  159. "//components/url_formatter/tools:format_url",
  160. "//components/viz:viz_perftests",
  161. "//components/viz:viz_unittests",
  162. "//content/shell:content_shell",
  163. "//content/test:content_browsertests",
  164. "//content/test:content_unittests",
  165. "//device:device_unittests",
  166. "//gpu:gpu_benchmark",
  167. "//gpu:gpu_unittests",
  168. "//ipc:ipc_tests",
  169. "//media:media_unittests",
  170. "//media/capture:capture_unittests",
  171. "//media/midi:midi_unittests",
  172. "//media/mojo:media_mojo_unittests",
  173. "//mojo",
  174. "//mojo:mojo_unittests",
  175. "//net:net_perftests",
  176. "//storage:storage_unittests",
  177. "//third_party/blink/common:blink_common_unittests",
  178. "//third_party/blink/renderer/controller:blink_unittests",
  179. "//third_party/blink/renderer/platform:blink_platform_unittests",
  180. "//third_party/blink/renderer/platform/heap:blink_heap_unittests",
  181. "//third_party/blink/renderer/platform/wtf:wtf_unittests",
  182. "//third_party/libjingle_xmpp:libjingle_xmpp_unittests",
  183. "//tools/imagediff",
  184. "//ui/display:display_unittests",
  185. "//ui/events:events_unittests",
  186. "//ui/gl:gl_unittests",
  187. "//ui/latency:latency_unittests",
  188. "//ui/native_theme:native_theme_unittests",
  189. "//ui/touch_selection:ui_touch_selection_unittests",
  190. "//url/ipc:url_ipc_unittests",
  191. "//v8:gn_all",
  192. ]
  193. }
  194. if (is_win || is_linux || is_android) {
  195. deps += [
  196. "//weblayer/shell:weblayer_shell",
  197. "//weblayer/test:weblayer_browsertests",
  198. "//weblayer/test:weblayer_unittests",
  199. ]
  200. if (is_android) {
  201. deps += [
  202. "//weblayer/browser/android/javatests:weblayer_instrumentation_test_apk",
  203. "//weblayer/browser/java:weblayer_junit_tests",
  204. ]
  205. }
  206. }
  207. if (false && !is_ios && !is_android) {
  208. deps += [ "//components/viz/demo:viz_demo" ]
  209. if (!use_libfuzzer) {
  210. # TODO(crbug.com/1241949): libcronet.$version.so fails to link in libfuzzer builds.
  211. deps += [
  212. "//components/cronet:cronet_tests",
  213. "//components/cronet:cronet_unittests",
  214. ]
  215. }
  216. }
  217. if (enable_openscreen) {
  218. deps += [ "//chrome/browser/media/router:openscreen_unittests" ]
  219. }
  220. if (!is_ios) {
  221. deps += [
  222. "//google_apis/gcm:mcs_probe",
  223. "//media/cast:cast_unittests",
  224. "//third_party/catapult/telemetry:bitmaptools($host_toolchain)",
  225. ]
  226. if (!is_android) {
  227. deps += [ "//chrome/test:telemetry_perf_unittests" ]
  228. } else {
  229. import("//tools/perf/chrome_telemetry_build/android_browser_types.gni")
  230. foreach(_target_suffix, telemetry_android_browser_target_suffixes) {
  231. deps += [ "//chrome/test:telemetry_perf_unittests${_target_suffix}" ]
  232. }
  233. }
  234. } else {
  235. deps += [
  236. "//ios:all",
  237. "//third_party/crashpad/crashpad:crashpad_tests",
  238. ]
  239. }
  240. if (is_fuchsia && !is_chromecast) {
  241. deps += [
  242. ":d8_fuchsia",
  243. "//fuchsia/engine:web_engine",
  244. "//fuchsia/release:fuchsia_sizes",
  245. "//fuchsia/runners:cast_runner",
  246. "//fuchsia/runners:web_runner",
  247. # Ensure this target, used by cipd, is built in all configurations.
  248. # TODO(crbug.com/1265618): Remove this once it has a natural dependency.
  249. "//media/cdm/library_cdm/clear_key_cdm",
  250. # Ensure this target continues to build.
  251. "//chromecast/bindings:bindings_manager_fuchsia",
  252. ]
  253. if (is_official_build) {
  254. deps += [ "//fuchsia/cipd" ]
  255. }
  256. }
  257. deps += root_extra_deps
  258. if (enable_basic_printing) {
  259. deps += [ "//printing:printing_unittests" ]
  260. }
  261. if (enable_extensions) {
  262. deps += [
  263. "//extensions:extensions_browsertests",
  264. "//extensions:extensions_unittests",
  265. "//extensions/browser/api/declarative_net_request/filter_list_converter",
  266. "//extensions/shell:app_shell_unittests",
  267. ]
  268. }
  269. if (enable_pdf) {
  270. deps += [
  271. "//pdf/pdfium/fuzzers",
  272. "//third_party/pdfium/samples:pdfium_test",
  273. ]
  274. }
  275. if (enable_remoting) {
  276. deps += [ "//remoting:remoting_all" ]
  277. }
  278. if (toolkit_views) {
  279. deps += [
  280. "//ui/views:views_unittests",
  281. "//ui/views/examples:views_examples",
  282. "//ui/views/examples:views_examples_unittests",
  283. "//ui/views/examples:views_examples_with_content",
  284. ]
  285. }
  286. if (use_aura) {
  287. deps += [
  288. "//ui/aura:aura_demo",
  289. "//ui/aura:aura_unittests",
  290. "//ui/wm:wm_unittests",
  291. ]
  292. }
  293. if (use_ozone) {
  294. deps += [
  295. "//ui/ozone",
  296. "//ui/ozone:unittests",
  297. "//ui/ozone/demo",
  298. ]
  299. }
  300. if (is_win) {
  301. deps += [
  302. "//chrome/credential_provider",
  303. "//chrome/credential_provider/test:gcp_unittests",
  304. ]
  305. }
  306. if (is_win && (target_cpu == "x86" || target_cpu == "x64")) {
  307. deps += [ "//chrome/browser/browser_switcher/bho:browser_switcher_dlls" ]
  308. }
  309. if (is_win || is_linux) {
  310. deps += [ "//tools/traffic_annotation/auditor:traffic_annotation_auditor" ]
  311. }
  312. if (is_mac) {
  313. deps += [
  314. "//chrome/installer/gcapi_mac:gcapi_example",
  315. "//tools/mac/power:all",
  316. ]
  317. }
  318. # Allow building md5sum tool for other OSes (android is added below).
  319. # For Windows, see: crbug.com/1090428.
  320. # TODO(cavalcantii): move it out of 'android' folder.
  321. if (!is_win) {
  322. deps += [ "//tools/android/md5sum" ]
  323. }
  324. if (is_android) {
  325. deps += [
  326. "//android_webview/js_sandbox/javatests:webview_js_sandbox_test_app",
  327. "//base:base_junit_tests",
  328. "//base/android/jni_generator:jni_generator_tests",
  329. "//base/android/linker:chromium_android_linker",
  330. "//build/android/gyp/test:hello_world",
  331. "//build/android/stacktrace:java_deobfuscate",
  332. "//build/config/android/test/proto:test_build_protos",
  333. "//chrome/android/monochrome:monochrome_public_apk_checker",
  334. "//chrome/android/webapk/shell_apk:maps_go_webapk",
  335. "//chrome/android/webapk/shell_apk:webapk",
  336. "//chrome/android/webapk/shell_apk/prepare_upload_dir:prepare_webapk_shell_upload_dir",
  337. "//chrome/test:android_browsertests",
  338. "//components:components_junit_tests",
  339. "//content/public/android:content_junit_tests",
  340. "//content/shell/android:content_shell_apk",
  341. "//device:device_junit_tests",
  342. "//media/gpu:video_decode_accelerator_unittest",
  343. "//net/android:net_junit_tests",
  344. "//services:services_junit_tests",
  345. "//testing/android/junit:junit_unit_tests",
  346. "//third_party/catapult/devil",
  347. "//third_party/r8:custom_d8_java",
  348. "//tools/android:android_tools",
  349. "//tools/android:memconsumer",
  350. "//tools/android:push_apps_to_background",
  351. "//tools/android/audio_focus_grabber:audio_focus_grabber_apk",
  352. "//tools/android/customtabs_benchmark:customtabs_benchmark_apk",
  353. "//tools/android/kerberos/SpnegoAuthenticator:spnego_authenticator_apk",
  354. "//ui/android:ui_junit_tests",
  355. "//weblayer/public/java:client_aar",
  356. "//weblayer/shell/android:weblayer_shell_apk",
  357. "//weblayer/shell/android:weblayer_support_apk",
  358. ]
  359. deps -= [
  360. "//net:net_perftests",
  361. "//url:url_unittests",
  362. ]
  363. if (!is_component_build) {
  364. deps += [
  365. "//components/cronet/android:cronet_package_android",
  366. "//components/cronet/android:cronet_perf_test_apk",
  367. "//components/cronet/android:cronet_sample_apk",
  368. "//components/cronet/android:cronet_sample_test_apk",
  369. "//components/cronet/android:cronet_test_instrumentation_apk",
  370. "//components/cronet/android:cronet_unittests_android",
  371. ]
  372. }
  373. if (!is_chromecast) {
  374. deps += [
  375. "//android_webview:empty_group",
  376. "//android_webview/test",
  377. "//android_webview/tools/automated_ui_tests:webview_ui_test_app",
  378. "//android_webview/tools/system_webview_shell",
  379. "//chrome/android:chrome_junit_tests",
  380. "//chrome/android:chrome_public_apk",
  381. "//chrome/android:chrome_public_test_apk",
  382. "//chrome/android:chrome_public_unit_test_apk",
  383. "//chrome/browser/android/examples/custom_tabs_client:custom_tabs_client_example_apk",
  384. "//chrome/browser/android/examples/partner_browser_customizations_provider:partner_browser_customizations_example_apk",
  385. "//content/shell/android:content_shell_test_apk",
  386. ]
  387. }
  388. if (enable_chrome_android_internal) {
  389. deps += [ "//clank" ]
  390. }
  391. }
  392. # NOTE: The following should really be 'is_android', but the fuzzing build
  393. # seems currently broken for this platform at the moment, and the
  394. # corresponding code build and works on Linux unmodified.
  395. # See instructions in the corresponding BUILD.gn.
  396. if (is_linux || is_chromeos) {
  397. deps +=
  398. [ "//third_party/android_crazy_linker:android_crazy_linker_zip_fuzzer" ]
  399. }
  400. if (is_linux || is_chromeos) {
  401. # This is only used by ChromeOS, but we want maximal fuzzer coverage, so
  402. # run it under linux too.
  403. deps += [
  404. "//third_party/minizip:minizip_compress_fuzzer",
  405. "//third_party/minizip:minizip_uncompress_fuzzer",
  406. ]
  407. }
  408. if (is_linux || is_chromeos || is_android) {
  409. deps += [
  410. "//third_party/breakpad:breakpad_unittests",
  411. "//third_party/breakpad:core-2-minidump",
  412. "//third_party/breakpad:generate_test_dump",
  413. "//third_party/breakpad:minidump-2-core",
  414. "//tools/dump_process_memory:dump_process",
  415. "//tools/memory/partition_allocator:all",
  416. ]
  417. }
  418. if (is_chromeos_ash) {
  419. deps += [
  420. "//ash:ash_unittests",
  421. "//ash/components:ash_components_unittests",
  422. "//ash/components/proximity_auth:proximity_auth_unittests",
  423. "//ash/keyboard/ui:keyboard_unittests",
  424. "//ash/webui:ash_webui_unittests",
  425. "//chrome/browser/metrics/perf:profile_provider_unittest",
  426. "//chrome/test:usage_time_limit_unittests",
  427. "//chromeos/components:chromeos_components_unittests",
  428. "//components/exo/wayland:wayland_client_compatibility_tests",
  429. "//components/session_manager/core",
  430. "//third_party/shell-encryption:shell_encryption_unittests",
  431. "//ui/chromeos:ui_chromeos_unittests",
  432. ]
  433. }
  434. if (is_chromeos) {
  435. deps += [ "//chromeos:chromeos_unittests" ]
  436. }
  437. if (is_chromeos_ash || is_mac || is_win) {
  438. deps += [
  439. "//rlz:rlz_id",
  440. "//rlz:rlz_lib",
  441. "//rlz:rlz_unittests",
  442. ]
  443. }
  444. if (is_linux || is_chromeos) {
  445. # The following are definitely linux-only.
  446. deps += [
  447. "//chrome:xdg_mime",
  448. "//net:disk_cache_memory_test",
  449. "//net:quic_client",
  450. "//net:quic_server",
  451. "//sandbox/linux:chrome_sandbox",
  452. "//sandbox/linux:sandbox_linux_unittests",
  453. ]
  454. if (!is_clang) {
  455. deps += [ "//testing:empty_main" ]
  456. }
  457. if (use_dbus) {
  458. deps += [
  459. "//dbus:dbus_test_server",
  460. "//dbus:dbus_unittests",
  461. ]
  462. }
  463. if (is_chrome_branded && is_official_build) {
  464. # TODO(dpranke): add the linux_dump_symbols flag?
  465. deps += [ "//chrome:linux_symbols" ]
  466. }
  467. }
  468. if (is_ios || is_win || is_linux || is_chromeos_lacros || is_fuchsia) {
  469. deps += [
  470. "//base:base_i18n_perftests",
  471. "//google_apis:google_apis_unittests",
  472. ]
  473. }
  474. if ((is_win || is_mac || is_linux || is_chromeos || is_fuchsia) &&
  475. (target_cpu == "x86" || target_cpu == "x64")) {
  476. deps += [
  477. "//third_party/swiftshader/src/Vulkan:icd_file",
  478. "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan",
  479. ]
  480. }
  481. # TODO(GYP): Figure out which of these should (and can) build
  482. # for Chrome OS and iOS.
  483. if (!is_chromeos_ash && !is_ios) {
  484. deps += [
  485. "//base:build_utf8_validator_tables",
  486. "//base:check_example",
  487. "//cc:cc_perftests",
  488. "//components:components_perftests",
  489. "//device:device_unittests",
  490. "//gin:gin_shell",
  491. "//gin:gin_unittests",
  492. "//gpu:command_buffer_perftests",
  493. "//gpu:gl_tests",
  494. "//gpu:gpu_perftests",
  495. "//ipc:ipc_perftests",
  496. "//media:media_perftests",
  497. "//net:dump_cache",
  498. "//third_party/libphonenumber:libphonenumber_unittests",
  499. "//ui/compositor:compositor_unittests",
  500. ]
  501. if (!is_android) {
  502. deps += [
  503. "//chrome/test:load_library_perf_tests",
  504. "//chrome/test:sync_performance_tests",
  505. "//courgette:courgette",
  506. "//courgette:courgette_fuzz",
  507. "//courgette:courgette_minimal_tool",
  508. "//courgette:courgette_unittests",
  509. "//media/cast:generate_barcode_video",
  510. "//media/cast:generate_timecode_audio",
  511. "//net:crash_cache",
  512. "//net:net_watcher", # TODO(GYP): This should be conditional on
  513. # use_v8_in_net
  514. "//net:run_testserver",
  515. "//net:stress_cache",
  516. "//net:tld_cleanup",
  517. "//third_party/leveldatabase:env_chromium_unittests",
  518. "//third_party/libaddressinput:libaddressinput_unittests",
  519. ]
  520. }
  521. if (enable_extensions) {
  522. deps += [ "//extensions/shell:app_shell" ]
  523. }
  524. # TODO(https://crbug.com/1299021): Implement building these NaCl targets
  525. # as ARM32 when Chrome is built for ARM64 (for Linux/Chrome OS).
  526. if (enable_nacl && target_cpu != "arm64") {
  527. deps += [ "//components/nacl/loader:nacl_loader_unittests" ]
  528. if (is_linux || is_chromeos) {
  529. # TODO(dpranke): Figure out what platforms should actually have this.
  530. deps += [ "//components/nacl/loader:nacl_helper" ]
  531. }
  532. }
  533. if (media_use_ffmpeg && !is_android) {
  534. deps += [ "//media:ffmpeg_regression_tests" ]
  535. }
  536. }
  537. if (enable_plugins) {
  538. deps += [
  539. "//ppapi:pepper_hash_for_uma",
  540. "//ppapi:ppapi_perftests",
  541. ]
  542. }
  543. if (is_android || is_linux || is_chromeos_lacros) {
  544. deps += [
  545. "//components/network_hints/browser",
  546. "//content/public/app",
  547. "//mojo:mojo_perftests",
  548. "//services/service_manager/public/cpp",
  549. "//testing/gmock:gmock_main",
  550. "//third_party/breakpad:dump_syms($host_toolchain)",
  551. "//third_party/breakpad:microdump_stackwalk($host_toolchain)",
  552. "//third_party/breakpad:minidump_dump($host_toolchain)",
  553. "//third_party/breakpad:minidump_stackwalk($host_toolchain)",
  554. ]
  555. if (!is_android) {
  556. deps += [
  557. "//chrome/test:chrome_app_unittests",
  558. "//gpu/khronos_glcts_support:khronos_glcts_test",
  559. "//media/cast:cast_benchmarks",
  560. "//media/cast:tap_proxy",
  561. "//skia:filter_fuzz_stub",
  562. "//skia:image_operations_bench",
  563. "//ui/snapshot:snapshot_unittests",
  564. ]
  565. if (!is_debug && !is_component_build) {
  566. deps += [ "//chrome/tools/service_discovery_sniffer" ]
  567. }
  568. }
  569. if (ozone_platform_x11 && !is_chromecast && target_cpu != "arm") {
  570. deps += [ "//gpu/tools/compositor_model_bench" ]
  571. }
  572. }
  573. if (is_mac) {
  574. deps += [
  575. "//third_party/breakpad:crash_inspector",
  576. "//third_party/breakpad:dump_syms",
  577. # The following are accessibility API tools.
  578. "//tools/accessibility/inspect:ax_dump_events",
  579. "//tools/accessibility/inspect:ax_dump_tree",
  580. ]
  581. deps -= [
  582. # Mojo in GN contains some things which are never compiled in GYP on Mac,
  583. # so compilation fails on Mac. They need porting.
  584. "//mojo",
  585. ]
  586. }
  587. if (is_win) {
  588. deps += [
  589. "//base:pe_image_test",
  590. "//chrome/chrome_cleaner",
  591. "//chrome/chrome_elf:chrome_elf_unittests",
  592. "//chrome/chrome_elf:dll_hash_main",
  593. "//chrome/elevation_service:elevation_service_unittests",
  594. "//chrome/install_static:install_static_unittests",
  595. "//chrome/installer/gcapi",
  596. "//chrome/installer/setup:setup_unittests",
  597. "//chrome/notification_helper:notification_helper_unittests",
  598. "//chrome/test:delayloads_unittests",
  599. "//components/wifi:wifi_test",
  600. "//components/zucchini",
  601. "//net:quic_client",
  602. "//net:quic_server",
  603. "//sandbox/win:sbox_integration_tests",
  604. "//sandbox/win:sbox_unittests",
  605. "//sandbox/win:sbox_validation_tests",
  606. "//testing/gtest:gtest_main",
  607. # The following two are accessibility API debugging tools.
  608. "//tools/accessibility/inspect:ax_dump_events",
  609. "//tools/accessibility/inspect:ax_dump_tree",
  610. "//tools/win/chromeexts:chromeexts",
  611. ]
  612. # TODO(thakis): Enable this in cross builds, https://crbug.com/799827
  613. if (!(is_component_build && is_debug && target_cpu == "x86") &&
  614. host_os == "win") {
  615. deps += [ "//chrome/test/mini_installer:mini_installer_tests" ]
  616. }
  617. } else if (!is_android && !is_ios && !is_fuchsia) {
  618. deps += [ "//third_party/breakpad:symupload($host_toolchain)" ]
  619. }
  620. if (is_chromecast) {
  621. deps += [ "//chromecast:cast_test_lists" ]
  622. if (!is_fuchsia) {
  623. deps += [ "//chromecast:cast_shell" ]
  624. deps += [ "//chromecast/cast_core:core_runtime_simple" ]
  625. }
  626. if (enable_extensions && use_aura) {
  627. deps += [ "//chrome/browser/resources/chromeos/accessibility:build" ]
  628. }
  629. }
  630. if (is_mac || is_win || is_android || is_linux || is_chromeos) {
  631. deps += [
  632. "//third_party/crashpad/crashpad:crashpad_tests",
  633. "//third_party/crashpad/crashpad/handler:crashpad_handler",
  634. "//third_party/crashpad/crashpad/tools:crashpad_database_util",
  635. ]
  636. }
  637. if (enable_message_center) {
  638. deps += [ "//ui/message_center:message_center_unittests" ]
  639. }
  640. if (!is_android && !is_ios) {
  641. deps += [ "//content/browser/bluetooth/tools:bluetooth_metrics_hash" ]
  642. }
  643. if (is_win || is_linux || is_chromeos) {
  644. deps += [ "//mojo" ]
  645. }
  646. if (is_mac || is_linux || is_chromeos || is_android || is_fuchsia) {
  647. deps += [ "//third_party/perfetto:all" ]
  648. }
  649. if (is_win || is_mac || is_linux || is_chromeos) {
  650. deps += [ "//third_party/sqlite:sqlite_shell" ]
  651. }
  652. if ((is_linux && !is_chromecast) || is_chromeos_lacros) {
  653. # TODO(GYP): Figure out if any of these should be in gn_all
  654. # and figure out how cross-platform they are
  655. deps += [
  656. "//chrome/installer/util:strings",
  657. "//chrome/tools/convert_dict",
  658. "//components/constrained_window:unit_tests",
  659. "//components/metrics:serialization",
  660. "//components/services/filesystem:filesystem_service_unittests",
  661. "//components/sessions:unit_tests",
  662. "//media/cast:udp_proxy",
  663. "//storage/browser:dump_file_system",
  664. "//third_party/angle:libANGLE",
  665. "//third_party/angle:libEGL",
  666. "//third_party/angle:libGLESv2",
  667. "//third_party/leveldatabase:leveldb_test_targets",
  668. "//third_party/libjpeg_turbo:simd",
  669. "//third_party/opus:opus_compare",
  670. "//third_party/opus:opus_demo",
  671. "//third_party/opus:test_opus_api",
  672. "//third_party/opus:test_opus_decode",
  673. "//third_party/opus:test_opus_encode",
  674. "//third_party/opus:test_opus_padding",
  675. "//ui/display/types",
  676. "//ui/shell_dialogs:shell_dialogs_unittests",
  677. ]
  678. if (target_cpu == "x86" || target_cpu == "x64") {
  679. if (!is_android) {
  680. deps += [ "//chrome/test:load_library_perf_tests" ]
  681. }
  682. deps += [ "//third_party/libjpeg_turbo:simd_asm" ]
  683. }
  684. if ((is_linux || is_chromeos) && current_toolchain == host_toolchain) {
  685. deps += [ "//v8:v8_shell" ]
  686. }
  687. }
  688. if (((is_linux || is_chromeos) && !is_chromecast) ||
  689. (is_win && use_libfuzzer) || (use_libfuzzer && is_mac)) {
  690. deps += [
  691. "//testing/libfuzzer/fuzzers",
  692. "//third_party/freetype-testing:fuzzers",
  693. "//third_party/grpc:fuzzers",
  694. "//third_party/icu/fuzzers",
  695. "//third_party/qcms:fuzzers",
  696. "//third_party/ukey2/fuzzers",
  697. "//third_party/zlib/contrib/tests/fuzzers",
  698. ]
  699. if (is_chromeos_ash) {
  700. deps += [ "//chrome/services/ipp_parser/public/cpp:fuzzers" ]
  701. }
  702. # TODO(crbug.com/906751): Get the libFuzzer tests working on Windows.
  703. # Disable them for now because they cause the Windows clang ToT builder to
  704. # fail.
  705. if (!is_win) {
  706. deps += [ "//testing/libfuzzer/tests:libfuzzer_tests" ]
  707. }
  708. }
  709. # TODO(https://crbug.com/1299021): Remove the special case for arm64.
  710. if (enable_nacl && target_cpu != "arm64") {
  711. deps += [ "//native_client_sdk/src:nacl_core_sdk" ]
  712. }
  713. if (((is_linux || is_chromeos) && use_ozone) || is_fuchsia) {
  714. deps += [
  715. "//headless:headless_non_renderer",
  716. "//headless:headless_tests",
  717. ]
  718. }
  719. if (enable_vr) {
  720. deps += [
  721. "//chrome/browser/vr:vr_common_perftests",
  722. "//chrome/browser/vr:vr_common_unittests",
  723. "//chrome/browser/vr:vr_pixeltests",
  724. ]
  725. if (!is_android) {
  726. deps += [ "//tools/perf/contrib/vr_benchmarks:vr_perf_tests" ]
  727. } else {
  728. deps += [ "//chrome/browser/android/vr:vr_android_unittests" ]
  729. import("//tools/perf/chrome_telemetry_build/android_browser_types.gni")
  730. foreach(_target_suffix, telemetry_android_browser_target_suffixes) {
  731. deps += [
  732. "//tools/perf/contrib/vr_benchmarks:vr_perf_tests${_target_suffix}",
  733. ]
  734. }
  735. }
  736. }
  737. if (use_atk) {
  738. deps += [
  739. "//tools/accessibility/inspect:ax_dump_events",
  740. "//tools/accessibility/inspect:ax_dump_tree",
  741. ]
  742. }
  743. if (build_dawn_tests) {
  744. deps += [
  745. "//third_party/dawn/src/dawn/tests:dawn_end2end_tests",
  746. "//third_party/dawn/src/dawn/tests:dawn_unittests",
  747. "//third_party/dawn/src/fuzzers/dawn:dawn_fuzzers",
  748. "//third_party/dawn/src/tint/fuzzers",
  749. "//third_party/dawn/test/tint:tint_unittests",
  750. ]
  751. }
  752. # PFFFT.
  753. deps += [
  754. "//third_party/pffft:fuzzers",
  755. "//third_party/pffft:pffft_benchmark",
  756. "//third_party/pffft:pffft_unittest",
  757. ]
  758. # Minimal binaries to exercise Rust toolchain.
  759. deps += [ ":rust_build_tests" ]
  760. # More Rust targets.
  761. if (toolchain_has_rust) {
  762. deps += [
  763. "//mojo/public/rust",
  764. "//mojo/public/rust:mojo_rust_tests",
  765. ]
  766. }
  767. if (enable_rust) {
  768. deps += [ "//testing/rust_gtest_interop:rust_gtest_interop_unittests" ]
  769. }
  770. }
  771. group("rust_build_tests") {
  772. testonly = true
  773. deps = [ "//build/rust/tests" ]
  774. }
  775. # TODO(https://crbug.com/1112776): ensure remoting is functional on Linux builds with
  776. # other than X11 Ozone backends.
  777. if (enable_remoting && ((is_linux && ozone_platform_x11) ||
  778. ((is_chromeos || is_win) && !use_ozone))) {
  779. # On CQ, run the Traffic Annotation Auditor when a change affects one of these
  780. # targets.
  781. group("traffic_annotation_auditor_dependencies") {
  782. deps = [
  783. "//chrome:chrome",
  784. "//remoting/client",
  785. "//remoting/host:host",
  786. "//tools/traffic_annotation/summary:annotations_xml",
  787. ]
  788. if (is_win) {
  789. deps += [ "//chrome/chrome_cleaner:shipped_binaries" ]
  790. }
  791. }
  792. }
  793. if (is_android) {
  794. # On CQ, run the Traffic Annotation Auditor when a change affects one of these
  795. # targets.
  796. group("traffic_annotation_auditor_dependencies") {
  797. deps = [
  798. "//chrome/android:chrome_public_apk",
  799. "//tools/traffic_annotation/summary:annotations_xml",
  800. ]
  801. }
  802. }
  803. if (is_fuchsia) {
  804. # TODO(https://crbug.com/731217): This can't practically be in //v8 without
  805. # duplicating all the Fuchsia running infrastructure there.
  806. cr_fuchsia_package("d8_fuchsia_pkg") {
  807. testonly = true
  808. binary = "//v8:d8"
  809. manifest = "//v8/gni/v8.cmx"
  810. package_name = "d8"
  811. }
  812. fuchsia_package_installer("d8_fuchsia") {
  813. testonly = true
  814. package = ":d8_fuchsia_pkg"
  815. package_name = "d8"
  816. }
  817. }
  818. # TODO(GYP_GONE): Figure out if we really need this target or if there's
  819. # some better way to specify things.
  820. if (is_win) {
  821. group("chrome_official_builder_no_unittests") {
  822. deps = [
  823. "//chrome/common/win:eventlog_provider",
  824. "//chrome/credential_provider",
  825. "//chrome/installer/gcapi",
  826. "//chrome/installer/mini_installer",
  827. "//chrome/updater/win:updater_zip",
  828. "//components/policy:pack_policy_templates",
  829. "//components/zucchini",
  830. "//courgette",
  831. "//courgette:copy_courgette_binaries",
  832. "//third_party/hyphenation-patterns",
  833. "//tools/metrics:metrics_metadata",
  834. ]
  835. if (target_cpu == "x86") {
  836. if (is_clang) {
  837. deps += [ "//courgette(//build/toolchain/win:win_clang_x64)" ]
  838. } else {
  839. deps += [ "//courgette(//build/toolchain/win:x64)" ]
  840. }
  841. }
  842. if (is_chrome_branded) {
  843. deps += [ "//remoting/host:remoting_host_installation" ]
  844. }
  845. }
  846. group("chrome_official_builder") {
  847. testonly = true
  848. deps = [
  849. ":chrome_official_builder_no_unittests",
  850. "//base:base_unittests",
  851. "//chrome/test:browser_tests",
  852. "//ipc:ipc_tests",
  853. "//media:media_unittests",
  854. "//media/midi:midi_unittests",
  855. "//net:net_unittests",
  856. "//printing:printing_unittests",
  857. "//sql:sql_unittests",
  858. "//third_party/breakpad:symupload($host_toolchain)",
  859. "//ui/base:ui_base_unittests",
  860. "//ui/gfx:gfx_unittests",
  861. "//ui/touch_selection:ui_touch_selection_unittests",
  862. "//ui/views:views_unittests",
  863. "//url:url_unittests",
  864. ]
  865. }
  866. }
  867. if (is_chromeos_ash) {
  868. # This group is used to collect all targets used when verifying a new version
  869. # of Chrome for Chrome OS.
  870. group("chromiumos_preflight") {
  871. testonly = true
  872. data_deps = [
  873. "//chrome",
  874. "//chrome/test/chromedriver",
  875. "//components/chromeos_camera:jpeg_decode_accelerator_unittest",
  876. "//components/exo/wayland:wayland_client_integration_tests",
  877. "//components/exo/wayland:wayland_client_perftests",
  878. "//components/exo/wayland:wayland_client_tests",
  879. "//media:media_unittests",
  880. "//media/capture:capture_unittests",
  881. "//ppapi/examples/video_decode",
  882. "//sandbox/linux:chrome_sandbox",
  883. "//sandbox/linux:sandbox_linux_unittests",
  884. "//third_party/breakpad:minidump_stackwalk($host_toolchain)",
  885. "//third_party/dawn/src/dawn/tests:dawn_end2end_tests",
  886. "//third_party/dawn/src/dawn/tests:dawn_unittests",
  887. # Blocked on https://github.com/catapult-project/catapult/issues/2297
  888. #"//third_party/catapult/telemetry:bitmaptools",
  889. "//tools/perf/clear_system_cache",
  890. "//ui/ozone/gl:ozone_gl_unittests",
  891. ]
  892. if (use_v4l2_codec || use_vaapi) {
  893. data_deps += [
  894. "//components/chromeos_camera:jpeg_encode_accelerator_unittest",
  895. "//media/gpu:video_decode_accelerator_perf_tests",
  896. "//media/gpu:video_decode_accelerator_tests",
  897. "//media/gpu:video_encode_accelerator_perf_tests",
  898. "//media/gpu:video_encode_accelerator_tests",
  899. "//media/gpu/chromeos:image_processor_test",
  900. ]
  901. if (use_vaapi) {
  902. data_deps += [
  903. "//media/gpu/vaapi:decode_test",
  904. "//media/gpu/vaapi:vaapi_unittest",
  905. ]
  906. }
  907. if (use_v4l2_codec) {
  908. data_deps += [ "//media/gpu/v4l2:v4l2_stateless_decoder" ]
  909. }
  910. }
  911. }
  912. }
  913. group("gn_visibility") {
  914. deps = [
  915. "//build/config/sanitizers:options_sources",
  916. # "//third_party/pdfium:pdfium_embeddertests", # TODO(GYP): visibility?
  917. # "//third_party/pdfium:pdfium_unittests", # TODO(GYP): visibility?
  918. ]
  919. if (!is_ios) {
  920. deps += [ "//v8:postmortem-metadata" ]
  921. if (!v8_use_external_startup_data) {
  922. deps += [ "//v8:v8_snapshot" ]
  923. }
  924. }
  925. }
  926. if (!is_ios) {
  927. group("chromedriver") {
  928. testonly = true
  929. if (is_fuchsia || is_android) {
  930. # On Fuchsia/Android, ChromeDriver runs on the host, not the device.
  931. if (!is_chromecast) {
  932. deps = [ "//chrome/test/chromedriver:chromedriver($host_toolchain)" ]
  933. if (is_android) {
  934. deps += [ "//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk" ]
  935. }
  936. }
  937. } else {
  938. deps = [
  939. "//chrome/test/chromedriver:chromedriver",
  940. ]
  941. }
  942. }
  943. # This group includes all of the targets needed to build and test Blink,
  944. # including running web tests (see below). This target is defined here because
  945. # previously //third_party/WebKit, now //third_party/blink, couldn't depend on
  946. # //content/shell. This might not longer be true, see
  947. # https://crbug.com/1018659.
  948. group("blink_tests") {
  949. testonly = true
  950. deps = [
  951. ":blink_web_tests",
  952. "//third_party/blink/public:all_blink",
  953. ]
  954. }
  955. # Web tests runner
  956. # third_party/blink/tools/run_web_tests.py
  957. group("run_web_tests") {
  958. testonly = true
  959. deps = [ ":blink_web_tests" ]
  960. }
  961. if (!is_chromeos_ash && !is_ios && !is_fuchsia && !is_android) {
  962. # WPT Webdriver tests runner
  963. # chrome/test/chromedriver/test/run_webdriver_tests.py
  964. script_test("webdriver_wpt_tests") {
  965. # The script is wrapped in testing/xvfb.py; the actual
  966. # run_webdriver_tests.py script is passed as an arg in gn_isolate_map.pyl
  967. script = "//testing/xvfb.py"
  968. data = [
  969. "//build/skia_gold_common/",
  970. "//chrome/test/chromedriver/chrome_paths.py",
  971. "//chrome/test/chromedriver/server/server.py",
  972. "//chrome/test/chromedriver/test/run_webdriver_tests.py",
  973. "//chrome/test/chromedriver/util.py",
  974. "//third_party/blink/tools/blinkpy/",
  975. "//third_party/blink/web_tests/external/wpt/webdriver/",
  976. "//third_party/blink/web_tests/VirtualTestSuites",
  977. "//third_party/blink/web_tests/WebDriverExpectations",
  978. "//third_party/pywebsocket3/src/mod_pywebsocket/",
  979. "//third_party/wpt_tools/",
  980. ]
  981. data_deps = [
  982. "//chrome:chrome",
  983. "//chrome/test/chromedriver",
  984. "//testing:test_scripts_shared",
  985. "//third_party/catapult/third_party/typ",
  986. ]
  987. if (is_win) {
  988. data_deps += [ "//build/win:copy_cdb_to_output" ]
  989. }
  990. }
  991. script_test("wpt_tests_isolate") {
  992. script = "//testing/scripts/run_wpt_tests.py"
  993. data_deps = [
  994. "//chrome:chrome",
  995. "//chrome/test/chromedriver",
  996. "//third_party/blink/tools:wpt_tests_isolate",
  997. "//tools/imagediff",
  998. ]
  999. }
  1000. }
  1001. group("blink_web_tests_support_data") {
  1002. testonly = true
  1003. data_deps = [
  1004. ":layout_test_data_mojo_bindings",
  1005. ":layout_test_data_mojo_bindings_lite",
  1006. "//content/shell:content_shell",
  1007. "//content/test:mojo_bindings_web_test_mojom_js_data_deps",
  1008. "//content/test:mojo_web_test_bindings_js_data_deps",
  1009. "//device/bluetooth/public/mojom:fake_bluetooth_interfaces_js_data_deps",
  1010. "//device/vr/public/mojom:vr_service_js_data_deps",
  1011. "//media/capture/mojom:image_capture_js_data_deps",
  1012. "//media/midi:mojo_js_data_deps",
  1013. "//mojo/public/interfaces/bindings/tests:test_data_deps",
  1014. "//mojo/public/js/ts/bindings/tests:test_interfaces_js_data_deps",
  1015. "//mojo/public/mojom/base:base_js_data_deps",
  1016. "//services/device/public/mojom:generic_sensor_js_data_deps",
  1017. "//services/device/public/mojom:mojom_js_data_deps",
  1018. "//services/device/public/mojom:usb_js_data_deps",
  1019. "//services/shape_detection/public/mojom:mojom_js_data_deps",
  1020. "//skia/public/mojom:mojom_js_data_deps",
  1021. "//testing/buildbot/filters:blink_web_tests_filter",
  1022. "//third_party/blink/public:blink_devtools_frontend_resources_files",
  1023. "//third_party/blink/public:blink_devtools_inspector_resources",
  1024. "//third_party/blink/public/mojom:mojom_platform_js_data_deps",
  1025. "//third_party/blink/renderer/core:js_files_for_form_controls_web_tests",
  1026. "//third_party/catapult/third_party/typ",
  1027. "//third_party/hyphenation-patterns:test_data",
  1028. "//third_party/mesa_headers",
  1029. "//tools/imagediff",
  1030. "//ui/base:goldctl",
  1031. ]
  1032. if (is_android) {
  1033. data_deps += [
  1034. "//third_party/breakpad:breakpad_unittests",
  1035. "//third_party/breakpad:dump_syms",
  1036. "//third_party/breakpad:microdump_stackwalk",
  1037. "//third_party/breakpad:minidump_dump",
  1038. "//third_party/breakpad:minidump_stackwalk",
  1039. "//third_party/breakpad:symupload",
  1040. "//tools/android/forwarder2",
  1041. ]
  1042. } else {
  1043. data_deps += [ "//content/web_test:web_test_common_mojom_js_data_deps" ]
  1044. }
  1045. if (!is_win && !is_android) {
  1046. data_deps +=
  1047. [ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ]
  1048. }
  1049. if (is_mac) {
  1050. data_deps += [ "//third_party/breakpad:dump_syms($host_toolchain)" ]
  1051. }
  1052. if (is_linux || is_chromeos) {
  1053. data_deps += [ "//third_party/breakpad:dump_syms($host_toolchain)" ]
  1054. }
  1055. if (is_fuchsia) {
  1056. data_deps += [
  1057. "//build/config/fuchsia:deployment_resources",
  1058. "//content/shell:content_shell_fuchsia",
  1059. "//content/shell:content_shell_pkg__archive-manifest",
  1060. "//content/shell:content_shell_pkg__archive-metadata",
  1061. ]
  1062. }
  1063. data = [
  1064. "//build/skia_gold_common/",
  1065. "//testing/scripts/common.py",
  1066. "//testing/scripts/run_isolated_script_test.py",
  1067. "//testing/xvfb.py",
  1068. "//third_party/blink/tools/",
  1069. "//third_party/blink/web_tests/VirtualTestSuites",
  1070. "//third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json",
  1071. "//third_party/blink/web_tests/external/wpt/common/",
  1072. "//third_party/blink/web_tests/external/wpt/resources/",
  1073. "//third_party/blink/web_tests/resources/",
  1074. "//third_party/blink/web_tests/wpt_internal/",
  1075. "//third_party/pywebsocket3/src/mod_pywebsocket/",
  1076. "//third_party/test_fonts/test_fonts/",
  1077. "//third_party/wpt_tools/",
  1078. ]
  1079. if (is_win) {
  1080. data += [
  1081. "//third_party/apache-win32/",
  1082. "//third_party/perl/perl/",
  1083. ]
  1084. data_deps += [ "//build/win:copy_cdb_to_output" ]
  1085. }
  1086. if (is_mac) {
  1087. data += [
  1088. "//third_party/apache-mac/",
  1089. "//third_party/apache-mac-arm64/",
  1090. ]
  1091. }
  1092. if (is_linux || is_fuchsia) {
  1093. data += [ "//third_party/apache-linux/" ]
  1094. }
  1095. if (is_android) {
  1096. data += [
  1097. "//third_party/catapult/",
  1098. "//build/android/",
  1099. ]
  1100. }
  1101. }
  1102. _common_web_test_script = "//testing/scripts/run_isolated_script_test.py"
  1103. _common_web_test_args = [ "@WrappedPath(" + rebase_path(
  1104. "//third_party/blink/tools/run_web_tests.py",
  1105. root_build_dir) + ")" ]
  1106. if (is_debug) {
  1107. _common_web_test_args += [ "--debug" ]
  1108. } else {
  1109. _common_web_test_args += [ "--release" ]
  1110. if (dcheck_always_on) {
  1111. _common_web_test_args += [ "--timeout-ms=12000" ]
  1112. }
  1113. }
  1114. if (is_android) {
  1115. _common_web_test_args += [
  1116. "--platform",
  1117. "android",
  1118. ]
  1119. }
  1120. _common_web_test_args += [
  1121. "--seed",
  1122. "4",
  1123. "--debug-rwt-logging",
  1124. "--no-show-results",
  1125. "--zero-tests-executed-ok",
  1126. "--clobber-old-results",
  1127. "--exit-after-n-failures",
  1128. "5000",
  1129. "--exit-after-n-crashes-or-timeouts",
  1130. "100",
  1131. ]
  1132. # https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_tests.md
  1133. script_test("blink_web_tests") {
  1134. script = _common_web_test_script
  1135. args = _common_web_test_args
  1136. data_deps = [ ":blink_web_tests_support_data" ]
  1137. data = [
  1138. "//third_party/blink/perf_tests/",
  1139. "//third_party/blink/web_tests/SmokeTests",
  1140. "//third_party/blink/web_tests/VirtualTestSuites",
  1141. # List all test expectations here
  1142. "//third_party/blink/web_tests/ASANExpectations",
  1143. "//third_party/blink/web_tests/LeakExpectations",
  1144. "//third_party/blink/web_tests/MSANExpectations",
  1145. "//third_party/blink/web_tests/NeverFixTests",
  1146. "//third_party/blink/web_tests/SlowTests",
  1147. "//third_party/blink/web_tests/StaleTestExpectations",
  1148. "//third_party/blink/web_tests/TestExpectations",
  1149. "//third_party/blink/web_tests/WebDriverExpectations",
  1150. "//third_party/blink/web_tests/WebGPUExpectations",
  1151. # === List Test Cases folders here ===
  1152. "//third_party/blink/web_tests/accessibility/",
  1153. "//third_party/blink/web_tests/android/",
  1154. "//third_party/blink/web_tests/animations/",
  1155. "//third_party/blink/web_tests/app_banner/",
  1156. "//third_party/blink/web_tests/bindings/",
  1157. "//third_party/blink/web_tests/clipboard/",
  1158. "//third_party/blink/web_tests/compositing/",
  1159. "//third_party/blink/web_tests/crypto/",
  1160. "//third_party/blink/web_tests/css-parser/",
  1161. "//third_party/blink/web_tests/css1/",
  1162. "//third_party/blink/web_tests/css2.1/",
  1163. "//third_party/blink/web_tests/css3/",
  1164. "//third_party/blink/web_tests/cssom/",
  1165. "//third_party/blink/web_tests/custom-elements/",
  1166. "//third_party/blink/web_tests/custom-properties/",
  1167. "//third_party/blink/web_tests/dark-mode/",
  1168. "//third_party/blink/web_tests/document-transition/",
  1169. "//third_party/blink/web_tests/dom/",
  1170. "//third_party/blink/web_tests/editing/",
  1171. "//third_party/blink/web_tests/external/",
  1172. "//third_party/blink/web_tests/fast/",
  1173. "//third_party/blink/web_tests/fonts/",
  1174. "//third_party/blink/web_tests/fragmentation/",
  1175. "//third_party/blink/web_tests/fullscreen/",
  1176. "//third_party/blink/web_tests/gamepad/",
  1177. "//third_party/blink/web_tests/harness-tests/",
  1178. "//third_party/blink/web_tests/hittesting/",
  1179. "//third_party/blink/web_tests/html/",
  1180. "//third_party/blink/web_tests/html5lib/",
  1181. "//third_party/blink/web_tests/http/",
  1182. "//third_party/blink/web_tests/idle-callback/",
  1183. "//third_party/blink/web_tests/ietestcenter/",
  1184. "//third_party/blink/web_tests/images/",
  1185. "//third_party/blink/web_tests/inspector-protocol/",
  1186. "//third_party/blink/web_tests/intersection-observer/",
  1187. "//third_party/blink/web_tests/jquery/",
  1188. "//third_party/blink/web_tests/js/",
  1189. "//third_party/blink/web_tests/lifecycle/",
  1190. "//third_party/blink/web_tests/loader/",
  1191. "//third_party/blink/web_tests/media/",
  1192. "//third_party/blink/web_tests/media_capabilities/",
  1193. "//third_party/blink/web_tests/mhtml/",
  1194. "//third_party/blink/web_tests/navigator_language/",
  1195. "//third_party/blink/web_tests/navigator_webdriver/",
  1196. "//third_party/blink/web_tests/netinfo/",
  1197. "//third_party/blink/web_tests/overflow/",
  1198. "//third_party/blink/web_tests/paint/",
  1199. "//third_party/blink/web_tests/payments/",
  1200. "//third_party/blink/web_tests/permissionclient/",
  1201. "//third_party/blink/web_tests/plugins/",
  1202. "//third_party/blink/web_tests/pointer-lock/",
  1203. "//third_party/blink/web_tests/print_testharness/",
  1204. "//third_party/blink/web_tests/printing/",
  1205. "//third_party/blink/web_tests/register-protocol-handler/",
  1206. "//third_party/blink/web_tests/regress/",
  1207. "//third_party/blink/web_tests/resize-observer/",
  1208. "//third_party/blink/web_tests/resources/",
  1209. "//third_party/blink/web_tests/rootscroller/",
  1210. "//third_party/blink/web_tests/screen_orientation/",
  1211. "//third_party/blink/web_tests/scrollbars/",
  1212. "//third_party/blink/web_tests/scrollingcoordinator/",
  1213. "//third_party/blink/web_tests/security/",
  1214. "//third_party/blink/web_tests/handwriting/",
  1215. "//third_party/blink/web_tests/shadow-dom/",
  1216. "//third_party/blink/web_tests/storage/",
  1217. "//third_party/blink/web_tests/svg/",
  1218. "//third_party/blink/web_tests/synthetic_gestures/",
  1219. "//third_party/blink/web_tests/tables/",
  1220. "//third_party/blink/web_tests/test_runner/",
  1221. "//third_party/blink/web_tests/third_party/",
  1222. "//third_party/blink/web_tests/timezonechange/",
  1223. "//third_party/blink/web_tests/touchadjustment/",
  1224. "//third_party/blink/web_tests/transforms/",
  1225. "//third_party/blink/web_tests/transitions/",
  1226. "//third_party/blink/web_tests/traversal/",
  1227. "//third_party/blink/web_tests/typedcssom/",
  1228. "//third_party/blink/web_tests/vibration/",
  1229. "//third_party/blink/web_tests/virtual/",
  1230. "//third_party/blink/web_tests/virtualkeyboard/",
  1231. "//third_party/blink/web_tests/wake-lock/",
  1232. "//third_party/blink/web_tests/wasm/",
  1233. "//third_party/blink/web_tests/webaudio/",
  1234. "//third_party/blink/web_tests/webexposed/",
  1235. "//third_party/blink/web_tests/webgpu/",
  1236. "//third_party/blink/web_tests/wpt_internal/",
  1237. "//third_party/blink/web_tests/xmlviewer/",
  1238. # === Test Case Folders Ends ===
  1239. ]
  1240. if (is_win || is_linux || is_fuchsia) {
  1241. data += [
  1242. "//third_party/blink/web_tests/platform/win/",
  1243. "//third_party/blink/web_tests/platform/win7/",
  1244. ]
  1245. if (is_linux || is_fuchsia) {
  1246. data += [ "//third_party/blink/web_tests/platform/linux/" ]
  1247. }
  1248. if (is_fuchsia) {
  1249. data += [ "//third_party/blink/web_tests/platform/fuchsia/" ]
  1250. }
  1251. } else if (is_mac) {
  1252. data += [
  1253. "//third_party/blink/web_tests/platform/mac/",
  1254. "//third_party/blink/web_tests/platform/mac-mac10.12/",
  1255. "//third_party/blink/web_tests/platform/mac-mac10.13/",
  1256. "//third_party/blink/web_tests/platform/mac-mac10.14/",
  1257. "//third_party/blink/web_tests/platform/mac-mac10.15/",
  1258. "//third_party/blink/web_tests/platform/mac-mac11-arm64/",
  1259. ]
  1260. }
  1261. # flag-specific tests only runs on linux as of now
  1262. if (is_linux) {
  1263. data += [
  1264. "//third_party/blink/web_tests/FlagSpecificConfig",
  1265. "//third_party/blink/web_tests/FlagExpectations/",
  1266. "//third_party/blink/web_tests/flag-specific/",
  1267. ]
  1268. }
  1269. }
  1270. script_test("devtools_web_tests") {
  1271. # This target differs from :blink_web_tests in that it uses the
  1272. # same test harness but runs an entirely different set of tests
  1273. # and doesn't have a dependency on the web_test directory at all.
  1274. script = _common_web_test_script
  1275. args = _common_web_test_args + [
  1276. "--layout-tests-directory=@WrappedPath(" + rebase_path(
  1277. "//third_party/devtools-frontend/src/test/webtests",
  1278. root_out_dir) + ")",
  1279. "http/tests/devtools",
  1280. ]
  1281. data_deps = [ ":blink_web_tests_support_data" ]
  1282. data = [ "//third_party/devtools-frontend/src/test/webtests/" ]
  1283. }
  1284. script_test("webgpu_blink_web_tests") {
  1285. # This target differs from :blink_web_tests in that it uses the same
  1286. # test harness and a few additional flags but, more importantly, only runs
  1287. # the web_tests/wpt_internal/webgpu tests, so it doesn't have a data
  1288. # dependency on the whole web_test directory. run_webgpu_cts.py is a wrapper
  1289. # script around run_web_tests.py which performs additional setup for running
  1290. # the WebGPU CTS.
  1291. script = _common_web_test_script
  1292. # Add run_webgpu_cts.py and remove run_web_tests.py from _common_web_test_args
  1293. args = [ "@WrappedPath(" +
  1294. rebase_path("//third_party/blink/tools/run_webgpu_cts.py",
  1295. root_build_dir) + ")" ] + _common_web_test_args -
  1296. [ _common_web_test_args[0] ]
  1297. if (is_asan) {
  1298. args += [ "--timeout-ms=30000" ]
  1299. }
  1300. args += [
  1301. "--webgpu-cts-expectations",
  1302. "@WrappedPath(../../third_party/blink/web_tests/WebGPUExpectations)",
  1303. "--isolated-script-test-filter=wpt_internal/webgpu/web_platform/reftests",
  1304. ]
  1305. data_deps = [
  1306. ":blink_web_tests_support_data",
  1307. "//third_party/webgpu-cts",
  1308. ]
  1309. data = [
  1310. "//third_party/blink/web_tests/FlagSpecificConfig",
  1311. "//third_party/blink/web_tests/WebGPUExpectations",
  1312. "//third_party/blink/web_tests/external/wpt/webgpu/",
  1313. "//third_party/webgpu-cts/scripts/",
  1314. ]
  1315. }
  1316. copy("layout_test_data_mojo_bindings") {
  1317. testonly = true
  1318. sources = [ "$root_gen_dir/mojo/public/js/mojo_bindings.js" ]
  1319. outputs =
  1320. [ "$root_gen_dir/layout_test_data/mojo/public/js/mojo_bindings.js" ]
  1321. deps = [ "//mojo/public/js:bindings" ]
  1322. }
  1323. copy("layout_test_data_mojo_bindings_lite") {
  1324. testonly = true
  1325. sources = [ "$root_gen_dir/mojo/public/js/mojo_bindings_lite.js" ]
  1326. outputs = [
  1327. "$root_gen_dir/layout_test_data/mojo/public/js/mojo_bindings_lite.js",
  1328. ]
  1329. deps = [ "//mojo/public/js:bindings_lite" ]
  1330. }
  1331. script_test("blink_python_tests") {
  1332. script = "//testing/scripts/run_isolated_script_test.py"
  1333. args = [ "@WrappedPath(" +
  1334. rebase_path("//third_party/blink/tools/run_blinkpy_tests.py",
  1335. root_build_dir) + ")" ]
  1336. data = [
  1337. # These tests use //build/android/devil_chromium.py even when !is_android,
  1338. # so cannot use the helpers in //build/android (they assert(is_android)).
  1339. "//build/android/",
  1340. "//build/gn_helpers.py",
  1341. "//build/config/gclient_args.gni",
  1342. "//build/skia_gold_common/",
  1343. "//components/crash/content/tools/generate_breakpad_symbols.py",
  1344. "//testing/unexpected_passes_common/",
  1345. "//third_party/blink/renderer/bindings/scripts/",
  1346. "//third_party/blink/renderer/build/scripts/",
  1347. "//third_party/blink/tools/",
  1348. "//third_party/blink/web_tests/ASANExpectations",
  1349. "//third_party/blink/web_tests/LeakExpectations",
  1350. "//third_party/blink/web_tests/MSANExpectations",
  1351. "//third_party/blink/web_tests/NeverFixTests",
  1352. "//third_party/blink/web_tests/SlowTests",
  1353. "//third_party/blink/web_tests/StaleTestExpectations",
  1354. "//third_party/blink/web_tests/TestExpectations",
  1355. "//third_party/blink/web_tests/VirtualTestSuites",
  1356. "//third_party/catapult/common/py_utils/",
  1357. "//third_party/catapult/devil/",
  1358. "//third_party/catapult/dependency_manager/",
  1359. "//third_party/catapult/third_party/typ/",
  1360. "//third_party/depot_tools/pylint",
  1361. "//third_party/depot_tools/pylint-1.5",
  1362. "//third_party/depot_tools/pylint_main.py",
  1363. "//third_party/depot_tools/pylintrc",
  1364. "//third_party/ply/",
  1365. "//tools/idl_parser/",
  1366. ]
  1367. data_deps = [ "//ui/base:goldctl" ]
  1368. }
  1369. }
  1370. # TODO(cassew): Add more OS's that don't support x86.
  1371. is_valid_x86_target = true
  1372. #target_os != "ios" && target_os != "mac" &&
  1373. #(target_os != "linux" || use_libfuzzer || !build_with_chromium)
  1374. assert(
  1375. is_valid_x86_target || target_cpu != "x86",
  1376. "'target_cpu=x86' is not supported for 'target_os=$target_os'. Consider omitting 'target_cpu' (default) or using 'target_cpu=x64' instead.")
  1377. group("chromium_builder_perf") {
  1378. testonly = true
  1379. if (!is_ios && !is_android && !is_chromecast) {
  1380. data_deps = [
  1381. "//cc:cc_perftests",
  1382. "//chrome/test:load_library_perf_tests",
  1383. "//chrome/test:performance_test_suite",
  1384. "//components/tracing:tracing_perftests",
  1385. "//gpu:command_buffer_perftests",
  1386. "//gpu:gpu_perftests",
  1387. "//media:media_perftests",
  1388. "//tools/perf/chrome_telemetry_build:telemetry_chrome_test",
  1389. ]
  1390. if (is_android) {
  1391. data += [ "//third_party/android_sdk/public/platform-tools/adb" ]
  1392. }
  1393. if (!is_chromeos_ash) {
  1394. data_deps += [ "//chrome/test:performance_browser_tests" ]
  1395. }
  1396. if (is_linux || is_chromeos_lacros) {
  1397. if (is_official_build) {
  1398. # In GN builds, this is controlled by the 'linux_dump_symbols'
  1399. # flag, which defaults to 1 for official builds. For now,
  1400. # we skip the separate flag and just key off of is_official_build.
  1401. data_deps += [ "//chrome:linux_symbols" ]
  1402. }
  1403. data_deps += [ "//tools/perf/clear_system_cache" ]
  1404. }
  1405. if (is_win) {
  1406. data_deps += [ "//chrome/installer/mini_installer:mini_installer" ]
  1407. } else {
  1408. data_deps +=
  1409. [ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ]
  1410. }
  1411. if (is_win || is_android) {
  1412. data_deps += [
  1413. "//components:components_perftests",
  1414. "//third_party/angle/src/tests:angle_perftests",
  1415. ]
  1416. }
  1417. # An `if (is_fuchsia)` condition in //chrome/test/BUILD.gn prevents this
  1418. # target from being defined.
  1419. # TODO(crbug.com/1310086): Resolve that and remove this exception.
  1420. if (is_fuchsia) {
  1421. data_deps -= [ "//chrome/test:performance_test_suite" ]
  1422. }
  1423. }
  1424. }
  1425. if (!is_ios && !is_android && !is_chromecast) {
  1426. group("chromium_builder_asan") {
  1427. testonly = true
  1428. deps = [
  1429. "//chrome:chrome",
  1430. "//content/shell:content_shell",
  1431. "//third_party/blink/public/mojom:mojom_modules_js",
  1432. "//v8:d8",
  1433. ]
  1434. if (!is_win) {
  1435. deps += [ "//skia:filter_fuzz_stub" ]
  1436. }
  1437. if (enable_ipc_fuzzer && !is_component_build) {
  1438. deps += [ "//tools/ipc_fuzzer:ipc_fuzzer_all" ]
  1439. }
  1440. if (!is_chromeos_ash) {
  1441. deps += [
  1442. "//third_party/pdfium/samples:pdfium_test",
  1443. "//v8:v8_shell($v8_snapshot_toolchain)",
  1444. ]
  1445. }
  1446. if (!is_component_build) {
  1447. # See https://bugs.chromium.org/p/chromium/issues/detail?id=942546#c11.
  1448. deps += [
  1449. "//third_party/webrtc/rtc_tools:rtp_generator",
  1450. "//third_party/webrtc/rtc_tools:video_replay",
  1451. ]
  1452. }
  1453. if (build_dawn_tests) {
  1454. deps += [ "//third_party/dawn/src/tint/fuzzers:fuzzers" ]
  1455. }
  1456. }
  1457. }
  1458. if (is_android) {
  1459. group("optimize_gn_gen") {
  1460. deps = [
  1461. # These run expensive scripts in non-default toolchains. Generally, host
  1462. # toolchain targets are loaded in the later part of the run, and the
  1463. # result is they push out the end of generation. By preloading these, the
  1464. # scripts can be parallelized with the rest of the load.
  1465. "//build/config/linux(//build/toolchain/linux:clang_x64)",
  1466. "//build/config/posix(//build/toolchain/linux:clang_x64)",
  1467. # Include x86 toolchains as well since V8 uses them for 32-bit snapshot
  1468. # generation.
  1469. "//build/config/linux(//build/toolchain/linux:clang_x86)",
  1470. "//build/config/posix(//build/toolchain/linux:clang_x86)",
  1471. ]
  1472. }
  1473. }
  1474. if (enable_js_type_check) {
  1475. group("webui_closure_compile") {
  1476. testonly = true
  1477. data_deps = [
  1478. "chrome/browser/resources:closure_compile",
  1479. "chrome/test:closure_compile",
  1480. "components/flags_ui/resources:closure_compile",
  1481. "components/neterror/resources:closure_compile",
  1482. "components/security_interstitials:closure_compile",
  1483. "components/sync/driver/resources:closure_compile",
  1484. "components/ukm/debug:closure_compile",
  1485. "content/browser/resources:closure_compile",
  1486. "mojo/public/tools/bindings/generators/js_templates/lite/test:closure_compile",
  1487. "ui/webui/resources:closure_compile",
  1488. ]
  1489. if (is_chromeos_ash) {
  1490. data_deps += [
  1491. "ash/webui:closure_compile",
  1492. "ui/file_manager:closure_compile",
  1493. ]
  1494. }
  1495. if (is_android) {
  1496. data_deps += [ "components/offline_pages/resources:closure_compile" ]
  1497. }
  1498. }
  1499. }
  1500. # Write debug logs to gn_logs.txt.
  1501. _lines = [
  1502. "Generated during 'gn gen' by //BUILD.gn.",
  1503. "",
  1504. ] + build_gn_logs
  1505. # GN evaluates each .gn file once per toolchain, so restricting to default
  1506. # toolchain will ensure write_file() is called only once.
  1507. assert(current_toolchain == default_toolchain)
  1508. write_file("$root_build_dir/gn_logs.txt", _lines)