[M40 Merge][WAYLAND_BRINGUP] Display size for Wayland
[platform/framework/web/chromium-efl.git] / BUILD.gn
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
5 # This is the root build file for GN. GN will start processing by loading this
6 # file, and recursively load all dependencies until all dependencies are either
7 # resolved or known not to exist (which will cause the build to fail). So if
8 # you add a new build file, there must be some path of dependencies from this
9 # file to your new one or GN won't know about it.
10
11 import("//build/config/compiler/compiler.gni")
12 import("//build/config/features.gni")
13 import("//build/config/sanitizers/sanitizers.gni")
14 import("//build/config/ui.gni")
15 import("//components/nacl/features.gni")
16 import("//device/vr/buildflags/buildflags.gni")
17 import("//extensions/buildflags/buildflags.gni")
18 import("//media/media_options.gni")
19 import("//media/gpu/args.gni")
20 import("//remoting/remoting_enable.gni")
21 import("//third_party/openh264/openh264_args.gni")
22 import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
23 import("//ui/base/ui_features.gni")
24 import("//ui/webui/webui_features.gni")
25 import("//ui/ozone/ozone.gni")
26 import("//v8/gni/v8.gni")
27 import("//v8/snapshot_toolchain.gni")
28
29 if (is_android) {
30   import("//build/config/android/config.gni")
31 }
32
33 declare_args() {
34   # A list of extra dependencies to add to the root target. This allows a
35   # checkout to add additional targets without explicitly changing any checked-
36   # in files.
37   root_extra_deps = []
38 }
39
40 if (is_official_build) {
41   # An official (maximally optimized!) component (optimized for build times)
42   # build doesn't make sense and usually doesn't work.
43   assert(!is_component_build)
44 }
45
46 # This file defines the following two main targets:
47 #
48 # "gn_all" is used to create explicit dependencies from the root BUILD.gn to
49 # each top-level component that we wish to include when building everything via
50 # "all". This is required since the set of targets built by "all" is determined
51 # automatically based on reachability from the root BUILD.gn (for details, see
52 # crbug.com/503241). Builders should typically use "all", or list targets
53 # explicitly, rather than relying on "gn_all".
54 #
55 # "gn_visibility": targets that are normally not visible to top-level targets,
56 # but are built anyway by "all". Since we don't want any such targets, we have
57 # this placeholder to make sure hidden targets that aren't otherwise depended
58 # on yet are accounted for.
59
60 group("gn_all") {
61   testonly = true
62
63   deps = [
64     ":gn_visibility",
65     "//base:base_perftests",
66     "//base:base_unittests",
67     "//chrome/installer",
68     "//net:net_unittests",
69     "//skia:skia_unittests",
70     "//sql:sql_unittests",
71     "//tools/ipc_fuzzer:ipc_fuzzer_all",
72     "//ui/base:ui_base_unittests",
73     "//url:url_unittests",
74   ]
75
76   if (!is_android && !is_chromecast) {
77     deps += [
78       "//crypto:crypto_unittests",
79       "//google_apis/gcm:gcm_unit_tests",
80     ]
81   }
82
83   if (!is_fuchsia) {
84     deps += [
85       "//components:components_unittests",
86       "//services:services_unittests",
87       "//services/service_manager/public/cpp",
88       "//tools/metrics:metrics_metadata",
89       "//ui/gfx:gfx_unittests",
90     ]
91   }
92
93   if (closure_compile) {
94     deps += [ ":webui_closure_compile" ]
95   }
96
97   if (!is_ios && !is_android && !is_chromecast && !is_fuchsia) {
98     deps += [
99       "//chrome",
100       "//chrome/test:browser_tests",
101       "//chrome/test:interactive_ui_tests",
102       "//chrome/test:sync_integration_tests",
103       "//chrome/test/chromedriver:chromedriver_unittests",
104       "//components/sync/tools:sync_client",
105       "//components/sync/tools:sync_listen_notifications",
106       "//components/zucchini:zucchini",
107       "//components/zucchini:zucchini_unittests",
108       "//gpu/gles2_conform_support:gles2_conform_test",
109       "//gpu/khronos_glcts_support:khronos_glcts_test",
110       "//jingle:jingle_unittests",
111       "//net:hpack_example_generator",
112       "//ppapi:ppapi_unittests",
113       "//ppapi/examples/2d",
114       "//ppapi/examples/audio",
115       "//ppapi/examples/audio_input",
116       "//ppapi/examples/compositor",
117       "//ppapi/examples/crxfs",
118       "//ppapi/examples/enumerate_devices",
119       "//ppapi/examples/file_chooser",
120       "//ppapi/examples/flash_topmost",
121       "//ppapi/examples/font",
122       "//ppapi/examples/gamepad",
123       "//ppapi/examples/gles2",
124       "//ppapi/examples/gles2_spinning_cube",
125       "//ppapi/examples/ime",
126       "//ppapi/examples/input",
127       "//ppapi/examples/media_stream_audio",
128       "//ppapi/examples/media_stream_video",
129       "//ppapi/examples/mouse_cursor",
130       "//ppapi/examples/mouse_lock",
131       "//ppapi/examples/printing",
132       "//ppapi/examples/scaling",
133       "//ppapi/examples/scripting",
134       "//ppapi/examples/stub",
135       "//ppapi/examples/threading",
136       "//ppapi/examples/url_loader",
137       "//ppapi/examples/video_capture",
138       "//ppapi/examples/video_decode",
139       "//ppapi/examples/video_effects",
140       "//ppapi/examples/video_encode",
141       "//printing:printing_unittests",
142       "//third_party/cacheinvalidation:cacheinvalidation_unittests",
143       "//third_party/pdfium/samples:pdfium_test",
144       "//third_party/webrtc/rtc_tools:frame_analyzer",
145       "//tools/battor_agent",
146       "//tools/battor_agent:battor_agent_unittests",
147       "//tools/perf/clear_system_cache",
148       "//tools/traffic_annotation/auditor:traffic_annotation_auditor",
149       "//tools/traffic_annotation/auditor:traffic_annotation_auditor_unittests",
150       "//ui/accessibility:accessibility_unittests",
151       "//ui/accessibility/extensions",
152     ]
153   }
154
155   if (!is_ios) {
156     deps += [
157       "//cc:cc_unittests",
158       "//components/policy:policy_templates",
159       "//content/shell:content_shell",
160       "//content/test:content_browsertests",
161       "//content/test:content_perftests",
162       "//content/test:content_unittests",
163       "//gpu:gpu_unittests",
164       "//ipc:ipc_tests",
165       "//media:media_unittests",
166       "//media/midi:midi_unittests",
167       "//media/mojo:media_mojo_unittests",
168       "//mojo",
169       "//mojo:mojo_unittests",
170       "//mojo/common:mojo_common_unittests",
171       "//net:net_perftests",
172       "//third_party/blink/renderer/controller:webkit_unit_tests",
173       "//third_party/blink/renderer/platform/wtf:wtf_unittests",
174       "//ui/gl:gl_unittests",
175       "//url/ipc:url_ipc_unittests",
176     ]
177   }
178
179   if (!is_ios && !is_android && !is_chromecast) {
180     deps += [
181       "//tools/gn",
182       "//tools/gn:gn_unittests",
183     ]
184   }
185
186   if (!is_ios && !is_android) {
187     deps += [
188       "//components/cronet:cronet_tests",
189       "//components/cronet:cronet_unittests",
190     ]
191   }
192
193   if (!is_ios && !is_fuchsia) {
194     deps += [
195       "//chrome/test:telemetry_perf_unittests",
196       "//chrome/test:unit_tests",
197       "//components:components_browsertests",
198       "//components/viz:viz_perftests",
199       "//components/viz:viz_unittests",
200       "//components/viz/common:viz_benchmark",
201       "//device:device_unittests",
202       "//google_apis/gcm:mcs_probe",
203       "//media/capture:capture_unittests",
204       "//media/cast:cast_unittests",
205       "//storage:storage_unittests",
206       "//third_party/angle/src/tests:angle_end2end_tests",
207       "//third_party/angle/src/tests:angle_unittests",
208       "//third_party/angle/src/tests:angle_white_box_tests",
209       "//third_party/blink/renderer/platform:blink_platform_unittests",
210       "//third_party/blink/renderer/platform/heap:blink_heap_unittests",
211       "//third_party/catapult/telemetry:bitmaptools($host_toolchain)",
212       "//third_party/smhasher:pmurhash",
213       "//tools/imagediff($host_toolchain)",
214       "//ui/display:display_unittests",
215       "//ui/events:events_unittests",
216       "//ui/latency:latency_unittests",
217       "//ui/touch_selection:ui_touch_selection_unittests",
218       "//v8:gn_all",
219     ]
220   } else if (is_ios) {
221     deps += [ "//ios:all" ]
222   } else if (is_fuchsia) {
223     deps += [ ":d8_fuchsia" ]
224   }
225
226   deps += root_extra_deps
227
228   if (enable_extensions) {
229     deps += [
230       "//extensions:extensions_browsertests",
231       "//extensions:extensions_unittests",
232       "//extensions/shell:app_shell_unittests",
233     ]
234   }
235
236   if (enable_remoting) {
237     deps += [ "//remoting:remoting_all" ]
238   }
239
240   if (toolkit_views) {
241     deps += [
242       "//ui/views:views_unittests",
243       "//ui/views/examples:views_examples_exe",
244       "//ui/views/examples:views_examples_with_content_exe",
245     ]
246   }
247
248   if (use_aura) {
249     deps += [
250       "//ui/aura:aura_unittests",
251       "//ui/aura:demo",
252       "//ui/wm:wm_unittests",
253     ]
254   }
255
256   if (use_ozone) {
257     deps += [
258       "//ui/ozone",
259       "//ui/ozone:ozone_unittests",
260     ]
261
262     # TODO(crbug.com/766360): These require a working GL implementation.
263     if (!is_fuchsia) {
264       deps += [
265         "//ui/ozone/demo",
266         "//ui/ozone/gl:ozone_gl_unittests",
267       ]
268     }
269
270     if (ozone_platform_x11) {
271       deps += [ "//ui/ozone:ozone_x11_unittests" ]
272     }
273   }
274
275   if (use_x11 || ozone_platform_x11) {
276     deps += [ "//tools/xdisplaycheck" ]
277   }
278
279   if (is_mac) {
280     deps += [ "//chrome/installer/gcapi_mac:gcapi_example" ]
281   }
282
283   if (is_android) {
284     deps += [
285       "//base:base_junit_tests",
286       "//base/android/jni_generator:jni_generator_tests",
287       "//base/android/linker:chromium_android_linker",
288       "//build/android/gyp/test:hello_world",
289       "//build/android/gyp/test:hello_world",
290       "//build/android/stacktrace:java_deobfuscate",
291       "//chrome/android/webapk/shell_apk:maps_go_webapk",
292       "//chrome/android/webapk/shell_apk:webapk",
293       "//chrome/test/vr/perf:motopho_latency_test",
294       "//components/invalidation/impl:components_invalidation_impl_junit_tests",
295       "//components/policy/android:components_policy_junit_tests",
296       "//components/signin/core/browser/android:components_signin_junit_tests",
297       "//content/public/android:content_junit_tests",
298       "//content/shell/android:content_shell_apk",
299       "//device:device_junit_tests",
300       "//media/gpu:video_decode_accelerator_unittest",
301       "//net/android:net_junit_tests",
302       "//services:service_junit_tests",
303       "//testing/android/junit:junit_unit_tests",
304       "//third_party/android_async_task:android_async_task_java",
305       "//third_party/catapult/devil",
306       "//third_party/errorprone:errorprone_java",
307       "//third_party/smhasher:murmurhash3",
308       "//tools/android:android_tools",
309       "//tools/android:memconsumer",
310       "//tools/android:push_apps_to_background",
311       "//tools/android/audio_focus_grabber:audio_focus_grabber_apk",
312       "//tools/android/customtabs_benchmark:customtabs_benchmark_apk",
313       "//tools/android/errorprone_plugin:errorprone_plugin_java",
314       "//tools/android/kerberos/SpnegoAuthenticator:spnego_authenticator_apk",
315       "//ui/android:ui_junit_tests",
316     ]
317     deps -= [
318       "//net:net_perftests",
319       "//url:url_unittests",
320     ]
321
322     if (!is_component_build) {
323       deps += [
324         "//components/cronet/android:cronet_package",
325         "//components/cronet/android:cronet_perf_test_apk",
326         "//components/cronet/android:cronet_sample_apk",
327         "//components/cronet/android:cronet_sample_test_apk",
328         "//components/cronet/android:cronet_test_apk",
329         "//components/cronet/android:cronet_test_instrumentation_apk",
330         "//components/cronet/android:cronet_unittests_android",
331       ]
332     }
333
334     if (!is_chromecast) {
335       deps += [
336         "//android_webview",
337         "//android_webview/test",
338         "//android_webview/tools/automated_ui_tests:webview_ui_test_app",
339         "//android_webview/tools/system_webview_shell",
340         "//chrome/android:chrome_junit_tests",
341         "//chrome/android:chrome_public_apk",
342         "//chrome/android:chrome_public_test_apk",
343         "//chrome/android:chrome_sync_shell_test_apk",
344         "//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk",
345         "//content/shell/android:content_shell_test_apk",
346         "//third_party/custom_tabs_client:custom_tabs_client_example_apk",
347       ]
348     }
349
350     if (target_cpu != "x64") {
351       deps += [
352         "//content/shell/android:chromium_linker_test_apk",
353         "//third_party/android_platform:android_relocation_packer_unittests($host_toolchain)",
354       ]
355     }
356
357     if (enable_chrome_android_internal) {
358       deps += [ "//clank" ]
359     }
360   }
361
362   if (is_linux || is_android) {
363     deps += [
364       "//third_party/breakpad:breakpad_unittests",
365       "//third_party/breakpad:core-2-minidump",
366       "//third_party/breakpad:generate_test_dump",
367       "//third_party/breakpad:minidump-2-core",
368     ]
369   }
370
371   if (is_chromeos) {
372     deps += [
373       "//ash:ash_content_unittests",
374       "//ash:ash_shell_with_content",
375       "//ash:ash_unittests",
376       "//ash/app_list/presenter:app_list_presenter_unittests",
377       "//chromeos:chromeos_unittests",
378       "//chromeos/components:chromeos_components_unittests",
379       "//chromeos/components/proximity_auth:proximity_auth_unittests",
380       "//chromeos/services:chromeos_services_unittests",
381       "//components/session_manager/core",
382       "//ui/app_list:app_list_demo",
383       "//ui/app_list:app_list_unittests",
384       "//ui/arc:ui_arc_unittests",
385       "//ui/chromeos:ui_chromeos_unittests",
386     ]
387   }
388
389   if (is_chromeos || is_mac || is_win) {
390     deps += [
391       "//rlz:rlz_id",
392       "//rlz:rlz_lib",
393       "//rlz:rlz_unittests",
394     ]
395   }
396
397   if (is_linux) {
398     # The following are definitely linux-only.
399     deps += [
400       "//chrome:xdg_mime",
401       "//net:disk_cache_memory_test",
402       "//net:quic_client",
403       "//net:quic_server",
404       "//sandbox/linux:chrome_sandbox",
405       "//sandbox/linux:sandbox_linux_unittests",
406       "//testing:empty_main",
407     ]
408
409     if (use_dbus) {
410       deps += [
411         "//dbus:dbus_test_server",
412         "//dbus:dbus_unittests",
413       ]
414     }
415
416     if (is_chrome_branded && is_official_build) {
417       # TODO(dpranke): add the linux_dump_symbols flag?
418       deps += [ "//chrome:linux_symbols" ]
419     }
420   }
421
422   if (is_ios || is_win || (is_linux && !is_chromeos)) {
423     deps += [
424       "//base:base_i18n_perftests",
425       "//google_apis:google_apis_unittests",
426     ]
427   }
428
429   if ((is_win || is_mac || is_linux || is_chromeos) &&
430       (target_cpu == "x86" || target_cpu == "x64")) {
431     deps += [ "//third_party/swiftshader" ]
432   }
433
434   # TODO(GYP): Figure out which of these should (and can) build
435   # for chromeos/ios.
436   if (!is_chromeos && !is_ios && !is_fuchsia) {
437     deps += [
438       "//base:build_utf8_validator_tables",
439       "//base:check_example",
440       "//cc:cc_perftests",
441       "//cc/blink:cc_blink_unittests",
442       "//components:components_perftests",
443       "//device:device_unittests",
444       "//gin:gin_shell",
445       "//gin:gin_unittests",
446       "//gpu:command_buffer_perftests",
447       "//gpu:gl_tests",
448       "//gpu:gpu_perftests",
449       "//ipc:ipc_perftests",
450       "//media:media_perftests",
451       "//net:dump_cache",
452       "//third_party/libphonenumber:libphonenumber_unittests",
453       "//ui/compositor:compositor_unittests",
454     ]
455
456     if (!is_android) {
457       deps += [
458         "//chrome/test:load_library_perf_tests",
459         "//chrome/test:sync_performance_tests",
460         "//chrome/test/chromedriver:chromedriver",
461         "//chrome/test/chromedriver:chromedriver_tests",
462         "//components/sync:run_sync_testserver",
463         "//courgette:courgette",
464         "//courgette:courgette_fuzz",
465         "//courgette:courgette_minimal_tool",
466         "//courgette:courgette_unittests",
467         "//media/cast:generate_barcode_video",
468         "//media/cast:generate_timecode_audio",
469         "//net:crash_cache",
470         "//net:dns_fuzz_stub",
471         "//net:gdig",
472         "//net:net_watcher",  # TODO(GYP): This should be conditional on use_v8_in_net
473         "//net:run_testserver",
474         "//net:stress_cache",
475         "//net:tld_cleanup",
476         "//ppapi:pepper_hash_for_uma",
477         "//ppapi:ppapi_perftests",
478         "//third_party/leveldatabase:env_chromium_unittests",
479         "//third_party/libaddressinput:libaddressinput_unittests",
480       ]
481     }
482
483     if (enable_extensions) {
484       deps += [
485         "//extensions/shell:app_shell",
486         "//extensions/shell/installer:app_shell_installer",
487       ]
488       if (is_desktop_linux && is_official_build) {
489         deps += [ "//extensions/shell:app_shell_linux_symbols" ]
490       }
491     }
492
493     if (enable_nacl) {
494       deps += [ "//components/nacl/loader:nacl_loader_unittests" ]
495
496       if (is_linux) {
497         # TODO(dpranke): Figure out what platforms should actually have this.
498         deps += [ "//components/nacl/loader:nacl_helper" ]
499
500         if (enable_nacl_nonsfi) {
501           deps += [
502             "//components/nacl/loader:helper_nonsfi",
503             "//components/nacl/loader:nacl_helper_nonsfi_unittests",
504           ]
505         }
506       }
507     }
508
509     if (media_use_ffmpeg && !is_android) {
510       deps += [ "//media:ffmpeg_regression_tests" ]
511     }
512   }
513
514   if (is_android || (is_linux && !is_chromeos)) {
515     deps += [
516       "//components/network_hints/browser",
517       "//content/public/app:browser",
518       "//content/public/app:child",
519       "//mojo:mojo_perftests",
520       "//services/service_manager/public/cpp",
521       "//testing/gmock:gmock_main",
522       "//third_party/breakpad:dump_syms($host_toolchain)",
523       "//third_party/breakpad:microdump_stackwalk($host_toolchain)",
524       "//third_party/breakpad:minidump_dump($host_toolchain)",
525       "//third_party/breakpad:minidump_stackwalk($host_toolchain)",
526     ]
527
528     if (!is_android) {
529       deps += [
530         "//chrome/test:chrome_app_unittests",
531         "//gpu/khronos_glcts_support:khronos_glcts_test",
532         "//media/cast:cast_benchmarks",
533         "//media/cast:tap_proxy",
534         "//skia:filter_fuzz_stub",
535         "//skia:image_operations_bench",
536         "//third_party/sqlite:sqlite_shell",
537         "//ui/keyboard:keyboard_unittests",
538         "//ui/snapshot:snapshot_unittests",
539       ]
540
541       if (!is_debug && !is_component_build) {
542         deps += [ "//chrome/tools/service_discovery_sniffer" ]
543       }
544     }
545
546     if (use_x11) {
547       if (target_cpu != "arm") {
548         deps += [ "//gpu/tools/compositor_model_bench" ]
549       }
550     }
551   }
552
553   if (is_mac) {
554     deps += [
555       "//third_party/apple_sample_code",
556       "//third_party/breakpad:crash_inspector",
557       "//third_party/breakpad:dump_syms",
558       "//third_party/molokocacao",
559     ]
560     deps -= [
561       # Mojo in GN contains some things which are never compiled in GYP on Mac,
562       # so compilation fails on Mac. They need porting.
563       "//mojo",
564     ]
565   }
566
567   if (is_win) {
568     deps += [
569       "//base:pe_image_test",
570       "//chrome/install_static:install_static_unittests",
571       "//chrome/installer/gcapi",
572       "//chrome/installer/setup:setup_unittests",
573       "//chrome_elf:chrome_elf_import_unittests",
574       "//chrome_elf:chrome_elf_unittests",
575       "//chrome_elf:dll_hash_main",
576       "//cloud_print:cloud_print_unittests",
577       "//components/wifi:wifi_test",
578       "//components/zucchini",
579       "//net:quic_client",
580       "//net:quic_server",
581       "//notification_helper:notification_helper_unittests",
582       "//sandbox/win:pocdll",
583       "//sandbox/win:sandbox_poc",
584       "//sandbox/win:sbox_integration_tests",
585       "//sandbox/win:sbox_unittests",
586       "//sandbox/win:sbox_validation_tests",
587       "//testing/gtest:gtest_main",
588       "//third_party/tcmalloc:addr2line-pdb",
589
590       # The following two are accessibility API debugging tools.
591       "//tools/accessibility/inspect:ax_dump_events",
592       "//tools/accessibility/inspect:ax_dump_tree",
593       "//tools/win/chromeexts:chromeexts",
594     ]
595
596     # TODO(thakis): Enable this in cross builds, https://crbug.com/799827
597     if (!(is_component_build && is_debug && target_cpu == "x86") &&
598         host_os == "win") {
599       deps += [ "//chrome/test/mini_installer:mini_installer_tests" ]
600     }
601   } else if (!is_android && !is_ios && !is_fuchsia) {
602     deps += [ "//third_party/breakpad:symupload($host_toolchain)" ]
603   }
604
605   if (is_chromecast) {
606     deps += [ "//chromecast:cast_shell" ]
607   }
608
609   if (is_mac || is_win || is_android || (is_linux && !is_chromeos)) {
610     deps += [
611       "//third_party/crashpad/crashpad:crashpad_tests",
612       "//third_party/crashpad/crashpad/handler:crashpad_handler",
613       "//third_party/crashpad/crashpad/tools:crashpad_database_util",
614     ]
615   }
616
617   if (use_openh264) {
618     deps += [
619       "//third_party/openh264:common",
620       "//third_party/openh264:encoder",
621       "//third_party/openh264:processing",
622     ]
623   }
624
625   if (enable_message_center) {
626     deps += [ "//ui/message_center:message_center_unittests" ]
627   }
628
629   if (!is_android && !is_ios && !is_fuchsia) {
630     deps += [ "//content/browser/bluetooth/tools:bluetooth_metrics_hash" ]
631   }
632
633   if (is_win || is_linux) {
634     deps += [
635       "//mash:all",
636       "//media/mojo/services:media_service_unittests",
637       "//mojo",
638       "//services/ui/demo",
639       "//services/ui/ws:tests",
640       "//ui/views/mus:views_mus_interactive_ui_tests",
641       "//ui/views/mus:views_mus_unittests",
642     ]
643
644     # crbug.com/676055: media_service_unittests fails to link under Windows
645     # component builds, due to duplicate symbol definitions.
646     if (is_win && is_component_build) {
647       deps -= [ "//media/mojo/services:media_service_unittests" ]
648     }
649   }
650
651   if (is_mac || is_linux || is_android) {
652     deps += [ "//third_party/perfetto:all" ]
653   }
654
655   if (is_linux && !is_chromeos && !is_chromecast) {
656     # TODO(GYP): Figure out if any of these should be in gn_all
657     # and figure out how cross-platform they are
658     deps += [
659       "//chrome/installer/util:strings",
660       "//chrome/tools/convert_dict",
661       "//components/constrained_window:unit_tests",
662       "//components/metrics:serialization",
663       "//components/rappor:unit_tests",
664       "//components/services/filesystem:filesystem_service_unittests",
665       "//components/services/leveldb:leveldb_service_unittests",
666       "//components/sessions:unit_tests",
667       "//media/blink:media_blink_unittests",
668       "//media/cast:udp_proxy",
669       "//storage/browser:dump_file_system",
670       "//third_party/angle:libANGLE",
671       "//third_party/angle:libEGL",
672       "//third_party/angle:libGLESv2",
673       "//third_party/leveldatabase:leveldb_test_targets",
674       "//third_party/libjpeg_turbo:simd",
675       "//third_party/opus:opus_compare",
676       "//third_party/opus:opus_demo",
677       "//third_party/opus:test_opus_api",
678       "//third_party/opus:test_opus_decode",
679       "//third_party/opus:test_opus_encode",
680       "//third_party/opus:test_opus_padding",
681       "//third_party/webrtc/system_wrappers:field_trial_default",
682       "//third_party/webrtc/system_wrappers:metrics_default",
683       "//ui/display/types",
684       "//ui/shell_dialogs:shell_dialogs_unittests",
685     ]
686
687     if (enable_nacl) {
688       deps += [ "//native_client/src/trusted/debug_stub:gdb_rsp_unittest" ]
689     }
690
691     if (target_cpu == "x86" || target_cpu == "x64") {
692       if (!is_android) {
693         deps += [ "//chrome/test:load_library_perf_tests" ]
694       }
695       if (enable_nacl) {
696         deps += [ "//native_client/src/trusted/platform_qualify:vcpuid" ]
697       }
698       deps += [ "//third_party/libjpeg_turbo:simd_asm" ]
699     }
700     if (is_linux && current_toolchain == host_toolchain) {
701       deps += [ "//v8:v8_shell" ]
702     }
703   }
704
705   if ((is_linux && !is_chromeos && !is_chromecast) || (is_win && use_drfuzz) ||
706       (use_libfuzzer && is_mac)) {
707     deps += [
708       "//testing/libfuzzer/fuzzers",
709       "//testing/libfuzzer/tests:libfuzzer_tests",
710       "//third_party/icu/fuzzers",
711       "//third_party/qcms:fuzzers",
712       "//third_party/zlib/contrib/tests/fuzzers",
713     ]
714   }
715
716   if (enable_nacl) {
717     deps += [ "//native_client_sdk/src:nacl_core_sdk" ]
718   }
719
720   if (is_linux && use_ozone) {
721     deps += [
722       "//headless",
723       "//headless:headless_tests",
724     ]
725   }
726
727   if (enable_vr) {
728     deps += [
729       "//chrome/browser/vr:vr_common_perftests",
730       "//chrome/browser/vr:vr_common_unittests",
731       "//chrome/browser/vr:vr_pixeltests",
732     ]
733     if (is_desktop_linux && use_ozone) {
734       deps += [ "//chrome/browser/vr/testapp:vr_testapp" ]
735     }
736     if (is_android) {
737       deps += [ "//tools/perf/contrib/vr_benchmarks:vr_perf_tests" ]
738     }
739   }
740
741   if (is_fuchsia) {
742     deps += [
743       "//headless",
744       "//headless:headless_shell",
745       "//headless:headless_tests",
746       "//webrunner",
747     ]
748   }
749 }
750
751 if (is_fuchsia) {
752   # TODO(https://crbug.com/731217): This can't practically be in //v8 without
753   # duplicating all the Fuchsia running infrastructure there.
754   fuchsia_executable_runner("d8_fuchsia") {
755     exe_target = "//v8:d8"
756   }
757 }
758
759 # TODO(GYP_GONE): Figure out if we really need this target or if there's
760 # some better way to specify things.
761 if (is_win) {
762   group("chrome_official_builder_no_unittests") {
763     deps = [
764       "//chrome/common/win:eventlog_provider",
765       "//chrome/installer/gcapi",
766       "//chrome/installer/mini_installer",
767       "//cloud_print",
768       "//cloud_print/virtual_driver/win/port_monitor:copy_gcp_portmon_binaries",
769       "//components/policy:pack_policy_templates",
770       "//components/zucchini",
771       "//courgette",
772       "//courgette:copy_courgette_binaries",
773       "//remoting/webapp",
774       "//tools/metrics:metrics_metadata",
775     ]
776
777     if (target_cpu == "x86") {
778       if (is_clang) {
779         deps += [ "//courgette(//build/toolchain/win:win_clang_x64)" ]
780       } else {
781         deps += [ "//courgette(//build/toolchain/win:x64)" ]
782       }
783     }
784     if (is_chrome_branded) {
785       deps += [ "//remoting/host:remoting_host_installation" ]
786     }
787   }
788
789   group("chrome_official_builder") {
790     testonly = true
791
792     deps = [
793       ":chrome_official_builder_no_unittests",
794       "//base:base_unittests",
795       "//chrome/test:browser_tests",
796       "//ipc:ipc_tests",
797       "//media:media_unittests",
798       "//media/midi:midi_unittests",
799       "//net:net_unittests",
800       "//printing:printing_unittests",
801       "//sql:sql_unittests",
802       "//ui/base:ui_base_unittests",
803       "//ui/gfx:gfx_unittests",
804       "//ui/touch_selection:ui_touch_selection_unittests",
805       "//ui/views:views_unittests",
806       "//url:url_unittests",
807     ]
808   }
809 }
810
811 if (is_chromeos) {
812   group("chromiumos_preflight") {
813     testonly = true
814     deps = [
815       "//chrome",
816       "//chrome/test/chromedriver",
817       "//media:media_unittests",
818       "//ppapi/examples/video_decode",
819       "//sandbox/linux:chrome_sandbox",
820       "//sandbox/linux:sandbox_linux_unittests",
821       "//third_party/breakpad:minidump_stackwalk($host_toolchain)",
822
823       # Blocked on https://github.com/catapult-project/catapult/issues/2297
824       #"//third_party/catapult/telemetry:bitmaptools",
825       "//tools/perf/clear_system_cache",
826     ]
827
828     if (use_v4l2_codec || use_vaapi) {
829       deps += [
830         "//media/gpu:video_decode_accelerator_unittest",
831         "//media/gpu:video_encode_accelerator_unittest",
832       ]
833     }
834   }
835 }
836
837 group("gn_visibility") {
838   deps = [
839     "//build/config/sanitizers:options_sources",
840     # "//third_party/pdfium:pdfium_embeddertests",  # TODO(GYP): visibility?
841     # "//third_party/pdfium:pdfium_unittests",  # TODO(GYP): visibility?
842   ]
843
844   if (!is_ios) {
845     deps += [ "//v8:postmortem-metadata" ]
846     if (v8_use_snapshot && !v8_use_external_startup_data) {
847       deps += [ "//v8:v8_snapshot" ]
848     }
849   }
850 }
851
852 if (!is_ios) {
853   # This group includes all of the targets needed to build and test Blink,
854   # including running the layout tests (see below).
855   group("blink_tests") {
856     testonly = true
857
858     deps = [
859       ":webkit_layout_tests",
860       "//third_party/blink/public:all_blink",
861     ]
862   }
863
864   # Layout tests runner
865   # third_party/WebKit/Tools/Scripts/run-webkit-tests
866   group("run_webkit_tests") {
867     testonly = true
868     deps = [
869       ":webkit_layout_tests",
870     ]
871   }
872
873   # https://www.chromium.org/developers/testing/webkit-layout-tests
874
875   # The _exparchive at the end of the name indicates to the isolate recipe
876   # that the isolate should be archived separately using the `exparchive`
877   # command, rather than as part of the normal `batcharchive` command.
878   group("webkit_layout_tests_exparchive") {
879     testonly = true
880     deps = [
881       ":webkit_layout_tests",
882     ]
883     data_deps = [
884       ":webkit_layout_tests",
885     ]
886   }
887
888   # This target contains only a small subset of the layout tests,
889   # and is useful for testing with the regular isolate mechanism.
890   # To run the full layout test suite you need to use
891   # :webkit_layout_tests_exparchive, above, instead.
892   group("webkit_layout_tests") {
893     testonly = true
894     data_deps = [
895       ":layout_test_data_mojo_bindings",
896       "//content/shell:content_shell",
897       "//content/test:mojo_layouttest_bindings_js_data_deps",
898       "//device/bluetooth/public/mojom:fake_bluetooth_interfaces_js_data_deps",
899       "//device/usb/public/mojom:mojom_js_data_deps",
900       "//device/vr/public/mojom:mojom_js_data_deps",
901       "//media/capture/mojom:image_capture_js_data_deps",
902       "//mojo/public/interfaces/bindings/tests:test_data_deps",
903       "//services/shape_detection/public/mojom:mojom_js_data_deps",
904       "//services/device/public/mojom:mojom_js_data_deps",
905       "//services/device/public/mojom:generic_sensor_js_data_deps",
906       "//third_party/blink/public:blink_devtools_frontend_resources_files",
907       "//third_party/blink/public:mojo_bindings_js_data_deps",
908       "//third_party/mesa:osmesa",
909       "//tools/imagediff",
910     ]
911
912     if (is_android) {
913       data_deps += [
914         "//third_party/breakpad:breakpad_unittests",
915         "//third_party/breakpad:dump_syms",
916         "//third_party/breakpad:microdump_stackwalk",
917         "//third_party/breakpad:minidump_dump",
918         "//third_party/breakpad:minidump_stackwalk",
919         "//third_party/breakpad:symupload",
920         "//tools/android/forwarder2",
921       ]
922     }
923
924     if (!is_win && !is_android) {
925       data_deps +=
926           [ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ]
927     }
928
929     if (is_mac) {
930       data_deps += [ "//third_party/breakpad:dump_syms($host_toolchain)" ]
931     }
932
933     if (is_linux) {
934       data_deps += [ "//third_party/breakpad:dump_syms($host_toolchain)" ]
935     }
936
937     if (is_fuchsia) {
938       data_deps += [
939         "//content/shell:content_shell_fuchsia",
940         "//build/fuchsia/layout_test_proxy:layout_test_proxy_runner",
941       ]
942     }
943
944     data = [
945       "$root_build_dir/resources/inspector/",
946       "//testing/scripts/common.py",
947       "//testing/scripts/run_isolated_script_test.py",
948       "//testing/xvfb.py",
949       "//third_party/WebKit/LayoutTests/",
950       "//third_party/WebKit/PerformanceTests/",
951       "//third_party/WebKit/Tools/Scripts/",
952     ]
953
954     if (is_win) {
955       data += [
956         "//third_party/apache-win32/",
957         "//third_party/perl/",
958       ]
959     }
960
961     if (is_android) {
962       data += [
963         "//third_party/catapult/",
964         "//build/android/",
965       ]
966     }
967   }
968
969   copy("layout_test_data_mojo_bindings") {
970     testonly = true
971
972     sources = [
973       "$root_gen_dir/mojo/public/js/mojo_bindings.js",
974     ]
975
976     outputs = [
977       "$root_gen_dir/layout_test_data/mojo/public/js/mojo_bindings.js",
978     ]
979
980     deps = [
981       "//mojo/public/js:bindings",
982     ]
983   }
984
985   group("webkit_python_tests") {
986     data = [
987       "//build/android/",
988       "//components/crash/content/tools/generate_breakpad_symbols.py",
989       "//testing/scripts/common.py",
990       "//testing/scripts/run_isolated_script_test.py",
991       "//testing/test_env.py",
992       "//testing/xvfb.py",
993       "//third_party/WebKit/LayoutTests/ASANExpectations",
994       "//third_party/WebKit/LayoutTests/LeakExpectations",
995       "//third_party/WebKit/LayoutTests/MSANExpectations",
996       "//third_party/WebKit/LayoutTests/NeverFixTests",
997       "//third_party/WebKit/LayoutTests/StaleTestExpectations",
998       "//third_party/WebKit/LayoutTests/SlowTests",
999       "//third_party/WebKit/LayoutTests/TestExpectations",
1000       "//third_party/WebKit/LayoutTests/VirtualTestSuites",
1001       "//third_party/blink/renderer/bindings/scripts/",
1002       "//third_party/WebKit/Tools/Scripts/",
1003       "//third_party/blink/tools/",
1004       "//third_party/catapult/common/py_utils/",
1005       "//third_party/catapult/devil/",
1006       "//third_party/catapult/dependency_manager/",
1007       "//third_party/catapult/third_party/zipfile/",
1008       "//third_party/depot_tools/pylint.py",
1009       "//third_party/depot_tools/pylintrc",
1010       "//third_party/depot_tools/third_party/logilab/",
1011       "//third_party/depot_tools/third_party/pylint/",
1012       "//third_party/depot_tools/third_party/pylint.py",
1013       "//third_party/ply/",
1014       "//third_party/pymock/",
1015       "//third_party/typ/",
1016       "//tools/idl_parser/",
1017     ]
1018   }
1019 }
1020
1021 group("chromium_builder_perf") {
1022   testonly = true
1023
1024   if (!is_ios && !is_android && !is_chromecast && !is_fuchsia) {
1025     data_deps = [
1026       "//cc:cc_perftests",
1027       "//chrome/test:load_library_perf_tests",
1028       "//chrome/test:performance_test_suite",
1029       "//chrome/test:telemetry_perf_tests",
1030       "//chrome/test:telemetry_perf_tests_experimental",
1031       "//components/tracing:tracing_perftests",
1032       "//gpu:command_buffer_perftests",
1033       "//gpu:gpu_perftests",
1034       "//media:media_perftests",
1035       "//tools/perf/chrome_telemetry_build:telemetry_chrome_test",
1036     ]
1037
1038     if (is_android) {
1039       data += [ "//third_party/android_tools/sdk/platform-tools/adb" ]
1040     }
1041
1042     if (!is_chromeos) {
1043       data_deps += [ "//chrome/test:performance_browser_tests" ]
1044     }
1045     if (is_linux && !is_chromeos) {
1046       if (is_official_build) {
1047         # In GN builds, this is controlled by the 'linux_dump_symbols'
1048         # flag, which defaults to 1 for official builds. For now,
1049         # we skip the separate flag and just key off of is_official_build.
1050         data_deps += [ "//chrome:linux_symbols" ]
1051       }
1052
1053       data_deps += [ "//tools/perf/clear_system_cache" ]
1054     }
1055
1056     if (is_win) {
1057       data_deps += [ "//chrome/installer/mini_installer:mini_installer" ]
1058     } else {
1059       data_deps +=
1060           [ "//third_party/breakpad:minidump_stackwalk($host_toolchain)" ]
1061     }
1062     if (is_win || is_android) {
1063       data_deps += [
1064         "//components:components_perftests",
1065         "//chrome/test:angle_perftests",
1066       ]
1067     }
1068   }
1069 }
1070
1071 if (!is_ios && !is_android && !is_chromecast && !is_fuchsia) {
1072   group("chromium_builder_asan") {
1073     testonly = true
1074
1075     deps = [
1076       "//chrome:chrome",
1077       "//content/shell:content_shell",
1078       "//v8:d8",
1079     ]
1080     if (!is_win) {
1081       deps += [
1082         "//net:dns_fuzz_stub",
1083         "//skia:filter_fuzz_stub",
1084       ]
1085     }
1086     if (enable_ipc_fuzzer && !is_component_build) {
1087       deps += [ "//tools/ipc_fuzzer:ipc_fuzzer_all" ]
1088     }
1089     if (!is_chromeos) {
1090       deps += [
1091         "//third_party/pdfium/samples:pdfium_test",
1092         "//v8:v8_shell($v8_snapshot_toolchain)",
1093       ]
1094     }
1095   }
1096 }
1097
1098 if (is_android) {
1099   group("optimize_gn_gen") {
1100     deps = [
1101       # These run expensive scripts in non-default toolchains. Generally, host
1102       # toolchain targets are loaded in the later part of the run, and the
1103       # result is they push out the end of generation. By preloading these, the
1104       # scripts can be parallelized with the rest of the load.
1105       "//build/config/linux(//build/toolchain/linux:clang_x64)",
1106       "//build/config/posix(//build/toolchain/linux:clang_x64)",
1107
1108       # Include x86 toolchains as well since V8 uses them for 32-bit snapshot
1109       # generation.
1110       "//build/config/linux(//build/toolchain/linux:clang_x86)",
1111       "//build/config/posix(//build/toolchain/linux:clang_x86)",
1112     ]
1113   }
1114 }
1115
1116 # Because of the source assignment filter, many targets end up over-filtering
1117 # their sources if the output directory contains a platform name. Assert that
1118 # this doesn't happen. http://crbug.com/548283
1119 template("assert_valid_out_dir") {
1120   # List copied from //build/config/BUILDCONFIG.gn.
1121   set_sources_assignment_filter([
1122                                   "*\bandroid/*",
1123                                   "*\bchromeos/*",
1124                                   "*\bcocoa/*",
1125                                   "*\bios/*",
1126                                   "*\blinux/*",
1127                                   "*\bmac/*",
1128                                   "*\bposix/*",
1129                                   "*\bwin/*",
1130                                 ])
1131   assert(target_name != "")  # Mark as used.
1132   sources = invoker.actual_sources
1133   assert(
1134       sources == invoker.actual_sources,
1135       "Do not use a platform name in your output directory (found \"$root_build_dir\"). http://crbug.com/548283")
1136 }
1137
1138 if (closure_compile) {
1139   group("webui_closure_compile") {
1140     data_deps = [
1141       "chrome/browser/resources:closure_compile",
1142       "ui/webui/resources:closure_compile",
1143     ]
1144   }
1145 }
1146
1147 assert_valid_out_dir("_unused") {
1148   actual_sources = [ "$root_build_dir/foo" ]
1149 }