• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
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.
8
9import("//build/config/ui.gni")
10import("../webrtc.gni")
11if (is_android) {
12  import("//build/config/android/rules.gni")
13}
14
15group("test") {
16  testonly = true
17
18  deps = [
19    ":copy_to_file_audio_capturer",
20    ":rtp_test_utils",
21    ":test_common",
22    ":test_renderer",
23    ":test_support",
24    ":video_test_common",
25  ]
26
27  if (rtc_include_tests) {
28    deps += [
29      ":test_main",
30      ":test_support_unittests",
31      "pc/e2e",
32    ]
33  }
34}
35
36rtc_library("frame_generator_impl") {
37  visibility = [
38    "../api:create_frame_generator",
39    ":*",
40  ]
41  testonly = true
42  sources = [
43    "frame_generator.cc",
44    "frame_generator.h",
45    "testsupport/ivf_video_frame_generator.cc",
46    "testsupport/ivf_video_frame_generator.h",
47  ]
48  deps = [
49    ":frame_utils",
50    "../api:frame_generator_api",
51    "../api:scoped_refptr",
52    "../api/video:encoded_image",
53    "../api/video:video_frame",
54    "../api/video:video_frame_i010",
55    "../api/video:video_frame_i420",
56    "../api/video:video_rtp_headers",
57    "../api/video_codecs:video_codecs_api",
58    "../common_video",
59    "../media:rtc_media_base",
60    "../modules/video_coding:video_codec_interface",
61    "../modules/video_coding:video_coding_utility",
62    "../modules/video_coding:webrtc_h264",
63    "../modules/video_coding:webrtc_vp8",
64    "../modules/video_coding:webrtc_vp9",
65    "../rtc_base",
66    "../rtc_base:checks",
67    "../rtc_base:criticalsection",
68    "../rtc_base:rtc_base_approved",
69    "../rtc_base:rtc_event",
70    "../rtc_base/synchronization:mutex",
71    "../rtc_base/synchronization:sequence_checker",
72    "../rtc_base/system:file_wrapper",
73    "../system_wrappers",
74  ]
75  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
76}
77
78rtc_library("frame_utils") {
79  visibility = [ "*" ]
80  testonly = true
81  sources = [
82    "frame_utils.cc",
83    "frame_utils.h",
84  ]
85  deps = [
86    "../api:scoped_refptr",
87    "../api/video:video_frame",
88    "../api/video:video_frame_i420",
89  ]
90}
91
92rtc_library("video_test_common") {
93  visibility = [ "*" ]
94  testonly = true
95  sources = [
96    "fake_texture_frame.cc",
97    "fake_texture_frame.h",
98    "frame_forwarder.cc",
99    "frame_forwarder.h",
100    "frame_generator_capturer.cc",
101    "frame_generator_capturer.h",
102    "test_video_capturer.cc",
103    "test_video_capturer.h",
104    "video_codec_settings.h",
105  ]
106
107  deps = [
108    ":fileutils",
109    ":frame_utils",
110    "../api:create_frame_generator",
111    "../api:frame_generator_api",
112    "../api:scoped_refptr",
113    "../api/task_queue",
114    "../api/video:video_frame",
115    "../api/video:video_frame_i010",
116    "../api/video:video_frame_i420",
117    "../api/video:video_rtp_headers",
118    "../api/video_codecs:video_codecs_api",
119    "../common_video",
120    "../media:rtc_media_base",
121    "../rtc_base",
122    "../rtc_base:checks",
123    "../rtc_base:criticalsection",
124    "../rtc_base:logging",
125    "../rtc_base:refcount",
126    "../rtc_base:rtc_base_approved",
127    "../rtc_base:rtc_task_queue",
128    "../rtc_base:timeutils",
129    "../rtc_base/synchronization:mutex",
130    "../rtc_base/task_utils:repeating_task",
131    "../system_wrappers",
132  ]
133  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
134}
135
136if (!build_with_chromium) {
137  if (is_mac || is_ios) {
138    rtc_library("video_test_mac") {
139      testonly = true
140      sources = [
141        "mac_capturer.h",
142        "mac_capturer.mm",
143      ]
144      deps = [
145        ":video_test_common",
146        "../api:libjingle_peerconnection_api",
147        "../api:media_stream_interface",
148        "../api:scoped_refptr",
149        "../modules/video_capture:video_capture_module",
150        "../rtc_base",
151        "../sdk:base_objc",
152        "../sdk:native_api",
153        "../sdk:native_video",
154        "../sdk:videocapture_objc",
155      ]
156    }
157  }
158
159  rtc_library("platform_video_capturer") {
160    testonly = true
161    sources = [
162      "platform_video_capturer.cc",
163      "platform_video_capturer.h",
164    ]
165    deps = [ ":video_test_common" ]
166    absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
167    if (is_mac || is_ios) {
168      deps += [ ":video_test_mac" ]
169    } else {
170      sources += [
171        "vcm_capturer.cc",
172        "vcm_capturer.h",
173      ]
174      deps += [
175        "../api:scoped_refptr",
176        "../modules/video_capture:video_capture_module",
177        "../rtc_base:checks",
178        "../rtc_base:logging",
179      ]
180    }
181  }
182}
183
184rtc_library("rtp_test_utils") {
185  testonly = true
186  sources = [
187    "rtcp_packet_parser.cc",
188    "rtcp_packet_parser.h",
189    "rtp_file_reader.cc",
190    "rtp_file_reader.h",
191    "rtp_file_writer.cc",
192    "rtp_file_writer.h",
193    "rtp_header_parser.cc",
194    "rtp_header_parser.h",
195  ]
196
197  deps = [
198    "../api:array_view",
199    "../api:rtp_parameters",
200    "../modules/rtp_rtcp",
201    "../modules/rtp_rtcp:rtp_rtcp_format",
202    "../rtc_base:checks",
203    "../rtc_base:criticalsection",
204    "../rtc_base:logging",
205    "../rtc_base:macromagic",
206    "../rtc_base/synchronization:mutex",
207    "../rtc_base/system:arch",
208  ]
209}
210
211rtc_library("field_trial") {
212  visibility = [ "*" ]
213  testonly = true
214  sources = [
215    "field_trial.cc",
216    "field_trial.h",
217  ]
218
219  deps = [ "../system_wrappers:field_trial" ]
220}
221
222rtc_library("explicit_key_value_config") {
223  sources = [
224    "explicit_key_value_config.cc",
225    "explicit_key_value_config.h",
226  ]
227
228  deps = [
229    "../api/transport:webrtc_key_value_config",
230    "../rtc_base:checks",
231    "../system_wrappers:field_trial",
232  ]
233  absl_deps = [ "//third_party/abseil-cpp/absl/strings:strings" ]
234}
235
236rtc_library("perf_test") {
237  visibility = [ "*" ]
238  testonly = true
239  sources = [
240    "testsupport/perf_result_reporter.cc",
241    "testsupport/perf_result_reporter.h",
242    "testsupport/perf_test.cc",
243    "testsupport/perf_test.h",
244    "testsupport/perf_test_histogram_writer.h",
245    "testsupport/perf_test_result_writer.h",
246  ]
247  deps = [
248    "../api:array_view",
249    "../rtc_base:checks",
250    "../rtc_base:criticalsection",
251    "../rtc_base:logging",
252    "../rtc_base:rtc_numerics",
253    "../rtc_base/synchronization:mutex",
254  ]
255  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
256  if (rtc_enable_protobuf) {
257    sources += [ "testsupport/perf_test_histogram_writer.cc" ]
258    deps += [
259      "//third_party/catapult/tracing/tracing:histogram",
260      "//third_party/catapult/tracing/tracing:reserved_infos",
261    ]
262  } else {
263    sources += [ "testsupport/perf_test_histogram_writer_no_protobuf.cc" ]
264  }
265}
266
267if (is_ios) {
268  rtc_library("test_support_objc") {
269    testonly = true
270    visibility = [ ":test_support" ]
271    sources = [
272      "ios/coverage_util_ios.h",
273      "ios/coverage_util_ios.mm",
274      "ios/test_support.h",
275      "ios/test_support.mm",
276    ]
277    deps = [
278      ":perf_test",
279      "../sdk:helpers_objc",
280    ]
281    absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
282    configs += [ ":test_support_objc_config" ]
283  }
284
285  config("test_support_objc_config") {
286    defines = []
287
288    if (use_clang_coverage) {
289      defines += [ "WEBRTC_IOS_ENABLE_COVERAGE" ]
290    }
291  }
292}
293
294config("suppress_warning_4373") {
295  if (is_win) {
296    cflags = [
297      # MSVC has a bug which generates this warning when using mocks; see the
298      # section on warning 4373 in he googlemock FAQ. This warning isn't the
299      # least relevant for us, anyway.
300      "/wd4373",
301    ]
302  }
303}
304
305config("test_main_direct_config") {
306  visibility = [ ":*" ]
307  defines = [ "UNIT_TEST" ]
308}
309rtc_source_set("test_support") {
310  visibility = [ "*" ]
311  testonly = true
312
313  all_dependent_configs = [
314    ":suppress_warning_4373",
315    "//third_party/googletest:gmock_config",
316    "//third_party/googletest:gtest_config",
317  ]
318
319  sources = [
320    "gmock.h",
321    "gtest.h",
322  ]
323
324  public_deps = []  # no-presubmit-check TODO(webrtc:8603)
325  if (is_ios) {
326    public_deps +=  # no-presubmit-check TODO(webrtc:8603)
327        [ ":test_support_objc" ]
328  }
329
330  public_configs = [ ":test_main_direct_config" ]
331  deps = [
332    "../rtc_base:ignore_wundef",
333    "//testing/gmock",
334    "//testing/gtest",
335  ]
336}
337
338rtc_library("video_test_support") {
339  testonly = true
340
341  sources = [
342    "testsupport/frame_reader.h",
343    "testsupport/frame_writer.h",
344    "testsupport/mock/mock_frame_reader.h",
345    "testsupport/video_frame_writer.cc",
346    "testsupport/video_frame_writer.h",
347    "testsupport/y4m_frame_reader.cc",
348    "testsupport/y4m_frame_writer.cc",
349    "testsupport/yuv_frame_reader.cc",
350    "testsupport/yuv_frame_writer.cc",
351  ]
352
353  deps = [
354    ":fileutils",
355    ":frame_utils",
356    ":test_support",
357    ":video_test_common",
358    "../api:scoped_refptr",
359    "../api/video:encoded_image",
360    "../api/video:video_frame",
361    "../api/video:video_frame_i420",
362    "../api/video_codecs:video_codecs_api",
363    "../common_video",
364    "../media:rtc_media_base",
365    "../modules/video_coding:video_codec_interface",
366    "../modules/video_coding:video_coding_utility",
367    "../modules/video_coding:webrtc_h264",
368    "../modules/video_coding:webrtc_vp8",
369    "../modules/video_coding:webrtc_vp9",
370    "../rtc_base:checks",
371    "../rtc_base:criticalsection",
372    "../rtc_base:logging",
373    "../rtc_base:rtc_base_approved",
374    "../rtc_base:rtc_event",
375    "../rtc_base/synchronization:sequence_checker",
376    "../rtc_base/system:file_wrapper",
377  ]
378  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
379
380  if (!is_ios) {
381    deps += [ "//third_party:jpeg" ]
382    sources += [ "testsupport/jpeg_frame_writer.cc" ]
383  } else {
384    sources += [ "testsupport/jpeg_frame_writer_ios.cc" ]
385  }
386
387  if (is_android) {
388    deps += [ "//base" ]
389  }
390}
391
392if (rtc_include_tests) {
393  rtc_library("resources_dir_flag") {
394    testonly = true
395    visibility = [ "*" ]
396    sources = [
397      "testsupport/resources_dir_flag.cc",
398      "testsupport/resources_dir_flag.h",
399    ]
400    absl_deps = [ "//third_party/abseil-cpp/absl/flags:flag" ]
401  }
402
403  rtc_library("test_main_lib") {
404    visibility = [ "*" ]
405    testonly = true
406    sources = [
407      "test_main_lib.cc",
408      "test_main_lib.h",
409    ]
410
411    deps = [
412      ":field_trial",
413      ":perf_test",
414      ":resources_dir_flag",
415      ":test_support",
416      "../rtc_base",
417      "../rtc_base:checks",
418      "../rtc_base:logging",
419      "../rtc_base:rtc_base_approved",
420      "../system_wrappers:field_trial",
421      "../system_wrappers:metrics",
422    ]
423    absl_deps = [
424      "//third_party/abseil-cpp/absl/flags:flag",
425      "//third_party/abseil-cpp/absl/flags:parse",
426      "//third_party/abseil-cpp/absl/memory",
427      "//third_party/abseil-cpp/absl/strings:strings",
428      "//third_party/abseil-cpp/absl/types:optional",
429    ]
430  }
431
432  rtc_library("test_main") {
433    visibility = [ "*" ]
434    testonly = true
435    sources = [ "test_main.cc" ]
436
437    deps = [ ":test_main_lib" ]
438    absl_deps = [
439      "//third_party/abseil-cpp/absl/debugging:failure_signal_handler",
440      "//third_party/abseil-cpp/absl/debugging:symbolize",
441    ]
442  }
443
444  rtc_library("benchmark_main") {
445    testonly = true
446    sources = [ "benchmark_main.cc" ]
447
448    deps = [ "//third_party/google_benchmark" ]
449  }
450
451  rtc_library("test_support_test_artifacts") {
452    testonly = true
453    sources = [
454      "testsupport/test_artifacts.cc",
455      "testsupport/test_artifacts.h",
456    ]
457    deps = [
458      ":fileutils",
459      "../rtc_base:logging",
460      "../rtc_base/system:file_wrapper",
461    ]
462    absl_deps = [
463      "//third_party/abseil-cpp/absl/flags:flag",
464      "//third_party/abseil-cpp/absl/flags:parse",
465    ]
466  }
467
468  test_support_unittests_resources = [
469    "../resources/foreman_cif_short.yuv",
470    "../resources/video_coding/frame-ethernet-ii.pcap",
471    "../resources/video_coding/frame-loopback.pcap",
472    "../resources/video_coding/pltype103.rtp",
473    "../resources/video_coding/pltype103_header_only.rtp",
474    "../resources/video_coding/ssrcs-2.pcap",
475    "../resources/video_coding/ssrcs-3.pcap",
476  ]
477
478  if (is_ios) {
479    bundle_data("test_support_unittests_bundle_data") {
480      testonly = true
481      sources = test_support_unittests_resources
482      outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
483    }
484  }
485
486  rtc_test("test_support_unittests") {
487    deps = [
488      ":call_config_utils",
489      ":copy_to_file_audio_capturer_unittest",
490      ":direct_transport",
491      ":fake_video_codecs",
492      ":fileutils",
493      ":fileutils_unittests",
494      ":frame_generator_impl",
495      ":perf_test",
496      ":rtc_expect_death",
497      ":rtp_test_utils",
498      ":test_common",
499      ":test_main",
500      ":test_support",
501      ":test_support_test_artifacts",
502      ":video_test_common",
503      ":video_test_support",
504      "../api:create_frame_generator",
505      "../api:create_simulcast_test_fixture_api",
506      "../api:frame_generator_api",
507      "../api:scoped_refptr",
508      "../api:simulcast_test_fixture_api",
509      "../api/task_queue:task_queue_test",
510      "../api/test/video:function_video_factory",
511      "../api/video:encoded_image",
512      "../api/video:video_frame",
513      "../api/video:video_frame_i420",
514      "../api/video_codecs:video_codecs_api",
515      "../call:video_stream_api",
516      "../common_video",
517      "../media:rtc_media_base",
518      "../modules/rtp_rtcp",
519      "../modules/rtp_rtcp:rtp_rtcp_format",
520      "../modules/video_coding:simulcast_test_fixture_impl",
521      "../modules/video_coding:video_codec_interface",
522      "../modules/video_coding:video_coding_utility",
523      "../modules/video_coding:webrtc_h264",
524      "../modules/video_coding:webrtc_vp8",
525      "../modules/video_coding:webrtc_vp9",
526      "../rtc_base:criticalsection",
527      "../rtc_base:rtc_event",
528      "../rtc_base:rtc_task_queue",
529      "../rtc_base/synchronization:mutex",
530      "../rtc_base/system:file_wrapper",
531      "../rtc_base/task_utils:to_queued_task",
532      "pc/e2e:e2e_unittests",
533      "peer_scenario/tests",
534      "scenario:scenario_unittests",
535      "time_controller:time_controller",
536      "time_controller:time_controller_unittests",
537      "//third_party/abseil-cpp/absl/flags:flag",
538      "//third_party/abseil-cpp/absl/strings",
539      "//third_party/abseil-cpp/absl/types:optional",
540    ]
541    sources = [
542      "call_config_utils_unittest.cc",
543      "direct_transport_unittest.cc",
544      "fake_vp8_encoder_unittest.cc",
545      "frame_generator_capturer_unittest.cc",
546      "frame_generator_unittest.cc",
547      "rtp_file_reader_unittest.cc",
548      "rtp_file_writer_unittest.cc",
549      "run_loop_unittest.cc",
550      "testsupport/ivf_video_frame_generator_unittest.cc",
551      "testsupport/perf_test_unittest.cc",
552      "testsupport/test_artifacts_unittest.cc",
553      "testsupport/video_frame_writer_unittest.cc",
554      "testsupport/y4m_frame_reader_unittest.cc",
555      "testsupport/y4m_frame_writer_unittest.cc",
556      "testsupport/yuv_frame_reader_unittest.cc",
557      "testsupport/yuv_frame_writer_unittest.cc",
558    ]
559
560    if (rtc_enable_protobuf) {
561      sources += [ "testsupport/perf_test_histogram_writer_unittest.cc" ]
562      deps += [ "//third_party/catapult/tracing/tracing:histogram" ]
563    }
564
565    data = test_support_unittests_resources
566    if (is_android) {
567      deps += [ "//testing/android/native_test:native_test_support" ]
568      shard_timeout = 900
569    }
570
571    if (is_ios) {
572      deps += [ ":test_support_unittests_bundle_data" ]
573    }
574
575    if (!is_android && !build_with_chromium) {
576      # This is needed in order to avoid:
577      # undefined symbol: webrtc::videocapturemodule::VideoCaptureImpl::Create
578      deps += [ "../modules/video_capture:video_capture_internal_impl" ]
579    }
580  }
581}
582
583if (is_ios) {
584  rtc_library("fileutils_ios_objc") {
585    visibility = [
586      ":fileutils",
587      ":fileutils_override_impl",
588    ]
589    sources = [
590      "testsupport/ios_file_utils.h",
591      "testsupport/ios_file_utils.mm",
592    ]
593    deps = [
594      "../rtc_base:checks",
595      "../rtc_base:rtc_base_approved",
596      "../sdk:helpers_objc",
597    ]
598  }
599}
600
601if (is_mac) {
602  rtc_library("fileutils_mac_objc") {
603    visibility = [
604      ":fileutils",
605      ":fileutils_override_impl",
606    ]
607    sources = [
608      "testsupport/mac_file_utils.h",
609      "testsupport/mac_file_utils.mm",
610    ]
611    deps = [ "../rtc_base:checks" ]
612  }
613}
614
615rtc_library("fileutils") {
616  testonly = true
617  visibility = [ "*" ]
618  sources = [
619    "testsupport/file_utils.cc",
620    "testsupport/file_utils.h",
621  ]
622  deps = [
623    ":fileutils_override_api",
624    ":fileutils_override_impl",
625    "../rtc_base:checks",
626    "../rtc_base:stringutils",
627  ]
628  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
629  if (is_ios) {
630    deps += [ ":fileutils_ios_objc" ]
631  }
632  if (is_mac) {
633    deps += [ ":fileutils_mac_objc" ]
634  }
635  if (is_win) {
636    deps += [ "../rtc_base" ]
637  }
638}
639
640# We separate header into own target to make it possible for downstream
641# projects to override implementation.
642rtc_source_set("fileutils_override_api") {
643  testonly = true
644  sources = [ "testsupport/file_utils_override.h" ]
645}
646
647rtc_library("fileutils_override_impl") {
648  testonly = true
649  visibility = [ ":fileutils" ]
650  sources = [ "testsupport/file_utils_override.cc" ]
651  deps = [
652    ":fileutils_override_api",
653    "../rtc_base:checks",
654    "../rtc_base:macromagic",
655    "../rtc_base:stringutils",
656  ]
657  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
658  if (is_ios) {
659    deps += [ ":fileutils_ios_objc" ]
660  }
661  if (is_mac) {
662    deps += [ ":fileutils_mac_objc" ]
663  }
664  if (is_win) {
665    deps += [ "../rtc_base" ]
666  }
667}
668
669rtc_source_set("run_test") {
670  testonly = true
671  if (is_mac) {
672    public_deps = [ ":run_test_objc" ]  # no-presubmit-check TODO(webrtc:8603)
673  } else {
674    public_deps =  # no-presubmit-check TODO(webrtc:8603)
675        [ ":run_test_generic" ]
676  }
677}
678
679rtc_source_set("run_test_interface") {
680  sources = [ "run_test.h" ]
681}
682
683if (is_mac) {
684  rtc_library("run_test_objc") {
685    testonly = true
686    visibility = [ ":run_test" ]
687    sources = [ "mac/run_test.mm" ]
688    deps = [ ":run_test_interface" ]
689  }
690}
691
692rtc_library("run_test_generic") {
693  testonly = true
694  visibility = [ ":run_test" ]
695  sources = [ "run_test.cc" ]
696  deps = [ ":run_test_interface" ]
697}
698
699rtc_library("fileutils_unittests") {
700  testonly = true
701  visibility = [ ":*" ]  # Only targets in this file can depend on this.
702  sources = [ "testsupport/file_utils_unittest.cc" ]
703  deps = [
704    ":fileutils",
705    ":test_support",
706    "../rtc_base:checks",
707  ]
708  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
709}
710
711rtc_library("direct_transport") {
712  visibility = [ "*" ]
713  testonly = true
714  sources = [
715    "direct_transport.cc",
716    "direct_transport.h",
717  ]
718  deps = [
719    ":rtp_test_utils",
720    "../api:simulated_network_api",
721    "../api:transport_api",
722    "../api/task_queue",
723    "../api/units:time_delta",
724    "../call:call_interfaces",
725    "../call:simulated_packet_receiver",
726    "../rtc_base:macromagic",
727    "../rtc_base:timeutils",
728    "../rtc_base/synchronization:mutex",
729    "../rtc_base/synchronization:sequence_checker",
730    "../rtc_base/task_utils:repeating_task",
731  ]
732  absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
733  public_deps =  # no-presubmit-check TODO(webrtc:8603)
734      [ "../call:fake_network" ]
735}
736
737rtc_library("fake_video_codecs") {
738  allow_poison = [ "software_video_codecs" ]
739  visibility = [ "*" ]
740  sources = [
741    "configurable_frame_size_encoder.cc",
742    "configurable_frame_size_encoder.h",
743    "fake_decoder.cc",
744    "fake_decoder.h",
745    "fake_encoder.cc",
746    "fake_encoder.h",
747    "fake_vp8_decoder.cc",
748    "fake_vp8_decoder.h",
749    "fake_vp8_encoder.cc",
750    "fake_vp8_encoder.h",
751  ]
752  deps = [
753    "../api:fec_controller_api",
754    "../api:scoped_refptr",
755    "../api/task_queue",
756    "../api/video:encoded_image",
757    "../api/video:video_bitrate_allocation",
758    "../api/video:video_frame",
759    "../api/video:video_frame_i420",
760    "../api/video:video_rtp_headers",
761    "../api/video_codecs:video_codecs_api",
762    "../api/video_codecs:vp8_temporal_layers_factory",
763    "../modules:module_api",
764    "../modules/video_coding:codec_globals_headers",
765    "../modules/video_coding:video_codec_interface",
766    "../modules/video_coding:video_coding_utility",
767    "../rtc_base:checks",
768    "../rtc_base:criticalsection",
769    "../rtc_base:macromagic",
770    "../rtc_base:rtc_task_queue",
771    "../rtc_base:timeutils",
772    "../rtc_base/synchronization:mutex",
773    "../rtc_base/synchronization:sequence_checker",
774    "../system_wrappers",
775  ]
776  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
777}
778
779rtc_library("null_transport") {
780  testonly = true
781  sources = [
782    "null_transport.cc",
783    "null_transport.h",
784  ]
785  deps = [ "../api:transport_api" ]
786}
787
788rtc_library("encoder_settings") {
789  testonly = true
790  sources = [
791    "encoder_settings.cc",
792    "encoder_settings.h",
793  ]
794  deps = [
795    "../api:scoped_refptr",
796    "../api/video_codecs:video_codecs_api",
797    "../call:rtp_interfaces",
798    "../call:video_stream_api",
799    "../rtc_base:checks",
800    "../rtc_base:refcount",
801  ]
802}
803
804rtc_library("rtc_expect_death") {
805  testonly = true
806  sources = [ "testsupport/rtc_expect_death.h" ]
807  deps = [ ":test_support" ]
808}
809
810rtc_library("test_common") {
811  testonly = true
812  sources = [
813    "call_test.cc",
814    "call_test.h",
815    "drifting_clock.cc",
816    "drifting_clock.h",
817    "fake_videorenderer.h",
818    "layer_filtering_transport.cc",
819    "layer_filtering_transport.h",
820    "rtp_rtcp_observer.h",
821    "run_loop.cc",
822    "run_loop.h",
823    "video_decoder_proxy_factory.h",
824    "video_encoder_proxy_factory.h",
825  ]
826
827  deps = [
828    ":direct_transport",
829    ":encoder_settings",
830    ":fake_video_codecs",
831    ":fileutils",
832    ":mock_transport",
833    ":rtp_test_utils",
834    ":test_support",
835    ":video_test_common",
836    "../api:create_frame_generator",
837    "../api:frame_generator_api",
838    "../api:rtp_headers",
839    "../api:rtp_parameters",
840    "../api:simulated_network_api",
841    "../api:transport_api",
842    "../api/audio_codecs:builtin_audio_decoder_factory",
843    "../api/audio_codecs:builtin_audio_encoder_factory",
844    "../api/rtc_event_log",
845    "../api/task_queue",
846    "../api/task_queue:default_task_queue_factory",
847    "../api/test/video:function_video_factory",
848    "../api/transport:field_trial_based_config",
849    "../api/video:builtin_video_bitrate_allocator_factory",
850    "../api/video:video_bitrate_allocator_factory",
851    "../api/video:video_frame",
852    "../api/video_codecs:video_codecs_api",
853    "../call:call_interfaces",
854    "../call:fake_network",
855    "../call:simulated_network",
856    "../call:simulated_packet_receiver",
857    "../call:video_stream_api",
858    "../modules/audio_device:audio_device_impl",
859    "../modules/audio_mixer:audio_mixer_impl",
860    "../modules/rtp_rtcp",
861    "../modules/rtp_rtcp:rtp_rtcp_format",
862    "../modules/rtp_rtcp:rtp_video_header",
863    "../modules/video_coding:codec_globals_headers",
864    "../rtc_base:checks",
865    "../rtc_base:criticalsection",
866    "../rtc_base:rtc_base",
867    "../rtc_base:rtc_event",
868    "../rtc_base:task_queue_for_test",
869    "../rtc_base/task_utils:to_queued_task",
870    "../system_wrappers",
871    "../system_wrappers:field_trial",
872  ]
873  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
874  if (!is_android && !build_with_chromium) {
875    deps += [ "../modules/video_capture:video_capture_internal_impl" ]
876  }
877}
878
879rtc_library("mock_transport") {
880  testonly = true
881  sources = [
882    "mock_transport.cc",
883    "mock_transport.h",
884  ]
885  deps = [
886    ":test_support",
887    "../api:transport_api",
888  ]
889}
890
891rtc_source_set("test_renderer") {
892  public_deps =  # no-presubmit-check TODO(webrtc:8603)
893      [ ":test_renderer_generic" ]
894  testonly = true
895  if (is_mac) {
896    public_deps +=  # no-presubmit-check TODO(webrtc:8603)
897        [ ":test_renderer_objc" ]
898  }
899}
900
901rtc_library("mock_frame_transformer") {
902  visibility = [ "*" ]
903  testonly = true
904  sources = [ "mock_frame_transformer.h" ]
905  deps = [
906    "../api:frame_transformer_interface",
907    "../test:test_support",
908  ]
909}
910
911rtc_library("mock_transformable_frame") {
912  visibility = [ "*" ]
913
914  testonly = true
915  sources = [ "mock_transformable_frame.h" ]
916
917  deps = [
918    "../api:frame_transformer_interface",
919    "../test:test_support",
920  ]
921}
922
923if (is_mac) {
924  rtc_library("test_renderer_objc") {
925    testonly = true
926    visibility = [ ":test_renderer" ]
927    sources = [
928      "mac/video_renderer_mac.h",
929      "mac/video_renderer_mac.mm",
930    ]
931    deps = [
932      ":test_renderer_generic",
933      "../rtc_base:rtc_base_approved",
934    ]
935    frameworks = [
936      "Cocoa.framework",
937      "OpenGL.framework",
938      "CoreVideo.framework",
939    ]
940  }
941}
942
943rtc_library("test_renderer_generic") {
944  testonly = true
945  visibility = [
946    ":test_renderer",
947    ":test_renderer_objc",
948  ]
949  libs = []
950  sources = [
951    "video_renderer.cc",
952    "video_renderer.h",
953  ]
954  deps = [
955    "../api/video:video_frame",
956    "../common_video",
957    "../rtc_base:checks",
958  ]
959  if (is_win) {
960    sources += [
961      "win/d3d_renderer.cc",
962      "win/d3d_renderer.h",
963    ]
964    deps += [ "../api:scoped_refptr" ]
965  }
966  if (!(is_linux && rtc_use_x11) && !is_mac && !is_win) {
967    sources += [ "null_platform_renderer.cc" ]
968  }
969  if ((is_linux && rtc_use_x11) || is_mac) {
970    sources += [
971      "gl/gl_renderer.cc",
972      "gl/gl_renderer.h",
973    ]
974  }
975
976  if (is_linux && rtc_use_x11) {
977    sources += [
978      "linux/glx_renderer.cc",
979      "linux/glx_renderer.h",
980      "linux/video_renderer_linux.cc",
981    ]
982    libs += [
983      "Xext",
984      "X11",
985      "GL",
986    ]
987  }
988  if (is_android) {
989    libs += [
990      "GLESv2",
991      "log",
992    ]
993  }
994}
995
996rtc_library("audio_codec_mocks") {
997  testonly = true
998  sources = [
999    # TODO(nisse): Move these factories to their own target, to avoid
1000    # unnecessary dependencies on gmock and gtest.
1001    "audio_decoder_proxy_factory.h",
1002    "function_audio_decoder_factory.h",
1003    "mock_audio_decoder.cc",
1004    "mock_audio_decoder.h",
1005    "mock_audio_decoder_factory.h",
1006    "mock_audio_encoder.cc",
1007    "mock_audio_encoder.h",
1008    "mock_audio_encoder_factory.h",
1009  ]
1010
1011  deps = [
1012    ":test_support",
1013    "../api:array_view",
1014    "../api:scoped_refptr",
1015    "../api/audio_codecs:audio_codecs_api",
1016    "../api/audio_codecs:builtin_audio_decoder_factory",
1017    "../rtc_base:checks",
1018    "../rtc_base:refcount",
1019  ]
1020  absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
1021}
1022
1023rtc_library("copy_to_file_audio_capturer") {
1024  testonly = true
1025  sources = [
1026    "testsupport/copy_to_file_audio_capturer.cc",
1027    "testsupport/copy_to_file_audio_capturer.h",
1028  ]
1029  deps = [
1030    "../api:array_view",
1031    "../common_audio",
1032    "../modules/audio_device:audio_device_impl",
1033    "../rtc_base:rtc_base_approved",
1034  ]
1035  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
1036}
1037
1038rtc_library("copy_to_file_audio_capturer_unittest") {
1039  testonly = true
1040  sources = [ "testsupport/copy_to_file_audio_capturer_unittest.cc" ]
1041  deps = [
1042    ":copy_to_file_audio_capturer",
1043    ":fileutils",
1044    ":test_support",
1045    "../modules/audio_device:audio_device_impl",
1046  ]
1047}
1048
1049if (!build_with_chromium && is_android) {
1050  rtc_android_library("native_test_java") {
1051    testonly = true
1052    sources = [
1053      "android/org/webrtc/native_test/RTCNativeUnitTest.java",
1054      "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
1055    ]
1056    deps = [
1057      "../rtc_base:base_java",
1058      "//testing/android/native_test:native_test_java",
1059    ]
1060  }
1061}
1062
1063rtc_library("call_config_utils") {
1064  # TODO(bugs.webrtc.org/10814): Remove rtc_json_suppressions as soon as it
1065  # gets removed upstream.
1066  public_configs = [ "../rtc_base:rtc_json_suppressions" ]
1067  sources = [
1068    "call_config_utils.cc",
1069    "call_config_utils.h",
1070  ]
1071  deps = [
1072    "../call:video_stream_api",
1073    "../rtc_base:rtc_json",
1074  ]
1075}
1076