Bug 1888590 - Mark some subtests on trusted-types-event-handlers.html as failing...
[gecko.git] / third_party / libwebrtc / BUILD.gn
blob85ead4162fb1d7c6d65200dfc2a67a1100826562
1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 # Use of this source code is governed by a BSD-style license
4 # that can be found in the LICENSE file in the root of the source
5 # tree. An additional intellectual property rights grant can be found
6 # in the file PATENTS.  All contributing project authors may
7 # be found in the AUTHORS file in the root of the source tree.
9 # This is the root build file for GN. GN will start processing by loading this
10 # file, and recursively load all dependencies until all dependencies are either
11 # resolved or known not to exist (which will cause the build to fail). So if
12 # you add a new build file, there must be some path of dependencies from this
13 # file to your new one or GN won't know about it.
15 # Use of visibility = clauses:
16 # The default visibility for all rtc_ targets is equivalent to "//*", or
17 # "all targets in webrtc can depend on this, nothing outside can".
19 # When overriding, the choices are:
20 # - visibility = [ "*" ] - public. Stuff outside webrtc can use this.
21 # - visibility = [ ":*" ] - directory private.
22 # As a general guideline, only targets in api/ should have public visibility.
24 import("//build/config/linux/pkg_config.gni")
25 import("//build/config/sanitizers/sanitizers.gni")
26 import("webrtc.gni")
27 if (rtc_enable_protobuf) {
28   import("//third_party/protobuf/proto_library.gni")
30 if (is_android) {
31   import("//build/config/android/config.gni")
32   import("//build/config/android/rules.gni")
33   import("//third_party/jni_zero/jni_zero.gni")
36 if (!build_with_chromium && !build_with_mozilla) {
37   # This target should (transitively) cause everything to be built; if you run
38   # 'ninja default' and then 'ninja all', the second build should do no work.
39   group("default") {
40     testonly = true
41     deps = [ ":webrtc" ]
42     if (rtc_build_examples) {
43       deps += [ "examples" ]
44     }
45     if (rtc_build_tools) {
46       deps += [ "rtc_tools" ]
47     }
48     if (rtc_include_tests) {
49       deps += [
50         ":rtc_unittests",
51         ":video_engine_tests",
52         ":voip_unittests",
53         ":webrtc_nonparallel_tests",
54         ":webrtc_perf_tests",
55         "common_audio:common_audio_unittests",
56         "common_video:common_video_unittests",
57         "examples:examples_unittests",
58         "media:rtc_media_unittests",
59         "modules:modules_tests",
60         "modules:modules_unittests",
61         "modules/audio_coding:audio_coding_tests",
62         "modules/audio_processing:audio_processing_tests",
63         "modules/remote_bitrate_estimator:rtp_to_text",
64         "modules/rtp_rtcp:test_packet_masks_metrics",
65         "modules/video_capture:video_capture_internal_impl",
66         "modules/video_coding:video_codec_perf_tests",
67         "net/dcsctp:dcsctp_unittests",
68         "pc:peerconnection_unittests",
69         "pc:rtc_pc_unittests",
70         "pc:slow_peer_connection_unittests",
71         "pc:svc_tests",
72         "rtc_tools:rtp_generator",
73         "rtc_tools:video_encoder",
74         "rtc_tools:video_replay",
75         "stats:rtc_stats_unittests",
76         "system_wrappers:system_wrappers_unittests",
77         "test",
78         "video:screenshare_loopback",
79         "video:sv_loopback",
80         "video:video_loopback",
81       ]
82       if (!is_asan) {
83         # Do not build :webrtc_lib_link_test because lld complains on some OS
84         # (e.g. when target_os = "mac") when is_asan=true. For more details,
85         # see bugs.webrtc.org/11027#c5.
86         deps += [ ":webrtc_lib_link_test" ]
87       }
88       if (is_ios) {
89         deps += [
90           "examples:apprtcmobile_tests",
91           "sdk:sdk_framework_unittests",
92           "sdk:sdk_unittests",
93         ]
94       }
95       if (is_android) {
96         deps += [
97           "examples:android_examples_junit_tests",
98           "sdk/android:android_instrumentation_test_apk",
99           "sdk/android:android_sdk_junit_tests",
100         ]
101       } else {
102         deps += [ "modules/video_capture:video_capture_tests" ]
103       }
104       if (rtc_enable_protobuf) {
105         deps += [
106           "logging:rtc_event_log_rtp_dump",
107           "tools_webrtc/perf:webrtc_dashboard_upload",
108         ]
109       }
110       if ((is_linux || is_chromeos) && rtc_use_pipewire) {
111         deps += [ "modules/desktop_capture:shared_screencast_stream_test" ]
112       }
113     }
114     if (target_os == "android") {
115       deps += [ "tools_webrtc:binary_version_check" ]
116     }
117   }
120 # Abseil Flags by default doesn't register command line flags on mobile
121 # platforms, WebRTC tests requires them (e.g. on simualtors) so this
122 # config will be applied to testonly targets globally (see webrtc.gni).
123 config("absl_flags_configs") {
124   defines = [ "ABSL_FLAGS_STRIP_NAMES=0" ]
127 config("library_impl_config") {
128   # Build targets that contain WebRTC implementation need this macro to
129   # be defined in order to correctly export symbols when is_component_build
130   # is true.
131   # For more info see: rtc_base/build/rtc_export.h.
132   defines = [ "WEBRTC_LIBRARY_IMPL" ]
135 # Contains the defines and includes in common.gypi that are duplicated both as
136 # target_defaults and direct_dependent_settings.
137 config("common_inherited_config") {
138   defines = []
139   cflags = []
140   ldflags = []
142   if (rtc_jni_generator_legacy_symbols) {
143     defines += [ "RTC_JNI_GENERATOR_LEGACY_SYMBOLS" ]
144   }
146   if (rtc_objc_prefix != "") {
147     defines += [ "RTC_OBJC_TYPE_PREFIX=${rtc_objc_prefix}" ]
148   }
150   if (rtc_dlog_always_on) {
151     defines += [ "DLOG_ALWAYS_ON" ]
152   }
154   if (rtc_enable_symbol_export || is_component_build) {
155     defines += [ "WEBRTC_ENABLE_SYMBOL_EXPORT" ]
156   }
157   if (rtc_enable_objc_symbol_export) {
158     defines += [ "WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT" ]
159   }
161   if (build_with_mozilla) {
162     defines += [ "WEBRTC_MOZILLA_BUILD" ]
163   }
165   if (!rtc_builtin_ssl_root_certificates) {
166     defines += [ "WEBRTC_EXCLUDE_BUILT_IN_SSL_ROOT_CERTS" ]
167   }
169   if (rtc_disable_check_msg) {
170     defines += [ "RTC_DISABLE_CHECK_MSG" ]
171   }
173   if (rtc_enable_avx2) {
174     defines += [ "WEBRTC_ENABLE_AVX2" ]
175   }
177   if (rtc_enable_win_wgc) {
178     defines += [ "RTC_ENABLE_WIN_WGC" ]
179   }
181   # Some tests need to declare their own trace event handlers. If this define is
182   # not set, the first time TRACE_EVENT_* is called it will store the return
183   # value for the current handler in an static variable, so that subsequent
184   # changes to the handler for that TRACE_EVENT_* will be ignored.
185   # So when tests are included, we set this define, making it possible to use
186   # different event handlers in different tests.
187   if (rtc_include_tests) {
188     defines += [ "WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1" ]
189   } else {
190     defines += [ "WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0" ]
191   }
192   if (build_with_chromium) {
193     defines += [ "WEBRTC_CHROMIUM_BUILD" ]
194     include_dirs = [
195       # The overrides must be included first as that is the mechanism for
196       # selecting the override headers in Chromium.
197       "../webrtc_overrides",
199       # Allow includes to be prefixed with webrtc/ in case it is not an
200       # immediate subdirectory of the top-level.
201       ".",
203       # Just like the root WebRTC directory is added to include path, the
204       # corresponding directory tree with generated files needs to be added too.
205       # Note: this path does not change depending on the current target, e.g.
206       # it is always "//gen/third_party/webrtc" when building with Chromium.
207       # See also: http://cs.chromium.org/?q=%5C"default_include_dirs
208       # https://gn.googlesource.com/gn/+/master/docs/reference.md#target_gen_dir
209       target_gen_dir,
210     ]
211   }
212   if (is_posix || is_fuchsia) {
213     defines += [ "WEBRTC_POSIX" ]
214   }
215   if (is_ios) {
216     defines += [
217       "WEBRTC_MAC",
218       "WEBRTC_IOS",
219     ]
220   }
221   if (is_linux || is_chromeos) {
222     defines += [ "WEBRTC_LINUX" ]
223   }
224   if (is_bsd) {
225     defines += [ "WEBRTC_BSD" ]
226   }
227   if (is_mac) {
228     defines += [ "WEBRTC_MAC" ]
229   }
230   if (is_fuchsia) {
231     defines += [ "WEBRTC_FUCHSIA" ]
232   }
233   if (is_win) {
234     defines += [ "WEBRTC_WIN" ]
235   }
236   if (is_android) {
237     defines += [
238       "WEBRTC_LINUX",
239       "WEBRTC_ANDROID",
240     ]
242     if (build_with_mozilla) {
243       defines += [ "WEBRTC_ANDROID_OPENSLES" ]
244     }
245   }
246   if (is_chromeos) {
247     defines += [ "CHROMEOS" ]
248   }
250   if (rtc_sanitize_coverage != "") {
251     assert(is_clang, "sanitizer coverage requires clang")
252     cflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
253     ldflags += [ "-fsanitize-coverage=${rtc_sanitize_coverage}" ]
254   }
256   if (is_ubsan) {
257     cflags += [ "-fsanitize=float-cast-overflow" ]
258   }
261 # TODO(bugs.webrtc.org/9693): Remove the possibility to suppress this warning
262 # as soon as WebRTC compiles without it.
263 config("no_global_constructors") {
264   if (is_clang) {
265     cflags = [ "-Wno-global-constructors" ]
266   }
269 config("rtc_prod_config") {
270   # Ideally, WebRTC production code (but not test code) should have these flags.
271   if (is_clang) {
272     cflags = [
273       "-Wexit-time-destructors",
274       "-Wglobal-constructors",
275     ]
276   }
279 config("common_config") {
280   cflags = []
281   cflags_c = []
282   cflags_cc = []
283   cflags_objc = []
284   defines = []
286   if (rtc_enable_protobuf) {
287     defines += [ "WEBRTC_ENABLE_PROTOBUF=1" ]
288   } else {
289     defines += [ "WEBRTC_ENABLE_PROTOBUF=0" ]
290   }
292   if (rtc_strict_field_trials == "") {
293     defines += [ "WEBRTC_STRICT_FIELD_TRIALS=0" ]
294   } else if (rtc_strict_field_trials == "dcheck") {
295     defines += [ "WEBRTC_STRICT_FIELD_TRIALS=1" ]
296   } else if (rtc_strict_field_trials == "warn") {
297     defines += [ "WEBRTC_STRICT_FIELD_TRIALS=2" ]
298   } else {
299     assert(false,
300            "Unsupported value for rtc_strict_field_trials: " +
301                "$rtc_strict_field_trials")
302   }
304   if (rtc_include_internal_audio_device) {
305     defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
306   }
308   if (rtc_libvpx_build_vp9) {
309     defines += [ "RTC_ENABLE_VP9" ]
310   }
312   if (rtc_use_h265) {
313     defines += [ "RTC_ENABLE_H265" ]
314   }
316   if (rtc_include_dav1d_in_internal_decoder_factory) {
317     defines += [ "RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY" ]
318   }
320   if (rtc_enable_sctp) {
321     defines += [ "WEBRTC_HAVE_SCTP" ]
322   }
324   if (rtc_enable_external_auth) {
325     defines += [ "ENABLE_EXTERNAL_AUTH" ]
326   }
328   if (rtc_use_h264) {
329     defines += [ "WEBRTC_USE_H264" ]
330   }
332   if (rtc_use_absl_mutex) {
333     defines += [ "WEBRTC_ABSL_MUTEX" ]
334   }
336   if (rtc_enable_libevent) {
337     defines += [ "WEBRTC_ENABLE_LIBEVENT" ]
338   }
340   if (rtc_disable_logging) {
341     defines += [ "RTC_DISABLE_LOGGING" ]
342   }
344   if (rtc_disable_trace_events) {
345     defines += [ "RTC_DISABLE_TRACE_EVENTS" ]
346   }
348   if (rtc_disable_metrics) {
349     defines += [ "RTC_DISABLE_METRICS" ]
350   }
352   if (rtc_exclude_transient_suppressor) {
353     defines += [ "WEBRTC_EXCLUDE_TRANSIENT_SUPPRESSOR" ]
354   }
356   if (rtc_exclude_audio_processing_module) {
357     defines += [ "WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE" ]
358   }
360   if (is_clang) {
361     cflags += [
362       # TODO(webrtc:13219): Fix -Wshadow instances and enable.
363       "-Wno-shadow",
365       # See https://reviews.llvm.org/D56731 for details about this
366       # warning.
367       "-Wctad-maybe-unsupported",
368     ]
369   }
371   if (build_with_chromium) {
372     defines += [
373       # NOTICE: Since common_inherited_config is used in public_configs for our
374       # targets, there's no point including the defines in that config here.
375       # TODO(kjellander): Cleanup unused ones and move defines closer to the
376       # source when webrtc:4256 is completed.
377       "HAVE_WEBRTC_VIDEO",
378       "LOGGING_INSIDE_WEBRTC",
379     ]
380   } else {
381     if (is_posix || is_fuchsia) {
382       cflags_c += [
383         # TODO(bugs.webrtc.org/9029): enable commented compiler flags.
384         # Some of these flags should also be added to cflags_objc.
386         # "-Wextra",  (used when building C++ but not when building C)
387         # "-Wmissing-prototypes",  (C/Obj-C only)
388         # "-Wmissing-declarations",  (ensure this is always used C/C++, etc..)
389         "-Wstrict-prototypes",
391         # "-Wpointer-arith",  (ensure this is always used C/C++, etc..)
392         # "-Wbad-function-cast",  (C/Obj-C only)
393         # "-Wnested-externs",  (C/Obj-C only)
394       ]
395       cflags_objc += [ "-Wstrict-prototypes" ]
396       cflags_cc = [
397         "-Wnon-virtual-dtor",
399         # This is enabled for clang; enable for gcc as well.
400         "-Woverloaded-virtual",
401       ]
402     }
404     if (is_clang) {
405       cflags += [ "-Wc++11-narrowing" ]
407       if (!is_fuchsia) {
408         # Compiling with the Fuchsia SDK results in Wundef errors
409         # TODO(bugs.fuchsia.dev/100722): Remove from (!is_fuchsia) branch when
410         # Fuchsia build errors are fixed.
411         cflags += [ "-Wundef" ]
412       }
414       if (!is_nacl) {
415         # Flags NaCl (Clang 3.7) do not recognize.
416         cflags += [ "-Wunused-lambda-capture" ]
417       }
418     }
420     if (is_win && !is_clang) {
421       # MSVC warning suppressions (needed to use Abseil).
422       # TODO(bugs.webrtc.org/9274): Remove these warnings as soon as MSVC allows
423       # external headers warning suppression (or fix them upstream).
424       cflags += [ "/wd4702" ]  # unreachable code
426       # MSVC 2019 warning suppressions for C++17 compiling
427       cflags +=
428           [ "/wd5041" ]  # out-of-line definition for constexpr static data
429                          # member is not needed and is deprecated in C++17
430     }
431   }
433   if (target_cpu == "arm64") {
434     defines += [ "WEBRTC_ARCH_ARM64" ]
435     defines += [ "WEBRTC_HAS_NEON" ]
436   }
438   if (target_cpu == "arm") {
439     defines += [ "WEBRTC_ARCH_ARM" ]
440     if (arm_version >= 7) {
441       defines += [ "WEBRTC_ARCH_ARM_V7" ]
442       if (arm_use_neon) {
443         defines += [ "WEBRTC_HAS_NEON" ]
444       }
445     }
446   }
448   if (target_cpu == "mipsel") {
449     defines += [ "MIPS32_LE" ]
450     if (mips_float_abi == "hard") {
451       defines += [ "MIPS_FPU_LE" ]
452     }
453     if (mips_arch_variant == "r2") {
454       defines += [ "MIPS32_R2_LE" ]
455     }
456     if (mips_dsp_rev == 1) {
457       defines += [ "MIPS_DSP_R1_LE" ]
458     } else if (mips_dsp_rev == 2) {
459       defines += [
460         "MIPS_DSP_R1_LE",
461         "MIPS_DSP_R2_LE",
462       ]
463     }
464   }
466   if (is_android && !is_clang) {
467     # The Android NDK doesn"t provide optimized versions of these
468     # functions. Ensure they are disabled for all compilers.
469     cflags += [
470       "-fno-builtin-cos",
471       "-fno-builtin-sin",
472       "-fno-builtin-cosf",
473       "-fno-builtin-sinf",
474     ]
475   }
477   if (use_fuzzing_engine) {
478     # Used in Chromium's overrides to disable logging
479     defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
480   }
482   if (!build_with_chromium && rtc_win_undef_unicode) {
483     cflags += [
484       "/UUNICODE",
485       "/U_UNICODE",
486     ]
487   }
490 if (is_mac) {
491 config("common_objc") {
492   frameworks = [ "Foundation.framework" ]
496 if (!build_with_chromium) {
497   # Target to build all the WebRTC production code.
498   rtc_static_library("webrtc") {
499     # Only the root target and the test should depend on this.
500     visibility = [
501       "//:default",
502       "//:webrtc_lib_link_test",
503     ]
505     sources = []
506     complete_static_lib = true
507     suppressed_configs += [ "//build/config/compiler:thin_archive" ]
508     defines = []
510     deps = [
511       "api:create_peerconnection_factory",
512       "api:enable_media",
513       "api:libjingle_peerconnection_api",
514       "api:rtc_error",
515       "api:transport_api",
516       "api/crypto",
517       "api/rtc_event_log:rtc_event_log_factory",
518       "api/task_queue",
519       "api/task_queue:default_task_queue_factory",
520       "api/test/metrics",
521       "api/video_codecs:video_decoder_factory_template",
522       "api/video_codecs:video_decoder_factory_template_dav1d_adapter",
523       "api/video_codecs:video_decoder_factory_template_libvpx_vp8_adapter",
524       "api/video_codecs:video_decoder_factory_template_libvpx_vp9_adapter",
525       "api/video_codecs:video_decoder_factory_template_open_h264_adapter",
526       "api/video_codecs:video_encoder_factory_template",
527       "api/video_codecs:video_encoder_factory_template_libaom_av1_adapter",
528       "api/video_codecs:video_encoder_factory_template_libvpx_vp8_adapter",
529       "api/video_codecs:video_encoder_factory_template_libvpx_vp9_adapter",
530       "api/video_codecs:video_encoder_factory_template_open_h264_adapter",
531       "audio",
532       "call",
533       "common_audio",
534       "common_video",
535       "logging:rtc_event_log_api",
536       "media",
537       "modules",
538       "modules/video_capture:video_capture_internal_impl",
539       "p2p:rtc_p2p",
540       "pc:libjingle_peerconnection",
541       "pc:rtc_pc",
542       "sdk",
543       "video",
544     ]
545     if (build_with_mozilla) {
546       deps -= [
547         "api:create_peerconnection_factory",
548         "api:enable_media",
549         "api:rtc_error",
550         "api:transport_api",
551         "api/crypto",
552         "api/rtc_event_log:rtc_event_log_factory",
553         "api/task_queue",
554         "api/task_queue:default_task_queue_factory",
555         "api/test/metrics",
556         "api/video_codecs:video_decoder_factory_template",
557         "api/video_codecs:video_decoder_factory_template_dav1d_adapter",
558         "api/video_codecs:video_decoder_factory_template_libvpx_vp8_adapter",
559         "api/video_codecs:video_decoder_factory_template_libvpx_vp9_adapter",
560         "api/video_codecs:video_decoder_factory_template_open_h264_adapter",
561         "api/video_codecs:video_encoder_factory_template",
562         "api/video_codecs:video_encoder_factory_template_libaom_av1_adapter",
563         "api/video_codecs:video_encoder_factory_template_libvpx_vp8_adapter",
564         "api/video_codecs:video_encoder_factory_template_libvpx_vp9_adapter",
565         "api/video_codecs:video_encoder_factory_template_open_h264_adapter",
566         "logging:rtc_event_log_api",
567         "p2p:rtc_p2p",
568         "pc:libjingle_peerconnection",
569         "pc:rtc_pc",
570         "sdk",
571       ]
572     }
574     if (rtc_include_builtin_audio_codecs) {
575       deps += [
576         "api/audio_codecs:builtin_audio_decoder_factory",
577         "api/audio_codecs:builtin_audio_encoder_factory",
578       ]
579     }
581     if (build_with_mozilla) {
582       deps += [
583         "api/environment:environment_factory",
584         "api/video:video_frame",
585         "api/video:video_rtp_headers",
586         "test:rtp_test_utils",
587       ]
588       # Added when we removed deps in other places to avoid building
589       # unreachable sources.  See Bug 1820869.
590       deps += [
591         "api/video_codecs:video_codecs_api",
592         "api/video_codecs:rtc_software_fallback_wrappers",
593         "media:rtc_simulcast_encoder_adapter",
594         "modules/video_coding:webrtc_vp8",
595         "modules/video_coding:webrtc_vp9",
596       ]
597     } else {
598       deps += [
599         "api",
600         "logging",
601         "p2p",
602         "pc",
603         "stats",
604       ]
605     }
607     if (build_with_mozilla && is_mac) {
608       deps += [ "sdk:videocapture_objc" ]
609     }
611     if (rtc_enable_protobuf) {
612       deps += [ "logging:rtc_event_log_proto" ]
613     }
614   }
616   if (rtc_include_tests && !is_asan) {
617     rtc_executable("webrtc_lib_link_test") {
618       testonly = true
620       # This target is used for checking to link, so do not check dependencies
621       # on gn check.
622       check_includes = false  # no-presubmit-check TODO(bugs.webrtc.org/12785)
624       sources = [ "webrtc_lib_link_test.cc" ]
625       deps = [
626         # NOTE: Don't add deps here. If this test fails to link, it means you
627         # need to add stuff to the webrtc static lib target above.
628         ":webrtc",
629       ]
630     }
631   }
634 if (use_libfuzzer || use_afl) {
635   # This target is only here for gn to discover fuzzer build targets under
636   # webrtc/test/fuzzers/.
637   group("webrtc_fuzzers_dummy") {
638     testonly = true
639     deps = [ "test/fuzzers:webrtc_fuzzer_main" ]
640   }
643 if (rtc_include_tests && !build_with_chromium) {
644   rtc_test("rtc_unittests") {
645     testonly = true
647     deps = [
648       "api:compile_all_headers",
649       "api:rtc_api_unittests",
650       "api/audio/test:audio_api_unittests",
651       "api/audio_codecs/test:audio_codecs_api_unittests",
652       "api/numerics:numerics_unittests",
653       "api/task_queue:pending_task_safety_flag_unittests",
654       "api/test/metrics:metrics_unittests",
655       "api/transport:stun_unittest",
656       "api/video/test:rtc_api_video_unittests",
657       "api/video_codecs/test:video_codecs_api_unittests",
658       "api/voip:compile_all_headers",
659       "call:fake_network_pipe_unittests",
660       "p2p:libstunprober_unittests",
661       "p2p:rtc_p2p_unittests",
662       "rtc_base:async_dns_resolver_unittests",
663       "rtc_base:async_packet_socket_unittest",
664       "rtc_base:callback_list_unittests",
665       "rtc_base:rtc_base_approved_unittests",
666       "rtc_base:rtc_base_unittests",
667       "rtc_base:rtc_json_unittests",
668       "rtc_base:rtc_numerics_unittests",
669       "rtc_base:rtc_operations_chain_unittests",
670       "rtc_base:rtc_task_queue_unittests",
671       "rtc_base:sigslot_unittest",
672       "rtc_base:task_queue_stdlib_unittest",
673       "rtc_base:untyped_function_unittest",
674       "rtc_base:weak_ptr_unittests",
675       "rtc_base/experiments:experiments_unittests",
676       "rtc_base/system:file_wrapper_unittests",
677       "rtc_base/task_utils:repeating_task_unittests",
678       "rtc_base/units:units_unittests",
679       "sdk:sdk_tests",
680       "test:rtp_test_utils",
681       "test:test_main",
682       "test/network:network_emulation_unittests",
683     ]
685     if (rtc_enable_protobuf) {
686       deps += [ "logging:rtc_event_log_tests" ]
687     }
689     if (is_android) {
690       # Do not use Chromium's launcher. native_unittests defines its own JNI_OnLoad.
691       use_default_launcher = false
693       deps += [
694         "sdk/android:native_unittests",
695         "sdk/android:native_unittests_java",
696         "//testing/android/native_test:native_test_support",
697       ]
698       shard_timeout = 900
699     }
700   }
702   if (rtc_enable_google_benchmarks) {
703     rtc_test("benchmarks") {
704       testonly = true
705       deps = [
706         "rtc_base/synchronization:mutex_benchmark",
707         "test:benchmark_main",
708       ]
709     }
710   }
712   # TODO(pbos): Rename test suite, this is no longer "just" for video targets.
713   video_engine_tests_resources = [
714     "resources/foreman_cif_short.yuv",
715     "resources/voice_engine/audio_long16.pcm",
716   ]
718   if (is_ios) {
719     bundle_data("video_engine_tests_bundle_data") {
720       testonly = true
721       sources = video_engine_tests_resources
722       outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
723     }
724   }
726   rtc_test("video_engine_tests") {
727     testonly = true
728     deps = [
729       "audio:audio_tests",
731       # TODO(eladalon): call_tests aren't actually video-specific, so we
732       # should move them to a more appropriate test suite.
733       "call:call_tests",
734       "call/adaptation:resource_adaptation_tests",
735       "test:test_common",
736       "test:test_main",
737       "test:video_test_common",
738       "video:video_tests",
739       "video/adaptation:video_adaptation_tests",
740     ]
741     data = video_engine_tests_resources
742     if (is_android) {
743       use_default_launcher = false
744       deps += [
745         "//build/android/gtest_apk:native_test_instrumentation_test_runner_java",
746         "//testing/android/native_test:native_test_java",
747         "//testing/android/native_test:native_test_support",
748       ]
749       shard_timeout = 900
750     }
751     if (is_ios) {
752       deps += [ ":video_engine_tests_bundle_data" ]
753     }
754   }
756   webrtc_perf_tests_resources = [
757     "resources/ConferenceMotion_1280_720_50.yuv",
758     "resources/audio_coding/speech_mono_16kHz.pcm",
759     "resources/audio_coding/speech_mono_32_48kHz.pcm",
760     "resources/audio_coding/testfile32kHz.pcm",
761     "resources/difficult_photo_1850_1110.yuv",
762     "resources/foreman_cif.yuv",
763     "resources/paris_qcif.yuv",
764     "resources/photo_1850_1110.yuv",
765     "resources/presentation_1850_1110.yuv",
766     "resources/voice_engine/audio_long16.pcm",
767     "resources/web_screenshot_1850_1110.yuv",
768   ]
770   if (is_ios) {
771     bundle_data("webrtc_perf_tests_bundle_data") {
772       testonly = true
773       sources = webrtc_perf_tests_resources
774       outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
775     }
776   }
778   rtc_test("webrtc_perf_tests") {
779     testonly = true
780     deps = [
781       "call:call_perf_tests",
782       "modules/audio_coding:audio_coding_perf_tests",
783       "modules/audio_processing:audio_processing_perf_tests",
784       "pc:peerconnection_perf_tests",
785       "test:test_main",
786       "video:video_full_stack_tests",
787       "video:video_pc_full_stack_tests",
788     ]
790     data = webrtc_perf_tests_resources
791     if (is_android) {
792       use_default_launcher = false
793       deps += [
794         "//build/android/gtest_apk:native_test_instrumentation_test_runner_java",
795         "//testing/android/native_test:native_test_java",
796         "//testing/android/native_test:native_test_support",
797       ]
798       shard_timeout = 4500
799     }
800     if (is_ios) {
801       deps += [ ":webrtc_perf_tests_bundle_data" ]
802     }
803   }
805   rtc_test("webrtc_nonparallel_tests") {
806     testonly = true
807     deps = [ "rtc_base:rtc_base_nonparallel_tests" ]
808     if (is_android) {
809       deps += [ "//testing/android/native_test:native_test_support" ]
810       shard_timeout = 900
811     }
812   }
814   rtc_test("voip_unittests") {
815     testonly = true
816     deps = [
817       "api/voip:compile_all_headers",
818       "api/voip:voip_engine_factory_unittests",
819       "audio/voip/test:audio_channel_unittests",
820       "audio/voip/test:audio_egress_unittests",
821       "audio/voip/test:audio_ingress_unittests",
822       "audio/voip/test:voip_core_unittests",
823       "test:test_main",
824     ]
825   }
828 # Build target for standalone dcsctp
829 rtc_static_library("dcsctp") {
830   # Only the root target should depend on this.
831   visibility = [ "//:default" ]
832   sources = []
833   complete_static_lib = true
834   suppressed_configs += [ "//build/config/compiler:thin_archive" ]
835   defines = []
836   deps = [
837     "net/dcsctp/public:factory",
838     "net/dcsctp/public:socket",
839     "net/dcsctp/public:types",
840     "net/dcsctp/socket:dcsctp_socket",
841     "net/dcsctp/timer:task_queue_timeout",
842   ]
845 # ---- Poisons ----
847 # Here is one empty dummy target for each poison type (needed because
848 # "being poisonous with poison type foo" is implemented as "depends on
849 # //:poison_foo").
851 # The set of poison_* targets needs to be kept in sync with the
852 # `all_poison_types` list in webrtc.gni.
854 group("poison_audio_codecs") {
857 group("poison_default_echo_detector") {
860 group("poison_environment_construction") {
863 group("poison_software_video_codecs") {