blob: 9b4ba418f71c93035b2b3cf97acb314321db3aa2 [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",
31 ]
32 }
kjellander0f380d82016-06-01 04:48:26 -070033}
34
ehmaldonado38a21322016-09-02 04:10:34 -070035rtc_source_set("video_test_common") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000036 visibility = [ "*" ]
kjellander0f380d82016-06-01 04:48:26 -070037 testonly = true
38 sources = [
39 "fake_texture_frame.cc",
40 "fake_texture_frame.h",
41 "frame_generator.cc",
42 "frame_generator.h",
ehmaldonado656610f2017-02-06 02:21:11 -080043 "frame_generator_capturer.cc",
44 "frame_generator_capturer.h",
kjellander0f380d82016-06-01 04:48:26 -070045 "frame_utils.cc",
46 "frame_utils.h",
ehmaldonado656610f2017-02-06 02:21:11 -080047 "vcm_capturer.cc",
48 "vcm_capturer.h",
sprangc5d62e22017-04-02 23:53:04 -070049 "video_capturer.cc",
ehmaldonado656610f2017-02-06 02:21:11 -080050 "video_capturer.h",
mflodman351424e2017-08-10 02:43:14 -070051 "video_codec_settings.h",
kjellander0f380d82016-06-01 04:48:26 -070052 ]
53
kjellandere40a7ee2016-10-16 23:56:12 -070054 if (!build_with_chromium && is_clang) {
55 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070056 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070057 }
58
59 deps = [
mbonadei3edccb92017-06-01 04:47:20 -070060 "..:webrtc_common",
Patrik Höglund9e194032018-01-04 15:58:20 +010061 "../api:libjingle_peerconnection_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +020062 "../api/video:video_frame",
Emircan Uysaler0823eec2018-07-13 17:10:00 -070063 "../api/video:video_frame_i010",
Niels Möllerc6ce9c52018-05-11 11:15:30 +020064 "../api/video:video_frame_i420",
mflodman351424e2017-08-10 02:43:14 -070065 "../api/video_codecs:video_codecs_api",
aleloi440b6d92017-08-22 05:43:23 -070066 "../call:video_stream_api",
kjellander0f380d82016-06-01 04:48:26 -070067 "../common_video",
sprangc5d62e22017-04-02 23:53:04 -070068 "../media:rtc_media_base",
ehmaldonado656610f2017-02-06 02:21:11 -080069 "../modules/video_capture:video_capture_module",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010070 "../rtc_base:checks",
Patrik Höglund76df0df2017-12-19 11:50:21 +010071 "../rtc_base:rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -070072 "../rtc_base:rtc_task_queue",
mbonadei3edccb92017-06-01 04:47:20 -070073 "../system_wrappers",
Danil Chapovalov431abd92018-06-18 12:54:17 +020074 "//third_party/abseil-cpp/absl/types:optional",
kjellander0f380d82016-06-01 04:48:26 -070075 ]
76}
77
ehmaldonado38a21322016-09-02 04:10:34 -070078rtc_source_set("rtp_test_utils") {
kjellander0f380d82016-06-01 04:48:26 -070079 testonly = true
80 sources = [
81 "rtcp_packet_parser.cc",
82 "rtcp_packet_parser.h",
83 "rtp_file_reader.cc",
84 "rtp_file_reader.h",
85 "rtp_file_writer.cc",
86 "rtp_file_writer.h",
87 ]
88
kjellandere40a7ee2016-10-16 23:56:12 -070089 if (!build_with_chromium && is_clang) {
90 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070091 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070092 }
93
94 deps = [
95 "..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -070096 "../api:array_view",
kjellander0f380d82016-06-01 04:48:26 -070097 "../modules/rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +010098 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010099 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700100 "../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +0200101 "../rtc_base/system:arch",
kjellander0f380d82016-06-01 04:48:26 -0700102 "//testing/gtest",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000103 ]
104}
105
ehmaldonado38a21322016-09-02 04:10:34 -0700106rtc_source_set("field_trial") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000107 visibility = [ "*" ]
kjellander0f380d82016-06-01 04:48:26 -0700108 testonly = true
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000109 sources = [
110 "field_trial.cc",
111 "field_trial.h",
112 ]
113
114 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000115 "..:webrtc_common",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100116 "../system_wrappers:field_trial_api",
phoglund37ebcf02016-01-08 05:04:57 -0800117 "../system_wrappers:field_trial_default",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000118 ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000119}
120
Edward Lemure66572b2018-01-05 15:34:09 +0100121rtc_source_set("perf_test") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000122 visibility = [ "*" ]
Edward Lemure66572b2018-01-05 15:34:09 +0100123 sources = [
124 "testsupport/perf_test.cc",
125 "testsupport/perf_test.h",
126 ]
127 deps = [
128 "..:webrtc_common",
129 "../api:array_view",
130 "../rtc_base:rtc_base_approved",
131 ]
132}
133
mbonadeicd95a4e2017-08-23 23:55:54 -0700134if (is_ios) {
135 rtc_source_set("test_support_objc") {
136 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700137 visibility = [ ":test_support" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700138 sources = [
139 "ios/test_support.h",
140 "ios/test_support.mm",
141 ]
denicijad207a392017-09-11 06:43:28 -0700142 deps = [
Edward Lemure66572b2018-01-05 15:34:09 +0100143 ":perf_test",
denicijad207a392017-09-11 06:43:28 -0700144 "../sdk:common_objc",
145 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700146 }
147}
148
Patrik Höglund34924c22018-01-19 09:11:07 +0100149config("suppress_warning_4373") {
150 if (is_win) {
151 cflags = [
152 # MSVC has a bug which generates this warning when using mocks; see the
153 # section on warning 4373 in he googlemock FAQ. This warning isn't the
154 # least relevant for us, anyway.
155 "/wd4373",
156 ]
157 }
158}
159
mbonadei148d5a22017-04-28 05:24:50 -0700160rtc_source_set("test_support") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000161 visibility = [ "*" ]
mbonadei148d5a22017-04-28 05:24:50 -0700162 testonly = true
kjellander32c4a202016-08-30 02:53:49 -0700163
Mirko Bonadei65ce3112018-01-26 11:57:47 +0100164 all_dependent_configs = [
165 ":suppress_warning_4373",
166 "//third_party/googletest:gmock_config",
167 "//third_party/googletest:gtest_config",
168 ]
Patrik Höglund34924c22018-01-19 09:11:07 +0100169
mbonadei148d5a22017-04-28 05:24:50 -0700170 sources = [
171 "gmock.h",
172 "gtest.h",
mbonadei148d5a22017-04-28 05:24:50 -0700173 ]
174
Patrik Höglund7696bef2018-03-15 15:05:39 +0100175 public_deps = []
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200176 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700177 public_deps += [ ":test_support_objc" ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200178 }
179
mbonadei148d5a22017-04-28 05:24:50 -0700180 deps = [
ehmaldonadof6a861a2017-07-19 10:40:47 -0700181 "../rtc_base:rtc_base_approved",
mbonadei148d5a22017-04-28 05:24:50 -0700182 "//testing/gmock",
183 "//testing/gtest",
184 ]
185
mbonadei148d5a22017-04-28 05:24:50 -0700186 if (!build_with_chromium && is_clang) {
187 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
188 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
189 }
190
mbonadei148d5a22017-04-28 05:24:50 -0700191 if (is_ios && !build_with_chromium) {
kthelgason36d658d2017-08-24 05:43:45 -0700192 deps += [ "../sdk:common_objc" ]
mbonadei148d5a22017-04-28 05:24:50 -0700193 }
kjellander32c4a202016-08-30 02:53:49 -0700194}
195
oprypinfbbba3f2017-09-25 08:34:41 -0700196if (rtc_include_tests) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000197 rtc_source_set("test_main") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000198 visibility = [ "*" ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200199 testonly = true
Oleh Prypin5ab68542017-09-25 09:18:00 +0000200 sources = [
201 "test_main.cc",
202 ]
203
204 public_deps = [
205 ":test_support",
206 ]
207 deps = [
208 ":field_trial",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100209 ":fileutils",
Edward Lemure66572b2018-01-05 15:34:09 +0100210 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000211 "../rtc_base:rtc_base_approved",
Bjorn Tereliusedab3012018-01-31 17:23:40 +0100212 "../system_wrappers:field_trial_default",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000213 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000214 "../system_wrappers:runtime_enabled_features_default",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000215 "//testing/gtest",
mbonadei9452c622017-04-27 12:29:29 -0700216 ]
217 }
mbonadei9452c622017-04-27 12:29:29 -0700218
Oleh Prypin5ab68542017-09-25 09:18:00 +0000219 rtc_source_set("video_test_support") {
220 testonly = true
221
222 sources = [
223 "testsupport/frame_reader.h",
224 "testsupport/frame_writer.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000225 "testsupport/mock/mock_frame_reader.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000226 "testsupport/y4m_frame_writer.cc",
227 "testsupport/yuv_frame_reader.cc",
228 "testsupport/yuv_frame_writer.cc",
229 ]
230
231 deps = [
Patrik Höglund7696bef2018-03-15 15:05:39 +0100232 ":fileutils",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000233 ":test_support",
234 ":video_test_common",
235 "..:webrtc_common",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200236 "../api/video:video_frame",
237 "../api/video:video_frame_i420",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000238 "../common_video",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100239 "../rtc_base:checks",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000240 "../rtc_base:rtc_base_approved",
241 "../system_wrappers",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000242 "//testing/gtest",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100243 "//third_party/libyuv",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000244 ]
245
246 if (!is_ios) {
247 deps += [ "//third_party:jpeg" ]
248 sources += [ "testsupport/jpeg_frame_writer.cc" ]
249 } else {
250 sources += [ "testsupport/jpeg_frame_writer_ios.cc" ]
251 }
252
Oleh Prypin5ab68542017-09-25 09:18:00 +0000253 if (!build_with_chromium && is_clang) {
254 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
255 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
256 }
257
258 if (is_android) {
259 deps += [ "//base:base" ]
260 }
261
262 if (is_ios) {
263 deps += [ "../sdk:common_objc" ]
264 }
Oleh Prypin5ab68542017-09-25 09:18:00 +0000265 }
266
Edward Lemuraf8659a2017-09-27 14:46:24 +0200267 rtc_source_set("test_support_test_artifacts") {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000268 testonly = true
269 sources = [
Edward Lemuraf8659a2017-09-27 14:46:24 +0200270 "testsupport/test_artifacts.cc",
271 "testsupport/test_artifacts.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000272 ]
273 deps = [
274 ":fileutils",
275 "../rtc_base:rtc_base_approved",
276 ]
277 }
278
279 test_support_unittests_resources = [
280 "../resources/foreman_cif_short.yuv",
281 "../resources/video_coding/frame-ethernet-ii.pcap",
282 "../resources/video_coding/frame-loopback.pcap",
283 "../resources/video_coding/pltype103.rtp",
284 "../resources/video_coding/pltype103_header_only.rtp",
285 "../resources/video_coding/ssrcs-2.pcap",
286 "../resources/video_coding/ssrcs-3.pcap",
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200287 ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200288
289 if (is_ios) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000290 bundle_data("test_support_unittests_bundle_data") {
291 testonly = true
292 sources = test_support_unittests_resources
293 outputs = [
294 "{{bundle_resources_dir}}/{{source_file_part}}",
295 ]
296 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200297 }
298
Oleh Prypin5ab68542017-09-25 09:18:00 +0000299 rtc_test("test_support_unittests") {
300 deps = [
Sebastian Jansson09408112018-04-24 14:41:22 +0200301 ":direct_transport",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100302 ":fileutils",
Edward Lemure66572b2018-01-05 15:34:09 +0100303 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000304 ":rtp_test_utils",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200305 ":test_main",
306 ":test_support",
307 ":test_support_test_artifacts",
308 ":video_test_common",
309 ":video_test_support",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200310 "../api/video:video_frame_i420",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200311 "../modules/rtp_rtcp:rtp_rtcp",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000312 "../rtc_base:rtc_base_approved",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200313 "../test:single_threaded_task_queue",
314 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200315 "//third_party/abseil-cpp/absl/memory",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000316 ]
317 sources = [
Sebastian Jansson09408112018-04-24 14:41:22 +0200318 "direct_transport_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000319 "frame_generator_unittest.cc",
320 "rtp_file_reader_unittest.cc",
321 "rtp_file_writer_unittest.cc",
322 "single_threaded_task_queue_unittest.cc",
323 "testsupport/always_passing_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000324 "testsupport/perf_test_unittest.cc",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200325 "testsupport/test_artifacts_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000326 "testsupport/y4m_frame_writer_unittest.cc",
327 "testsupport/yuv_frame_reader_unittest.cc",
328 "testsupport/yuv_frame_writer_unittest.cc",
329 ]
330
Oleh Prypin5ab68542017-09-25 09:18:00 +0000331 if (!build_with_chromium && is_clang) {
332 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
333 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
334 }
335
336 data = test_support_unittests_resources
337 if (is_android) {
338 deps += [ "//testing/android/native_test:native_test_support" ]
339 shard_timeout = 900
340 }
341
342 if (is_ios) {
343 deps += [ ":test_support_unittests_bundle_data" ]
344 }
Mirko Bonadei9098b302018-04-06 10:48:10 +0200345 if (!is_android && !build_with_chromium) {
346 # This is needed in order to avoid:
347 # undefined symbol: webrtc::videocapturemodule::VideoCaptureImpl::Create
348 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
349 }
Oleh Prypin5ab68542017-09-25 09:18:00 +0000350 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200351}
352
mbonadeicd95a4e2017-08-23 23:55:54 -0700353if (is_ios) {
354 rtc_source_set("fileutils_objc") {
mbonadei9c296b32017-09-05 05:11:41 -0700355 visibility = [ ":fileutils" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700356 sources = [
357 "testsupport/iosfileutils.mm",
358 ]
359 deps = [
360 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100361 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700362 "../rtc_base:rtc_base_approved",
kthelgason36d658d2017-08-24 05:43:45 -0700363 "../sdk:common_objc",
mbonadeicd95a4e2017-08-23 23:55:54 -0700364 ]
365 }
366}
367
mbonadei9452c622017-04-27 12:29:29 -0700368rtc_source_set("fileutils") {
369 testonly = true
Patrik Höglund7696bef2018-03-15 15:05:39 +0100370 visibility = [ "*" ]
mbonadei9452c622017-04-27 12:29:29 -0700371 sources = [
372 "testsupport/fileutils.cc",
373 "testsupport/fileutils.h",
374 ]
mbonadei3edccb92017-06-01 04:47:20 -0700375 deps = [
376 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100377 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700378 "../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +0200379 "../rtc_base/system:arch",
Danil Chapovalov431abd92018-06-18 12:54:17 +0200380 "//third_party/abseil-cpp/absl/types:optional",
mbonadei3edccb92017-06-01 04:47:20 -0700381 ]
mbonadei9452c622017-04-27 12:29:29 -0700382 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700383 deps += [ ":fileutils_objc" ]
mbonadei3edccb92017-06-01 04:47:20 -0700384 }
385 if (is_win) {
ehmaldonadof6a861a2017-07-19 10:40:47 -0700386 deps += [ "../rtc_base:rtc_base" ]
mbonadei9452c622017-04-27 12:29:29 -0700387 }
mbonadei9452c622017-04-27 12:29:29 -0700388}
389
390rtc_source_set("run_test") {
391 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700392 if (is_mac) {
393 public_deps = [
394 ":run_test_objc",
395 ]
396 } else {
397 public_deps = [
398 ":run_test_generic",
399 ]
400 }
401}
402
403rtc_source_set("run_test_interface") {
mbonadei9452c622017-04-27 12:29:29 -0700404 sources = [
405 "run_test.h",
406 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700407}
408
409if (is_mac) {
410 rtc_source_set("run_test_objc") {
411 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700412 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700413 sources = [
414 "mac/run_test.mm",
415 ]
mbonadei9c296b32017-09-05 05:11:41 -0700416 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700417 ":run_test_interface",
418 ]
mbonadei9452c622017-04-27 12:29:29 -0700419 }
420}
421
mbonadeicd95a4e2017-08-23 23:55:54 -0700422rtc_source_set("run_test_generic") {
423 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700424 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700425 sources = [
426 "run_test.cc",
427 ]
mbonadei9c296b32017-09-05 05:11:41 -0700428 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700429 ":run_test_interface",
430 ]
431}
432
ehmaldonado37535bf2016-12-05 06:42:45 -0800433rtc_source_set("fileutils_unittests") {
434 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700435 visibility = [ ":*" ] # Only targets in this file can depend on this.
ehmaldonado37535bf2016-12-05 06:42:45 -0800436 sources = [
437 "testsupport/fileutils_unittest.cc",
438 ]
439 deps = [
440 ":fileutils",
mbonadei3edccb92017-06-01 04:47:20 -0700441 ":test_support",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100442 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700443 "../rtc_base:rtc_base_approved",
ehmaldonado37535bf2016-12-05 06:42:45 -0800444 "//testing/gtest",
Danil Chapovalov431abd92018-06-18 12:54:17 +0200445 "//third_party/abseil-cpp/absl/types:optional",
ehmaldonado37535bf2016-12-05 06:42:45 -0800446 ]
447}
kjellander0f380d82016-06-01 04:48:26 -0700448
perkj488c5dc2017-02-08 05:55:51 -0800449rtc_source_set("direct_transport") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000450 visibility = [ "*" ]
perkj488c5dc2017-02-08 05:55:51 -0800451 testonly = true
452 sources = [
453 "direct_transport.cc",
454 "direct_transport.h",
perkj488c5dc2017-02-08 05:55:51 -0800455 ]
456 if (!build_with_chromium && is_clang) {
457 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
458 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
459 }
460 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700461 "..:webrtc_common",
perkj488c5dc2017-02-08 05:55:51 -0800462 "../api:transport_api",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100463 "../call:call_interfaces",
mbonadei3edccb92017-06-01 04:47:20 -0700464 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700465 "../rtc_base:rtc_base_approved",
eladalon413ee9a2017-08-22 04:02:52 -0700466 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700467 "../system_wrappers",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200468 "//third_party/abseil-cpp/absl/memory",
perkj488c5dc2017-02-08 05:55:51 -0800469 ]
eladalon413ee9a2017-08-22 04:02:52 -0700470 public_deps = [
471 ":single_threaded_task_queue",
Erik Språng09708512018-03-14 15:16:50 +0100472 "../call:fake_network",
eladalon413ee9a2017-08-22 04:02:52 -0700473 ]
474}
475
476rtc_source_set("single_threaded_task_queue") {
477 testonly = true
478 sources = [
479 "single_threaded_task_queue.cc",
480 "single_threaded_task_queue.h",
481 ]
482 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100483 "../rtc_base:checks",
eladalon413ee9a2017-08-22 04:02:52 -0700484 "../rtc_base:rtc_base_approved",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200485 "//third_party/abseil-cpp/absl/memory",
eladalon413ee9a2017-08-22 04:02:52 -0700486 ]
perkj488c5dc2017-02-08 05:55:51 -0800487}
488
ehmaldonado38a21322016-09-02 04:10:34 -0700489rtc_source_set("test_common") {
kjellander0f380d82016-06-01 04:48:26 -0700490 testonly = true
491 sources = [
492 "call_test.cc",
493 "call_test.h",
494 "configurable_frame_size_encoder.cc",
495 "configurable_frame_size_encoder.h",
496 "constants.cc",
497 "constants.h",
kjellander0f380d82016-06-01 04:48:26 -0700498 "drifting_clock.cc",
499 "drifting_clock.h",
Niels Möller4db138e2018-04-19 09:04:13 +0200500 "encoder_proxy_factory.h",
kjellander0f380d82016-06-01 04:48:26 -0700501 "encoder_settings.cc",
502 "encoder_settings.h",
kjellander0f380d82016-06-01 04:48:26 -0700503 "fake_decoder.cc",
504 "fake_decoder.h",
505 "fake_encoder.cc",
506 "fake_encoder.h",
sakal55d932b2016-09-30 06:19:08 -0700507 "fake_videorenderer.h",
Rasmus Brandt0cedc052018-05-31 12:53:00 +0200508 "function_video_decoder_factory.h",
Niels Möller4db138e2018-04-19 09:04:13 +0200509 "function_video_encoder_factory.h",
kjellander0f380d82016-06-01 04:48:26 -0700510 "layer_filtering_transport.cc",
511 "layer_filtering_transport.h",
Danil Chapovalovdd7e2842018-03-09 15:37:03 +0000512 "mock_transport.cc",
kjellander0f380d82016-06-01 04:48:26 -0700513 "mock_transport.h",
kjellander0f380d82016-06-01 04:48:26 -0700514 "null_transport.cc",
515 "null_transport.h",
516 "rtp_rtcp_observer.h",
517 "statistics.cc",
518 "statistics.h",
kjellander0f380d82016-06-01 04:48:26 -0700519 "win/run_loop_win.cc",
520 ]
521 if (!is_win) {
522 sources += [
523 "run_loop.cc",
524 "run_loop.h",
525 ]
526 }
527
kjellandere40a7ee2016-10-16 23:56:12 -0700528 if (!build_with_chromium && is_clang) {
529 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700530 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700531 }
532
533 deps = [
perkj488c5dc2017-02-08 05:55:51 -0800534 ":direct_transport",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100535 ":fileutils",
kjellander0f380d82016-06-01 04:48:26 -0700536 ":rtp_test_utils",
537 ":test_support",
perkjc5726c12017-03-01 03:37:08 -0800538 ":video_test_common",
kjellander0f380d82016-06-01 04:48:26 -0700539 "..:webrtc_common",
Patrik Höglundbe214a22018-01-04 12:14:35 +0100540 "../api:libjingle_peerconnection_api",
mbonadei3edccb92017-06-01 04:47:20 -0700541 "../api:transport_api",
mbonadei3edccb92017-06-01 04:47:20 -0700542 "../api/audio_codecs:builtin_audio_decoder_factory",
ossueb1fde42017-05-02 06:46:30 -0700543 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200544 "../api/video:video_frame",
545 "../api/video:video_frame_i420",
ilnikd60d06a2017-04-05 03:02:20 -0700546 "../api/video_codecs:video_codecs_api",
kjellander94cee312016-06-10 01:56:57 -0700547 "../audio",
kjellander94cee312016-06-10 01:56:57 -0700548 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100549 "../call:call_interfaces",
sprangdb2a9fc2017-08-09 06:42:32 -0700550 "../call:rtp_sender",
aleloi440b6d92017-08-22 05:43:23 -0700551 "../call:video_stream_api",
mbonadei3edccb92017-06-01 04:47:20 -0700552 "../common_video",
553 "../logging:rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800554 "../logging:rtc_event_log_impl_base",
Emircan Uysaler03e6ec92018-03-09 15:03:26 -0800555 "../media:rtc_internal_video_codecs",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100556 "../media:rtc_media_base",
Artem Titov3faa8322018-03-07 14:44:00 +0100557 "../modules/audio_device",
Paulina Hensman7bd79a02018-03-15 12:44:12 +0100558 "../modules/audio_device:audio_device_impl",
mbonadei3edccb92017-06-01 04:47:20 -0700559 "../modules/audio_device:mock_audio_device",
aleloi10111bc2016-11-17 06:48:48 -0800560 "../modules/audio_mixer:audio_mixer_impl",
aleloidd310712016-11-17 06:28:59 -0800561 "../modules/audio_processing",
Sebastian Jansson50eb4c42018-08-03 13:25:17 +0200562 "../modules/congestion_controller/bbr",
mbonadei3edccb92017-06-01 04:47:20 -0700563 "../modules/rtp_rtcp",
564 "../modules/rtp_rtcp:mock_rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100565 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglund99175c62018-01-08 11:05:10 +0100566 "../modules/video_coding:video_codec_interface",
charujaincb728ea2017-09-18 03:08:08 -0700567 "../modules/video_coding:video_coding_utility",
mbonadei3edccb92017-06-01 04:47:20 -0700568 "../modules/video_coding:webrtc_h264",
Emircan Uysaler03e6ec92018-03-09 15:03:26 -0800569 "../modules/video_coding:webrtc_multiplex",
Sergio Garcia Murillo43800f92018-06-21 16:16:38 +0200570 "../modules/video_coding:webrtc_vp8",
mbonadei3edccb92017-06-01 04:47:20 -0700571 "../modules/video_coding:webrtc_vp9",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100572 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700573 "../rtc_base:rtc_base_approved",
574 "../rtc_base:rtc_task_queue",
575 "../rtc_base:sequenced_task_checker",
Sebastian Jansson50eb4c42018-08-03 13:25:17 +0200576 "../rtc_base/experiments:congestion_controller_experiment",
mbonadei3edccb92017-06-01 04:47:20 -0700577 "../system_wrappers",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100578 "../system_wrappers:field_trial_api",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000579 "../system_wrappers:runtime_enabled_features_api",
kjellander94cee312016-06-10 01:56:57 -0700580 "../video",
kjellander0f380d82016-06-01 04:48:26 -0700581 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200582 "//third_party/abseil-cpp/absl/memory",
kjellander0f380d82016-06-01 04:48:26 -0700583 ]
mbonadei148d5a22017-04-28 05:24:50 -0700584 if (!is_android && !build_with_chromium) {
oprypin92220ff2017-03-23 03:40:03 -0700585 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
586 }
kjellander0f380d82016-06-01 04:48:26 -0700587}
588
ehmaldonado38a21322016-09-02 04:10:34 -0700589rtc_source_set("test_renderer") {
mbonadei9c296b32017-09-05 05:11:41 -0700590 public_deps = [
591 ":test_renderer_generic",
592 ]
kjellander0f380d82016-06-01 04:48:26 -0700593 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700594 if (is_mac) {
mbonadei9c296b32017-09-05 05:11:41 -0700595 public_deps += [ ":test_renderer_objc" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700596 }
597}
598
599if (is_mac) {
600 rtc_source_set("test_renderer_objc") {
601 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700602 visibility = [ ":test_renderer" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700603 sources = [
604 "mac/video_renderer_mac.h",
605 "mac/video_renderer_mac.mm",
606 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700607 deps = [
mbonadei9c296b32017-09-05 05:11:41 -0700608 ":test_renderer_generic",
mbonadeicd95a4e2017-08-23 23:55:54 -0700609 "../rtc_base:rtc_base_approved",
610 ]
611 libs = [
612 "Cocoa.framework",
613 "OpenGL.framework",
614 "CoreVideo.framework",
615 ]
616 if (!build_with_chromium && is_clang) {
617 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
618 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
619 }
620 }
621}
622
623rtc_source_set("test_renderer_generic") {
624 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700625 visibility = [
626 ":test_renderer",
627 ":test_renderer_objc",
628 ]
kjellander0f380d82016-06-01 04:48:26 -0700629 libs = []
630 sources = [
kjellander0f380d82016-06-01 04:48:26 -0700631 "video_renderer.cc",
632 "video_renderer.h",
633 "win/d3d_renderer.cc",
634 "win/d3d_renderer.h",
635 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700636 deps = [
637 ":test_support",
638 "..:webrtc_common",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200639 "../api/video:video_frame",
mbonadeicd95a4e2017-08-23 23:55:54 -0700640 "../common_video",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100641 "../media:rtc_media_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100642 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700643 "../rtc_base:rtc_base_approved",
644 "//testing/gtest",
645 ]
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100646 if (!(is_linux && rtc_use_x11) && !is_mac && !is_win) {
kjellander0f380d82016-06-01 04:48:26 -0700647 sources += [ "null_platform_renderer.cc" ]
648 }
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100649 if ((is_linux && rtc_use_x11) || is_mac) {
kjellander0f380d82016-06-01 04:48:26 -0700650 sources += [
651 "gl/gl_renderer.cc",
652 "gl/gl_renderer.h",
653 ]
654 }
655
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100656 if (is_linux && rtc_use_x11) {
Edward Lemur84a87c42017-11-07 19:07:31 +0100657 sources += [
658 "linux/glx_renderer.cc",
659 "linux/glx_renderer.h",
660 "linux/video_renderer_linux.cc",
661 ]
kjellander0f380d82016-06-01 04:48:26 -0700662 libs += [
663 "Xext",
664 "X11",
665 "GL",
666 ]
667 }
668 if (is_android) {
669 libs += [
670 "GLESv2",
671 "log",
672 ]
673 }
kjellander0f380d82016-06-01 04:48:26 -0700674
kjellandere40a7ee2016-10-16 23:56:12 -0700675 if (!build_with_chromium && is_clang) {
676 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700677 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700678 }
kjellander0f380d82016-06-01 04:48:26 -0700679}
kwiberg37e99fd2017-04-10 05:15:48 -0700680
681rtc_source_set("audio_codec_mocks") {
682 testonly = true
683 sources = [
kwiberg2b3aa142017-06-14 03:31:17 -0700684 "mock_audio_decoder.cc",
kwiberg37e99fd2017-04-10 05:15:48 -0700685 "mock_audio_decoder.h",
686 "mock_audio_decoder_factory.h",
ossueb1fde42017-05-02 06:46:30 -0700687 "mock_audio_encoder.cc",
688 "mock_audio_encoder.h",
689 "mock_audio_encoder_factory.h",
690 ]
691
692 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700693 ":test_support",
kwiberg529662a2017-09-04 05:43:17 -0700694 "../api:array_view",
ossueb1fde42017-05-02 06:46:30 -0700695 "../api/audio_codecs:audio_codecs_api",
mbonadei3edccb92017-06-01 04:47:20 -0700696 "../api/audio_codecs:builtin_audio_decoder_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700697 "../rtc_base:rtc_base_approved",
kwiberg37e99fd2017-04-10 05:15:48 -0700698 ]
699}
sakald7fdb802017-05-26 01:51:53 -0700700
701if (!build_with_chromium && is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000702 rtc_android_library("native_test_java") {
sakald7fdb802017-05-26 01:51:53 -0700703 testonly = true
704 java_files = [
705 "android/org/webrtc/native_test/RTCNativeUnitTest.java",
706 "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
707 ]
708 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700709 "../rtc_base:base_java",
sakald7fdb802017-05-26 01:51:53 -0700710 "//testing/android/native_test:native_test_java",
sakald7fdb802017-05-26 01:51:53 -0700711 ]
712 }
713}