BUILD.gn 62 KB

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