blob: ec9e880becb0a7b1f9b5ab59ab15dfce8e1061dc [file] [log] [blame]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +00001# 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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../webrtc.gni")
kjellander0f380d82016-06-01 04:48:26 -070010import("//build/config/ui.gni")
kjellander0f380d82016-06-01 04:48:26 -070011if (is_android) {
12 import("//build/config/android/rules.gni")
13}
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000014
kjellanderb62dbbe2016-09-23 00:38:52 -070015group("test") {
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000016 testonly = true
17
18 deps = [
19 ":field_trial",
kjellander0f380d82016-06-01 04:48:26 -070020 ":rtp_test_utils",
21 ":test_common",
22 ":test_renderer",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000023 ":test_support",
kjellander0f380d82016-06-01 04:48:26 -070024 ":video_test_common",
25 ]
mbonadei148d5a22017-04-28 05:24:50 -070026
oprypinfbbba3f2017-09-25 08:34:41 -070027 if (rtc_include_tests) {
mbonadei148d5a22017-04-28 05:24:50 -070028 deps += [
29 ":test_main",
30 ":test_support_unittests",
Sebastian Jansson98b07e92018-09-27 13:47:01 +020031 "scenario/scenario_tests",
mbonadei148d5a22017-04-28 05:24:50 -070032 ]
33 }
kjellander0f380d82016-06-01 04:48:26 -070034}
35
ehmaldonado38a21322016-09-02 04:10:34 -070036rtc_source_set("video_test_common") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000037 visibility = [ "*" ]
kjellander0f380d82016-06-01 04:48:26 -070038 testonly = true
39 sources = [
40 "fake_texture_frame.cc",
41 "fake_texture_frame.h",
42 "frame_generator.cc",
43 "frame_generator.h",
ehmaldonado656610f2017-02-06 02:21:11 -080044 "frame_generator_capturer.cc",
45 "frame_generator_capturer.h",
kjellander0f380d82016-06-01 04:48:26 -070046 "frame_utils.cc",
47 "frame_utils.h",
Sebastian Janssonf1f363f2018-08-13 14:24:58 +020048 "test_video_capturer.cc",
49 "test_video_capturer.h",
ehmaldonado656610f2017-02-06 02:21:11 -080050 "vcm_capturer.cc",
51 "vcm_capturer.h",
mflodman351424e2017-08-10 02:43:14 -070052 "video_codec_settings.h",
kjellander0f380d82016-06-01 04:48:26 -070053 ]
54
kjellandere40a7ee2016-10-16 23:56:12 -070055 if (!build_with_chromium && is_clang) {
56 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070057 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070058 }
59
60 deps = [
mbonadei3edccb92017-06-01 04:47:20 -070061 "..:webrtc_common",
Patrik Höglund9e194032018-01-04 15:58:20 +010062 "../api:libjingle_peerconnection_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +020063 "../api/video:video_frame",
Emircan Uysaler0823eec2018-07-13 17:10:00 -070064 "../api/video:video_frame_i010",
Niels Möllerc6ce9c52018-05-11 11:15:30 +020065 "../api/video:video_frame_i420",
mflodman351424e2017-08-10 02:43:14 -070066 "../api/video_codecs:video_codecs_api",
aleloi440b6d92017-08-22 05:43:23 -070067 "../call:video_stream_api",
kjellander0f380d82016-06-01 04:48:26 -070068 "../common_video",
sprangc5d62e22017-04-02 23:53:04 -070069 "../media:rtc_media_base",
ehmaldonado656610f2017-02-06 02:21:11 -080070 "../modules/video_capture:video_capture_module",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010071 "../rtc_base:checks",
Patrik Höglund76df0df2017-12-19 11:50:21 +010072 "../rtc_base:rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -070073 "../rtc_base:rtc_task_queue",
mbonadei3edccb92017-06-01 04:47:20 -070074 "../system_wrappers",
Danil Chapovalovabd42732018-09-10 14:07:45 +020075 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalov431abd92018-06-18 12:54:17 +020076 "//third_party/abseil-cpp/absl/types:optional",
kjellander0f380d82016-06-01 04:48:26 -070077 ]
78}
79
ehmaldonado38a21322016-09-02 04:10:34 -070080rtc_source_set("rtp_test_utils") {
kjellander0f380d82016-06-01 04:48:26 -070081 testonly = true
82 sources = [
83 "rtcp_packet_parser.cc",
84 "rtcp_packet_parser.h",
85 "rtp_file_reader.cc",
86 "rtp_file_reader.h",
87 "rtp_file_writer.cc",
88 "rtp_file_writer.h",
89 ]
90
kjellandere40a7ee2016-10-16 23:56:12 -070091 if (!build_with_chromium && is_clang) {
92 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070093 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070094 }
95
96 deps = [
97 "..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -070098 "../api:array_view",
kjellander0f380d82016-06-01 04:48:26 -070099 "../modules/rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100100 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100101 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700102 "../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +0200103 "../rtc_base/system:arch",
kjellander0f380d82016-06-01 04:48:26 -0700104 "//testing/gtest",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000105 ]
106}
107
ehmaldonado38a21322016-09-02 04:10:34 -0700108rtc_source_set("field_trial") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000109 visibility = [ "*" ]
kjellander0f380d82016-06-01 04:48:26 -0700110 testonly = true
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000111 sources = [
112 "field_trial.cc",
113 "field_trial.h",
114 ]
115
116 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000117 "..:webrtc_common",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100118 "../system_wrappers:field_trial_api",
phoglund37ebcf02016-01-08 05:04:57 -0800119 "../system_wrappers:field_trial_default",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000120 ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000121}
122
Edward Lemure66572b2018-01-05 15:34:09 +0100123rtc_source_set("perf_test") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000124 visibility = [ "*" ]
Edward Lemure66572b2018-01-05 15:34:09 +0100125 sources = [
126 "testsupport/perf_test.cc",
127 "testsupport/perf_test.h",
128 ]
129 deps = [
130 "..:webrtc_common",
131 "../api:array_view",
132 "../rtc_base:rtc_base_approved",
133 ]
134}
135
mbonadeicd95a4e2017-08-23 23:55:54 -0700136if (is_ios) {
137 rtc_source_set("test_support_objc") {
138 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700139 visibility = [ ":test_support" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700140 sources = [
141 "ios/test_support.h",
142 "ios/test_support.mm",
143 ]
denicijad207a392017-09-11 06:43:28 -0700144 deps = [
Edward Lemure66572b2018-01-05 15:34:09 +0100145 ":perf_test",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200146 "../sdk:helpers_objc",
denicijad207a392017-09-11 06:43:28 -0700147 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700148 }
149}
150
Patrik Höglund34924c22018-01-19 09:11:07 +0100151config("suppress_warning_4373") {
152 if (is_win) {
153 cflags = [
154 # MSVC has a bug which generates this warning when using mocks; see the
155 # section on warning 4373 in he googlemock FAQ. This warning isn't the
156 # least relevant for us, anyway.
157 "/wd4373",
158 ]
159 }
160}
161
Sebastian Jansson2afd2812018-08-23 14:44:05 +0200162config("test_main_direct_config") {
163 visibility = [ ":*" ]
164 defines = [ "UNIT_TEST" ]
165}
mbonadei148d5a22017-04-28 05:24:50 -0700166rtc_source_set("test_support") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000167 visibility = [ "*" ]
mbonadei148d5a22017-04-28 05:24:50 -0700168 testonly = true
kjellander32c4a202016-08-30 02:53:49 -0700169
Mirko Bonadei65ce3112018-01-26 11:57:47 +0100170 all_dependent_configs = [
171 ":suppress_warning_4373",
172 "//third_party/googletest:gmock_config",
173 "//third_party/googletest:gtest_config",
174 ]
Patrik Höglund34924c22018-01-19 09:11:07 +0100175
mbonadei148d5a22017-04-28 05:24:50 -0700176 sources = [
177 "gmock.h",
178 "gtest.h",
mbonadei148d5a22017-04-28 05:24:50 -0700179 ]
180
Patrik Höglund7696bef2018-03-15 15:05:39 +0100181 public_deps = []
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200182 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700183 public_deps += [ ":test_support_objc" ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200184 }
185
Sebastian Jansson2afd2812018-08-23 14:44:05 +0200186 public_configs = [ ":test_main_direct_config" ]
mbonadei148d5a22017-04-28 05:24:50 -0700187 deps = [
ehmaldonadof6a861a2017-07-19 10:40:47 -0700188 "../rtc_base:rtc_base_approved",
mbonadei148d5a22017-04-28 05:24:50 -0700189 "//testing/gmock",
190 "//testing/gtest",
191 ]
192
mbonadei148d5a22017-04-28 05:24:50 -0700193 if (!build_with_chromium && is_clang) {
194 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
195 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
196 }
kjellander32c4a202016-08-30 02:53:49 -0700197}
198
oprypinfbbba3f2017-09-25 08:34:41 -0700199if (rtc_include_tests) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000200 rtc_source_set("test_main") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000201 visibility = [ "*" ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200202 testonly = true
Oleh Prypin5ab68542017-09-25 09:18:00 +0000203 sources = [
204 "test_main.cc",
205 ]
206
207 public_deps = [
208 ":test_support",
209 ]
210 deps = [
211 ":field_trial",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100212 ":fileutils",
Edward Lemure66572b2018-01-05 15:34:09 +0100213 ":perf_test",
Niels Möller8909a632018-09-06 08:42:44 +0200214 "../rtc_base:rtc_base",
Bjorn Tereliusedab3012018-01-31 17:23:40 +0100215 "../system_wrappers:field_trial_default",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000216 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000217 "../system_wrappers:runtime_enabled_features_default",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000218 "//testing/gtest",
mbonadei9452c622017-04-27 12:29:29 -0700219 ]
220 }
mbonadei9452c622017-04-27 12:29:29 -0700221
Oleh Prypin5ab68542017-09-25 09:18:00 +0000222 rtc_source_set("video_test_support") {
223 testonly = true
224
225 sources = [
226 "testsupport/frame_reader.h",
227 "testsupport/frame_writer.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000228 "testsupport/mock/mock_frame_reader.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000229 "testsupport/y4m_frame_writer.cc",
230 "testsupport/yuv_frame_reader.cc",
231 "testsupport/yuv_frame_writer.cc",
232 ]
233
234 deps = [
Patrik Höglund7696bef2018-03-15 15:05:39 +0100235 ":fileutils",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000236 ":test_support",
237 ":video_test_common",
238 "..:webrtc_common",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200239 "../api/video:video_frame",
240 "../api/video:video_frame_i420",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000241 "../common_video",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100242 "../rtc_base:checks",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000243 "../rtc_base:rtc_base_approved",
244 "../system_wrappers",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000245 "//testing/gtest",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100246 "//third_party/libyuv",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000247 ]
248
249 if (!is_ios) {
250 deps += [ "//third_party:jpeg" ]
251 sources += [ "testsupport/jpeg_frame_writer.cc" ]
252 } else {
253 sources += [ "testsupport/jpeg_frame_writer_ios.cc" ]
254 }
255
Oleh Prypin5ab68542017-09-25 09:18:00 +0000256 if (!build_with_chromium && is_clang) {
257 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
258 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
259 }
260
261 if (is_android) {
262 deps += [ "//base:base" ]
263 }
Oleh Prypin5ab68542017-09-25 09:18:00 +0000264 }
265
Edward Lemuraf8659a2017-09-27 14:46:24 +0200266 rtc_source_set("test_support_test_artifacts") {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000267 testonly = true
268 sources = [
Edward Lemuraf8659a2017-09-27 14:46:24 +0200269 "testsupport/test_artifacts.cc",
270 "testsupport/test_artifacts.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000271 ]
272 deps = [
273 ":fileutils",
274 "../rtc_base:rtc_base_approved",
275 ]
276 }
277
278 test_support_unittests_resources = [
279 "../resources/foreman_cif_short.yuv",
280 "../resources/video_coding/frame-ethernet-ii.pcap",
281 "../resources/video_coding/frame-loopback.pcap",
282 "../resources/video_coding/pltype103.rtp",
283 "../resources/video_coding/pltype103_header_only.rtp",
284 "../resources/video_coding/ssrcs-2.pcap",
285 "../resources/video_coding/ssrcs-3.pcap",
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200286 ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200287
288 if (is_ios) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000289 bundle_data("test_support_unittests_bundle_data") {
290 testonly = true
291 sources = test_support_unittests_resources
292 outputs = [
293 "{{bundle_resources_dir}}/{{source_file_part}}",
294 ]
295 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200296 }
297
Oleh Prypin5ab68542017-09-25 09:18:00 +0000298 rtc_test("test_support_unittests") {
299 deps = [
Sebastian Jansson09408112018-04-24 14:41:22 +0200300 ":direct_transport",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200301 ":fake_video_codecs",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100302 ":fileutils",
Mirko Bonadei46399992018-08-22 15:32:38 +0200303 ":fileutils_unittests",
Edward Lemure66572b2018-01-05 15:34:09 +0100304 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000305 ":rtp_test_utils",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200306 ":test_common",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200307 ":test_main",
308 ":test_support",
309 ":test_support_test_artifacts",
310 ":video_test_common",
311 ":video_test_support",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200312 "../api:create_simulcast_test_fixture_api",
313 "../api:simulcast_test_fixture_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200314 "../api/video:video_frame_i420",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200315 "../modules/rtp_rtcp:rtp_rtcp",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200316 "../modules/video_capture",
317 "../modules/video_coding:simulcast_test_fixture_impl",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000318 "../rtc_base:rtc_base_approved",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200319 "../test:single_threaded_task_queue",
Sebastian Jansson98b07e92018-09-27 13:47:01 +0200320 "scenario:scenario_unittests",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200321 "//testing/gmock",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200322 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200323 "//third_party/abseil-cpp/absl/memory",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000324 ]
325 sources = [
Sebastian Jansson09408112018-04-24 14:41:22 +0200326 "direct_transport_unittest.cc",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200327 "fake_vp8_encoder_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000328 "frame_generator_unittest.cc",
329 "rtp_file_reader_unittest.cc",
330 "rtp_file_writer_unittest.cc",
331 "single_threaded_task_queue_unittest.cc",
332 "testsupport/always_passing_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000333 "testsupport/perf_test_unittest.cc",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200334 "testsupport/test_artifacts_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000335 "testsupport/y4m_frame_writer_unittest.cc",
336 "testsupport/yuv_frame_reader_unittest.cc",
337 "testsupport/yuv_frame_writer_unittest.cc",
338 ]
339
Oleh Prypin5ab68542017-09-25 09:18:00 +0000340 if (!build_with_chromium && is_clang) {
341 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
342 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
343 }
344
345 data = test_support_unittests_resources
346 if (is_android) {
347 deps += [ "//testing/android/native_test:native_test_support" ]
348 shard_timeout = 900
349 }
350
351 if (is_ios) {
352 deps += [ ":test_support_unittests_bundle_data" ]
353 }
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200354
Mirko Bonadei9098b302018-04-06 10:48:10 +0200355 if (!is_android && !build_with_chromium) {
356 # This is needed in order to avoid:
357 # undefined symbol: webrtc::videocapturemodule::VideoCaptureImpl::Create
358 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
359 }
Oleh Prypin5ab68542017-09-25 09:18:00 +0000360 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200361}
362
mbonadeicd95a4e2017-08-23 23:55:54 -0700363if (is_ios) {
364 rtc_source_set("fileutils_objc") {
mbonadei9c296b32017-09-05 05:11:41 -0700365 visibility = [ ":fileutils" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700366 sources = [
367 "testsupport/iosfileutils.mm",
368 ]
369 deps = [
370 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100371 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700372 "../rtc_base:rtc_base_approved",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200373 "../sdk:helpers_objc",
mbonadeicd95a4e2017-08-23 23:55:54 -0700374 ]
375 }
376}
377
mbonadei9452c622017-04-27 12:29:29 -0700378rtc_source_set("fileutils") {
379 testonly = true
Patrik Höglund7696bef2018-03-15 15:05:39 +0100380 visibility = [ "*" ]
mbonadei9452c622017-04-27 12:29:29 -0700381 sources = [
382 "testsupport/fileutils.cc",
383 "testsupport/fileutils.h",
384 ]
mbonadei3edccb92017-06-01 04:47:20 -0700385 deps = [
386 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100387 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700388 "../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +0200389 "../rtc_base/system:arch",
Danil Chapovalov431abd92018-06-18 12:54:17 +0200390 "//third_party/abseil-cpp/absl/types:optional",
mbonadei3edccb92017-06-01 04:47:20 -0700391 ]
mbonadei9452c622017-04-27 12:29:29 -0700392 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700393 deps += [ ":fileutils_objc" ]
mbonadei3edccb92017-06-01 04:47:20 -0700394 }
395 if (is_win) {
ehmaldonadof6a861a2017-07-19 10:40:47 -0700396 deps += [ "../rtc_base:rtc_base" ]
mbonadei9452c622017-04-27 12:29:29 -0700397 }
mbonadei9452c622017-04-27 12:29:29 -0700398}
399
400rtc_source_set("run_test") {
401 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700402 if (is_mac) {
403 public_deps = [
404 ":run_test_objc",
405 ]
406 } else {
407 public_deps = [
408 ":run_test_generic",
409 ]
410 }
411}
412
413rtc_source_set("run_test_interface") {
mbonadei9452c622017-04-27 12:29:29 -0700414 sources = [
415 "run_test.h",
416 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700417}
418
419if (is_mac) {
420 rtc_source_set("run_test_objc") {
421 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700422 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700423 sources = [
424 "mac/run_test.mm",
425 ]
mbonadei9c296b32017-09-05 05:11:41 -0700426 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700427 ":run_test_interface",
428 ]
mbonadei9452c622017-04-27 12:29:29 -0700429 }
430}
431
mbonadeicd95a4e2017-08-23 23:55:54 -0700432rtc_source_set("run_test_generic") {
433 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700434 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700435 sources = [
436 "run_test.cc",
437 ]
mbonadei9c296b32017-09-05 05:11:41 -0700438 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700439 ":run_test_interface",
440 ]
441}
442
ehmaldonado37535bf2016-12-05 06:42:45 -0800443rtc_source_set("fileutils_unittests") {
444 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700445 visibility = [ ":*" ] # Only targets in this file can depend on this.
ehmaldonado37535bf2016-12-05 06:42:45 -0800446 sources = [
447 "testsupport/fileutils_unittest.cc",
448 ]
449 deps = [
450 ":fileutils",
mbonadei3edccb92017-06-01 04:47:20 -0700451 ":test_support",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100452 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700453 "../rtc_base:rtc_base_approved",
ehmaldonado37535bf2016-12-05 06:42:45 -0800454 "//testing/gtest",
Danil Chapovalov431abd92018-06-18 12:54:17 +0200455 "//third_party/abseil-cpp/absl/types:optional",
ehmaldonado37535bf2016-12-05 06:42:45 -0800456 ]
457}
kjellander0f380d82016-06-01 04:48:26 -0700458
perkj488c5dc2017-02-08 05:55:51 -0800459rtc_source_set("direct_transport") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000460 visibility = [ "*" ]
perkj488c5dc2017-02-08 05:55:51 -0800461 testonly = true
462 sources = [
463 "direct_transport.cc",
464 "direct_transport.h",
perkj488c5dc2017-02-08 05:55:51 -0800465 ]
466 if (!build_with_chromium && is_clang) {
467 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
468 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
469 }
470 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700471 "..:webrtc_common",
Artem Titov46c4e602018-08-17 14:26:54 +0200472 "../api:simulated_network_api",
perkj488c5dc2017-02-08 05:55:51 -0800473 "../api:transport_api",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100474 "../call:call_interfaces",
Artem Titov46c4e602018-08-17 14:26:54 +0200475 "../call:simulated_packet_receiver",
mbonadei3edccb92017-06-01 04:47:20 -0700476 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700477 "../rtc_base:rtc_base_approved",
eladalon413ee9a2017-08-22 04:02:52 -0700478 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700479 "../system_wrappers",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200480 "//third_party/abseil-cpp/absl/memory",
perkj488c5dc2017-02-08 05:55:51 -0800481 ]
eladalon413ee9a2017-08-22 04:02:52 -0700482 public_deps = [
483 ":single_threaded_task_queue",
Erik Språng09708512018-03-14 15:16:50 +0100484 "../call:fake_network",
eladalon413ee9a2017-08-22 04:02:52 -0700485 ]
486}
487
488rtc_source_set("single_threaded_task_queue") {
489 testonly = true
490 sources = [
491 "single_threaded_task_queue.cc",
492 "single_threaded_task_queue.h",
493 ]
494 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100495 "../rtc_base:checks",
eladalon413ee9a2017-08-22 04:02:52 -0700496 "../rtc_base:rtc_base_approved",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200497 "//third_party/abseil-cpp/absl/memory",
eladalon413ee9a2017-08-22 04:02:52 -0700498 ]
perkj488c5dc2017-02-08 05:55:51 -0800499}
500
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200501rtc_source_set("fake_video_codecs") {
502 testonly = true
503 visibility = [ "*" ]
504 sources = [
505 "configurable_frame_size_encoder.cc",
506 "configurable_frame_size_encoder.h",
507 "fake_decoder.cc",
508 "fake_decoder.h",
509 "fake_encoder.cc",
510 "fake_encoder.h",
511 "fake_vp8_encoder.cc",
512 "fake_vp8_encoder.h",
513 ]
514 if (!build_with_chromium && is_clang) {
515 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
516 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
517 }
518 deps = [
519 "..:webrtc_common",
520 "../api/video:video_frame_i420",
521 "../api/video_codecs:video_codecs_api",
522 "../common_video:common_video",
523 "../modules/video_coding:video_codec_interface",
524 "../modules/video_coding:video_coding_utility",
525 "../modules/video_coding:webrtc_h264",
526 "../modules/video_coding:webrtc_vp8",
527 "../modules/video_coding:webrtc_vp9",
528 "../rtc_base:checks",
529 "../rtc_base:rtc_base_approved",
530 "../rtc_base:rtc_task_queue",
531 "../rtc_base:sequenced_task_checker",
532 "../system_wrappers",
533 ]
534}
535
ehmaldonado38a21322016-09-02 04:10:34 -0700536rtc_source_set("test_common") {
kjellander0f380d82016-06-01 04:48:26 -0700537 testonly = true
538 sources = [
539 "call_test.cc",
540 "call_test.h",
kjellander0f380d82016-06-01 04:48:26 -0700541 "constants.cc",
542 "constants.h",
kjellander0f380d82016-06-01 04:48:26 -0700543 "drifting_clock.cc",
544 "drifting_clock.h",
545 "encoder_settings.cc",
546 "encoder_settings.h",
sakal55d932b2016-09-30 06:19:08 -0700547 "fake_videorenderer.h",
Rasmus Brandt0cedc052018-05-31 12:53:00 +0200548 "function_video_decoder_factory.h",
Niels Möller4db138e2018-04-19 09:04:13 +0200549 "function_video_encoder_factory.h",
kjellander0f380d82016-06-01 04:48:26 -0700550 "layer_filtering_transport.cc",
551 "layer_filtering_transport.h",
Danil Chapovalovdd7e2842018-03-09 15:37:03 +0000552 "mock_transport.cc",
kjellander0f380d82016-06-01 04:48:26 -0700553 "mock_transport.h",
kjellander0f380d82016-06-01 04:48:26 -0700554 "null_transport.cc",
555 "null_transport.h",
556 "rtp_rtcp_observer.h",
557 "statistics.cc",
558 "statistics.h",
Oleh Prypinefb94d52018-09-27 13:55:36 +0000559 "video_decoder_proxy_factory.h",
560 "video_encoder_proxy_factory.h",
kjellander0f380d82016-06-01 04:48:26 -0700561 "win/run_loop_win.cc",
562 ]
563 if (!is_win) {
564 sources += [
565 "run_loop.cc",
566 "run_loop.h",
567 ]
568 }
569
kjellandere40a7ee2016-10-16 23:56:12 -0700570 if (!build_with_chromium && is_clang) {
571 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700572 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700573 }
574
575 deps = [
perkj488c5dc2017-02-08 05:55:51 -0800576 ":direct_transport",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200577 ":fake_video_codecs",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100578 ":fileutils",
kjellander0f380d82016-06-01 04:48:26 -0700579 ":rtp_test_utils",
580 ":test_support",
perkjc5726c12017-03-01 03:37:08 -0800581 ":video_test_common",
Patrik Höglundbe214a22018-01-04 12:14:35 +0100582 "../api:libjingle_peerconnection_api",
Artem Titov46c4e602018-08-17 14:26:54 +0200583 "../api:simulated_network_api",
mbonadei3edccb92017-06-01 04:47:20 -0700584 "../api:transport_api",
mbonadei3edccb92017-06-01 04:47:20 -0700585 "../api/audio_codecs:builtin_audio_decoder_factory",
ossueb1fde42017-05-02 06:46:30 -0700586 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200587 "../api/video:video_frame",
ilnikd60d06a2017-04-05 03:02:20 -0700588 "../api/video_codecs:video_codecs_api",
kjellander94cee312016-06-10 01:56:57 -0700589 "../audio",
kjellander94cee312016-06-10 01:56:57 -0700590 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100591 "../call:call_interfaces",
Artem Titov4e199e92018-08-20 13:30:39 +0200592 "../call:fake_network",
sprangdb2a9fc2017-08-09 06:42:32 -0700593 "../call:rtp_sender",
Artem Titov4e199e92018-08-20 13:30:39 +0200594 "../call:simulated_network",
Artem Titov46c4e602018-08-17 14:26:54 +0200595 "../call:simulated_packet_receiver",
aleloi440b6d92017-08-22 05:43:23 -0700596 "../call:video_stream_api",
mbonadei3edccb92017-06-01 04:47:20 -0700597 "../logging:rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800598 "../logging:rtc_event_log_impl_base",
Emircan Uysaler03e6ec92018-03-09 15:03:26 -0800599 "../media:rtc_internal_video_codecs",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100600 "../media:rtc_media_base",
Artem Titov3faa8322018-03-07 14:44:00 +0100601 "../modules/audio_device",
Paulina Hensman7bd79a02018-03-15 12:44:12 +0100602 "../modules/audio_device:audio_device_impl",
mbonadei3edccb92017-06-01 04:47:20 -0700603 "../modules/audio_device:mock_audio_device",
aleloi10111bc2016-11-17 06:48:48 -0800604 "../modules/audio_mixer:audio_mixer_impl",
aleloidd310712016-11-17 06:28:59 -0800605 "../modules/audio_processing",
Sebastian Jansson50eb4c42018-08-03 13:25:17 +0200606 "../modules/congestion_controller/bbr",
mbonadei3edccb92017-06-01 04:47:20 -0700607 "../modules/rtp_rtcp",
608 "../modules/rtp_rtcp:mock_rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100609 "../modules/rtp_rtcp:rtp_rtcp_format",
charujaincb728ea2017-09-18 03:08:08 -0700610 "../modules/video_coding:video_coding_utility",
mbonadei3edccb92017-06-01 04:47:20 -0700611 "../modules/video_coding:webrtc_h264",
Emircan Uysaler03e6ec92018-03-09 15:03:26 -0800612 "../modules/video_coding:webrtc_multiplex",
Sergio Garcia Murillo43800f92018-06-21 16:16:38 +0200613 "../modules/video_coding:webrtc_vp8",
mbonadei3edccb92017-06-01 04:47:20 -0700614 "../modules/video_coding:webrtc_vp9",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100615 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700616 "../rtc_base:rtc_base_approved",
Sebastian Jansson50eb4c42018-08-03 13:25:17 +0200617 "../rtc_base/experiments:congestion_controller_experiment",
mbonadei3edccb92017-06-01 04:47:20 -0700618 "../system_wrappers",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100619 "../system_wrappers:field_trial_api",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000620 "../system_wrappers:runtime_enabled_features_api",
kjellander94cee312016-06-10 01:56:57 -0700621 "../video",
kjellander0f380d82016-06-01 04:48:26 -0700622 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200623 "//third_party/abseil-cpp/absl/memory",
kjellander0f380d82016-06-01 04:48:26 -0700624 ]
mbonadei148d5a22017-04-28 05:24:50 -0700625 if (!is_android && !build_with_chromium) {
oprypin92220ff2017-03-23 03:40:03 -0700626 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
627 }
kjellander0f380d82016-06-01 04:48:26 -0700628}
629
ehmaldonado38a21322016-09-02 04:10:34 -0700630rtc_source_set("test_renderer") {
mbonadei9c296b32017-09-05 05:11:41 -0700631 public_deps = [
632 ":test_renderer_generic",
633 ]
kjellander0f380d82016-06-01 04:48:26 -0700634 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700635 if (is_mac) {
mbonadei9c296b32017-09-05 05:11:41 -0700636 public_deps += [ ":test_renderer_objc" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700637 }
638}
639
640if (is_mac) {
641 rtc_source_set("test_renderer_objc") {
642 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700643 visibility = [ ":test_renderer" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700644 sources = [
645 "mac/video_renderer_mac.h",
646 "mac/video_renderer_mac.mm",
647 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700648 deps = [
mbonadei9c296b32017-09-05 05:11:41 -0700649 ":test_renderer_generic",
mbonadeicd95a4e2017-08-23 23:55:54 -0700650 "../rtc_base:rtc_base_approved",
651 ]
652 libs = [
653 "Cocoa.framework",
654 "OpenGL.framework",
655 "CoreVideo.framework",
656 ]
657 if (!build_with_chromium && is_clang) {
658 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
659 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
660 }
661 }
662}
663
664rtc_source_set("test_renderer_generic") {
665 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700666 visibility = [
667 ":test_renderer",
668 ":test_renderer_objc",
669 ]
kjellander0f380d82016-06-01 04:48:26 -0700670 libs = []
671 sources = [
kjellander0f380d82016-06-01 04:48:26 -0700672 "video_renderer.cc",
673 "video_renderer.h",
674 "win/d3d_renderer.cc",
675 "win/d3d_renderer.h",
676 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700677 deps = [
678 ":test_support",
679 "..:webrtc_common",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200680 "../api/video:video_frame",
mbonadeicd95a4e2017-08-23 23:55:54 -0700681 "../common_video",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100682 "../media:rtc_media_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100683 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700684 "../rtc_base:rtc_base_approved",
685 "//testing/gtest",
686 ]
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100687 if (!(is_linux && rtc_use_x11) && !is_mac && !is_win) {
kjellander0f380d82016-06-01 04:48:26 -0700688 sources += [ "null_platform_renderer.cc" ]
689 }
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100690 if ((is_linux && rtc_use_x11) || is_mac) {
kjellander0f380d82016-06-01 04:48:26 -0700691 sources += [
692 "gl/gl_renderer.cc",
693 "gl/gl_renderer.h",
694 ]
695 }
696
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100697 if (is_linux && rtc_use_x11) {
Edward Lemur84a87c42017-11-07 19:07:31 +0100698 sources += [
699 "linux/glx_renderer.cc",
700 "linux/glx_renderer.h",
701 "linux/video_renderer_linux.cc",
702 ]
kjellander0f380d82016-06-01 04:48:26 -0700703 libs += [
704 "Xext",
705 "X11",
706 "GL",
707 ]
708 }
709 if (is_android) {
710 libs += [
711 "GLESv2",
712 "log",
713 ]
714 }
kjellander0f380d82016-06-01 04:48:26 -0700715
kjellandere40a7ee2016-10-16 23:56:12 -0700716 if (!build_with_chromium && is_clang) {
717 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700718 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700719 }
kjellander0f380d82016-06-01 04:48:26 -0700720}
kwiberg37e99fd2017-04-10 05:15:48 -0700721
722rtc_source_set("audio_codec_mocks") {
723 testonly = true
724 sources = [
kwiberg2b3aa142017-06-14 03:31:17 -0700725 "mock_audio_decoder.cc",
kwiberg37e99fd2017-04-10 05:15:48 -0700726 "mock_audio_decoder.h",
727 "mock_audio_decoder_factory.h",
ossueb1fde42017-05-02 06:46:30 -0700728 "mock_audio_encoder.cc",
729 "mock_audio_encoder.h",
730 "mock_audio_encoder_factory.h",
731 ]
732
733 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700734 ":test_support",
kwiberg529662a2017-09-04 05:43:17 -0700735 "../api:array_view",
ossueb1fde42017-05-02 06:46:30 -0700736 "../api/audio_codecs:audio_codecs_api",
mbonadei3edccb92017-06-01 04:47:20 -0700737 "../api/audio_codecs:builtin_audio_decoder_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700738 "../rtc_base:rtc_base_approved",
kwiberg37e99fd2017-04-10 05:15:48 -0700739 ]
740}
sakald7fdb802017-05-26 01:51:53 -0700741
742if (!build_with_chromium && is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000743 rtc_android_library("native_test_java") {
sakald7fdb802017-05-26 01:51:53 -0700744 testonly = true
745 java_files = [
746 "android/org/webrtc/native_test/RTCNativeUnitTest.java",
747 "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
748 ]
749 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700750 "../rtc_base:base_java",
sakald7fdb802017-05-26 01:51:53 -0700751 "//testing/android/native_test:native_test_java",
sakald7fdb802017-05-26 01:51:53 -0700752 ]
753 }
754}