blob: d48c9cd79ffc99a5ee06c0ae1cb4929ec55af7a2 [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}
ehmaldonadoed8c8ed2016-11-23 12:58:35 -080014if (rtc_use_memcheck) {
Henrik Kjellander90fd7d82017-05-09 08:30:10 +020015 import("//tools_webrtc/valgrind/valgrind-webrtc.gni")
ehmaldonadoed8c8ed2016-11-23 12:58:35 -080016}
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000017
kjellanderb62dbbe2016-09-23 00:38:52 -070018group("test") {
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000019 testonly = true
20
21 deps = [
22 ":field_trial",
kjellander0f380d82016-06-01 04:48:26 -070023 ":rtp_test_utils",
24 ":test_common",
25 ":test_renderer",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000026 ":test_support",
kjellander0f380d82016-06-01 04:48:26 -070027 ":video_test_common",
28 ]
mbonadei148d5a22017-04-28 05:24:50 -070029
oprypinfbbba3f2017-09-25 08:34:41 -070030 if (rtc_include_tests) {
mbonadei148d5a22017-04-28 05:24:50 -070031 deps += [
32 ":test_main",
33 ":test_support_unittests",
34 ]
35 }
kjellander0f380d82016-06-01 04:48:26 -070036}
37
ehmaldonado38a21322016-09-02 04:10:34 -070038rtc_source_set("video_test_common") {
kjellander0f380d82016-06-01 04:48:26 -070039 testonly = true
40 sources = [
41 "fake_texture_frame.cc",
42 "fake_texture_frame.h",
43 "frame_generator.cc",
44 "frame_generator.h",
ehmaldonado656610f2017-02-06 02:21:11 -080045 "frame_generator_capturer.cc",
46 "frame_generator_capturer.h",
kjellander0f380d82016-06-01 04:48:26 -070047 "frame_utils.cc",
48 "frame_utils.h",
ehmaldonado656610f2017-02-06 02:21:11 -080049 "vcm_capturer.cc",
50 "vcm_capturer.h",
sprangc5d62e22017-04-02 23:53:04 -070051 "video_capturer.cc",
ehmaldonado656610f2017-02-06 02:21:11 -080052 "video_capturer.h",
mflodman351424e2017-08-10 02:43:14 -070053 "video_codec_settings.h",
kjellander0f380d82016-06-01 04:48:26 -070054 ]
55
kjellandere40a7ee2016-10-16 23:56:12 -070056 if (!build_with_chromium && is_clang) {
57 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070058 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070059 }
60
61 deps = [
mbonadei3edccb92017-06-01 04:47:20 -070062 "..:webrtc_common",
kwiberg84f6a3f2017-09-05 08:43:13 -070063 "../api:optional",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +010064 "../api:video_frame_api_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",
ehmaldonadof6a861a2017-07-19 10:40:47 -070071 "../rtc_base:rtc_base_approved",
72 "../rtc_base:rtc_task_queue",
mbonadei3edccb92017-06-01 04:47:20 -070073 "../system_wrappers",
kjellander0f380d82016-06-01 04:48:26 -070074 ]
75}
76
ehmaldonado38a21322016-09-02 04:10:34 -070077rtc_source_set("rtp_test_utils") {
kjellander0f380d82016-06-01 04:48:26 -070078 testonly = true
79 sources = [
80 "rtcp_packet_parser.cc",
81 "rtcp_packet_parser.h",
82 "rtp_file_reader.cc",
83 "rtp_file_reader.h",
84 "rtp_file_writer.cc",
85 "rtp_file_writer.h",
86 ]
87
kjellandere40a7ee2016-10-16 23:56:12 -070088 if (!build_with_chromium && is_clang) {
89 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070090 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070091 }
92
93 deps = [
94 "..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -070095 "../api:array_view",
kjellander0f380d82016-06-01 04:48:26 -070096 "../modules/rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +010097 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010098 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -070099 "../rtc_base:rtc_base_approved",
kjellander0f380d82016-06-01 04:48:26 -0700100 "//testing/gtest",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000101 ]
102}
103
ehmaldonado38a21322016-09-02 04:10:34 -0700104rtc_source_set("field_trial") {
kjellander0f380d82016-06-01 04:48:26 -0700105 testonly = true
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000106 sources = [
107 "field_trial.cc",
108 "field_trial.h",
109 ]
110
111 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000112 "..:webrtc_common",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100113 "../system_wrappers:field_trial_api",
phoglund37ebcf02016-01-08 05:04:57 -0800114 "../system_wrappers:field_trial_default",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000115 ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000116}
117
Edward Lemur8b886bb2017-12-13 13:23:17 +0100118rtc_source_set("perf_test") {
119 testonly = true
120 sources = [
121 "testsupport/perf_test.cc",
122 "testsupport/perf_test.h",
123 ]
124 deps = [
125 "..:webrtc_common",
126 "../api:array_view",
127 "../rtc_base:rtc_base_approved",
128 ]
129}
130
mbonadeicd95a4e2017-08-23 23:55:54 -0700131if (is_ios) {
132 rtc_source_set("test_support_objc") {
133 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700134 visibility = [ ":test_support" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700135 sources = [
136 "ios/test_support.h",
137 "ios/test_support.mm",
138 ]
denicijad207a392017-09-11 06:43:28 -0700139 deps = [
Edward Lemur8b886bb2017-12-13 13:23:17 +0100140 ":perf_test",
denicijad207a392017-09-11 06:43:28 -0700141 "../sdk:common_objc",
142 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700143 }
144}
145
mbonadei148d5a22017-04-28 05:24:50 -0700146rtc_source_set("test_support") {
147 testonly = true
kjellander32c4a202016-08-30 02:53:49 -0700148
mbonadei148d5a22017-04-28 05:24:50 -0700149 sources = [
150 "gmock.h",
151 "gtest.h",
152 "testsupport/packet_reader.cc",
153 "testsupport/packet_reader.h",
mbonadei148d5a22017-04-28 05:24:50 -0700154 "testsupport/unittest_utils.h",
155 ]
156
mbonadeicd95a4e2017-08-23 23:55:54 -0700157 public_deps = [
158 ":fileutils",
159 ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200160 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700161 public_deps += [ ":test_support_objc" ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200162 }
163
mbonadei148d5a22017-04-28 05:24:50 -0700164 deps = [
165 "..:webrtc_common",
Edward Lemur936dfb12017-11-30 11:43:42 +0100166 "../api:array_view",
mbonadei148d5a22017-04-28 05:24:50 -0700167 "../common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700168 "../rtc_base:gtest_prod",
169 "../rtc_base:rtc_base_approved",
mbonadei148d5a22017-04-28 05:24:50 -0700170 "../system_wrappers",
171 "//testing/gmock",
172 "//testing/gtest",
173 ]
174
mbonadei148d5a22017-04-28 05:24:50 -0700175 if (!build_with_chromium && is_clang) {
176 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
177 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
178 }
179
180 if (is_android) {
181 deps += [ "//base:base" ]
182 }
183
184 if (is_ios && !build_with_chromium) {
kthelgason36d658d2017-08-24 05:43:45 -0700185 deps += [ "../sdk:common_objc" ]
mbonadei148d5a22017-04-28 05:24:50 -0700186 }
187
188 if (rtc_use_memcheck) {
189 data = valgrind_webrtc_dependencies
kjellander32c4a202016-08-30 02:53:49 -0700190 }
191}
192
oprypinfbbba3f2017-09-25 08:34:41 -0700193if (rtc_include_tests) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000194 rtc_source_set("test_main") {
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200195 testonly = true
Oleh Prypin5ab68542017-09-25 09:18:00 +0000196 sources = [
197 "test_main.cc",
198 ]
199
200 public_deps = [
201 ":test_support",
202 ]
203 deps = [
204 ":field_trial",
Edward Lemur8b886bb2017-12-13 13:23:17 +0100205 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000206 "../rtc_base:rtc_base_approved",
207 "../system_wrappers:metrics_default",
208 "//testing/gmock",
209 "//testing/gtest",
mbonadei9452c622017-04-27 12:29:29 -0700210 ]
211 }
mbonadei9452c622017-04-27 12:29:29 -0700212
Oleh Prypin5ab68542017-09-25 09:18:00 +0000213 rtc_source_set("video_test_support") {
214 testonly = true
215
216 sources = [
217 "testsupport/frame_reader.h",
218 "testsupport/frame_writer.h",
219 "testsupport/metrics/video_metrics.cc",
220 "testsupport/metrics/video_metrics.h",
221 "testsupport/mock/mock_frame_reader.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000222 "testsupport/y4m_frame_writer.cc",
223 "testsupport/yuv_frame_reader.cc",
224 "testsupport/yuv_frame_writer.cc",
225 ]
226
227 deps = [
228 ":test_support",
229 ":video_test_common",
Mirko Bonadei0250be52017-12-01 13:53:04 +0100230 "$rtc_libyuv_dir",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000231 "..:webrtc_common",
232 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100233 "../api:video_frame_api_i420",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000234 "../common_video",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100235 "../rtc_base:checks",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000236 "../rtc_base:rtc_base_approved",
237 "../system_wrappers",
238 "//testing/gmock",
239 "//testing/gtest",
240 ]
241
242 if (!is_ios) {
243 deps += [ "//third_party:jpeg" ]
244 sources += [ "testsupport/jpeg_frame_writer.cc" ]
245 } else {
246 sources += [ "testsupport/jpeg_frame_writer_ios.cc" ]
247 }
248
249 public_deps = [
250 ":fileutils",
251 ]
252
253 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 }
265
266 if (rtc_use_memcheck) {
267 data = valgrind_webrtc_dependencies
268 }
269 }
270
Edward Lemuraf8659a2017-09-27 14:46:24 +0200271 rtc_source_set("test_support_test_artifacts") {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000272 testonly = true
273 sources = [
Edward Lemuraf8659a2017-09-27 14:46:24 +0200274 "testsupport/test_artifacts.cc",
275 "testsupport/test_artifacts.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000276 ]
277 deps = [
278 ":fileutils",
279 "../rtc_base:rtc_base_approved",
280 ]
281 }
282
283 test_support_unittests_resources = [
284 "../resources/foreman_cif_short.yuv",
285 "../resources/video_coding/frame-ethernet-ii.pcap",
286 "../resources/video_coding/frame-loopback.pcap",
287 "../resources/video_coding/pltype103.rtp",
288 "../resources/video_coding/pltype103_header_only.rtp",
289 "../resources/video_coding/ssrcs-2.pcap",
290 "../resources/video_coding/ssrcs-3.pcap",
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200291 ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200292
293 if (is_ios) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000294 bundle_data("test_support_unittests_bundle_data") {
295 testonly = true
296 sources = test_support_unittests_resources
297 outputs = [
298 "{{bundle_resources_dir}}/{{source_file_part}}",
299 ]
300 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200301 }
302
Oleh Prypin5ab68542017-09-25 09:18:00 +0000303 rtc_test("test_support_unittests") {
304 deps = [
305 ":fake_audio_device",
Edward Lemur8b886bb2017-12-13 13:23:17 +0100306 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000307 ":rtp_test_utils",
308 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100309 "../api:video_frame_api_i420",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000310 "../call:call_interfaces",
311 "../common_audio",
312 "../modules/rtp_rtcp",
313 "../rtc_base:rtc_base_approved",
314 "../system_wrappers",
315 ]
316 sources = [
317 "fake_audio_device_unittest.cc",
318 "fake_network_pipe_unittest.cc",
319 "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",
324 "testsupport/metrics/video_metrics_unittest.cc",
325 "testsupport/packet_reader_unittest.cc",
326 "testsupport/perf_test_unittest.cc",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200327 "testsupport/test_artifacts_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000328 "testsupport/y4m_frame_writer_unittest.cc",
329 "testsupport/yuv_frame_reader_unittest.cc",
330 "testsupport/yuv_frame_writer_unittest.cc",
331 ]
332
333 # TODO(jschuh): Bug 1348: fix this warning.
334 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
335
336 if (is_win) {
337 # virtual override w/different const/volatile signature.
338 cflags = [ "/wd4373" ]
339 }
340
341 if (!build_with_chromium && is_clang) {
342 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
343 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
344 }
345
346 data = test_support_unittests_resources
347 if (is_android) {
348 deps += [ "//testing/android/native_test:native_test_support" ]
349 shard_timeout = 900
350 }
351
352 if (is_ios) {
353 deps += [ ":test_support_unittests_bundle_data" ]
354 }
355
356 deps += [
357 ":direct_transport",
358 ":fileutils_unittests",
359 ":test_common",
360 ":test_main",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200361 ":test_support_test_artifacts",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000362 ":video_test_common",
363 ":video_test_support",
364 "../modules/video_capture",
365 "../rtc_base:rtc_base_approved",
366 "//testing/gmock",
367 "//testing/gtest",
368 ]
369 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200370}
371
mbonadeicd95a4e2017-08-23 23:55:54 -0700372if (is_ios) {
373 rtc_source_set("fileutils_objc") {
mbonadei9c296b32017-09-05 05:11:41 -0700374 visibility = [ ":fileutils" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700375 sources = [
376 "testsupport/iosfileutils.mm",
377 ]
378 deps = [
379 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100380 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700381 "../rtc_base:rtc_base_approved",
kthelgason36d658d2017-08-24 05:43:45 -0700382 "../sdk:common_objc",
mbonadeicd95a4e2017-08-23 23:55:54 -0700383 ]
384 }
385}
386
mbonadei9452c622017-04-27 12:29:29 -0700387rtc_source_set("fileutils") {
388 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700389 visibility = [
390 ":fileutils_unittests",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200391 ":test_support_test_artifacts",
mbonadei9c296b32017-09-05 05:11:41 -0700392 ":test_support",
393 ":video_test_support",
394 ]
mbonadei9452c622017-04-27 12:29:29 -0700395 sources = [
396 "testsupport/fileutils.cc",
397 "testsupport/fileutils.h",
398 ]
mbonadei3edccb92017-06-01 04:47:20 -0700399 deps = [
400 "..:webrtc_common",
kwiberg84f6a3f2017-09-05 08:43:13 -0700401 "../api:optional",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100402 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700403 "../rtc_base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700404 ]
mbonadei9452c622017-04-27 12:29:29 -0700405 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700406 deps += [ ":fileutils_objc" ]
mbonadei3edccb92017-06-01 04:47:20 -0700407 }
408 if (is_win) {
ehmaldonadof6a861a2017-07-19 10:40:47 -0700409 deps += [ "../rtc_base:rtc_base" ]
mbonadei9452c622017-04-27 12:29:29 -0700410 }
mbonadei9452c622017-04-27 12:29:29 -0700411}
412
413rtc_source_set("run_test") {
414 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700415 if (is_mac) {
416 public_deps = [
417 ":run_test_objc",
418 ]
419 } else {
420 public_deps = [
421 ":run_test_generic",
422 ]
423 }
424}
425
426rtc_source_set("run_test_interface") {
mbonadei9452c622017-04-27 12:29:29 -0700427 sources = [
428 "run_test.h",
429 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700430}
431
432if (is_mac) {
433 rtc_source_set("run_test_objc") {
434 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700435 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700436 sources = [
437 "mac/run_test.mm",
438 ]
mbonadei9c296b32017-09-05 05:11:41 -0700439 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700440 ":run_test_interface",
441 ]
mbonadei9452c622017-04-27 12:29:29 -0700442 }
443}
444
mbonadeicd95a4e2017-08-23 23:55:54 -0700445rtc_source_set("run_test_generic") {
446 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700447 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700448 sources = [
449 "run_test.cc",
450 ]
mbonadei9c296b32017-09-05 05:11:41 -0700451 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700452 ":run_test_interface",
453 ]
454}
455
ehmaldonado37535bf2016-12-05 06:42:45 -0800456rtc_source_set("fileutils_unittests") {
457 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700458 visibility = [ ":*" ] # Only targets in this file can depend on this.
ehmaldonado37535bf2016-12-05 06:42:45 -0800459 sources = [
460 "testsupport/fileutils_unittest.cc",
461 ]
462 deps = [
463 ":fileutils",
mbonadei3edccb92017-06-01 04:47:20 -0700464 ":test_support",
kwiberg84f6a3f2017-09-05 08:43:13 -0700465 "../api:optional",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100466 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700467 "../rtc_base:rtc_base_approved",
ehmaldonado37535bf2016-12-05 06:42:45 -0800468 "//testing/gmock",
469 "//testing/gtest",
470 ]
471}
kjellander0f380d82016-06-01 04:48:26 -0700472
perkj488c5dc2017-02-08 05:55:51 -0800473rtc_source_set("direct_transport") {
474 testonly = true
475 sources = [
476 "direct_transport.cc",
477 "direct_transport.h",
478 "fake_network_pipe.cc",
479 "fake_network_pipe.h",
480 ]
481 if (!build_with_chromium && is_clang) {
482 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
483 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
484 }
485 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700486 "..:webrtc_common",
perkj488c5dc2017-02-08 05:55:51 -0800487 "../api:transport_api",
perkj488c5dc2017-02-08 05:55:51 -0800488 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100489 "../call:call_interfaces",
mbonadei3edccb92017-06-01 04:47:20 -0700490 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700491 "../rtc_base:rtc_base_approved",
eladalon413ee9a2017-08-22 04:02:52 -0700492 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700493 "../system_wrappers",
perkj488c5dc2017-02-08 05:55:51 -0800494 ]
eladalon413ee9a2017-08-22 04:02:52 -0700495 public_deps = [
496 ":single_threaded_task_queue",
497 ]
498}
499
500rtc_source_set("single_threaded_task_queue") {
501 testonly = true
502 sources = [
503 "single_threaded_task_queue.cc",
504 "single_threaded_task_queue.h",
505 ]
506 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100507 "../rtc_base:checks",
eladalon413ee9a2017-08-22 04:02:52 -0700508 "../rtc_base:rtc_base_approved",
509 ]
perkj488c5dc2017-02-08 05:55:51 -0800510}
511
perkj16ccfdf2017-02-28 14:41:05 -0800512rtc_source_set("fake_audio_device") {
513 testonly = true
514 sources = [
515 "fake_audio_device.cc",
516 "fake_audio_device.h",
517 ]
518 if (!build_with_chromium && is_clang) {
519 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
520 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
521 }
522 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700523 "..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -0700524 "../api:array_view",
mbonadei3edccb92017-06-01 04:47:20 -0700525 "../common_audio:common_audio",
mbonadeib80ef8c2017-04-24 13:05:47 -0700526 "../modules/audio_device:audio_device",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100527 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700528 "../rtc_base:rtc_base_approved",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100529 "../system_wrappers",
perkj16ccfdf2017-02-28 14:41:05 -0800530 ]
531}
532
ehmaldonado38a21322016-09-02 04:10:34 -0700533rtc_source_set("test_common") {
kjellander0f380d82016-06-01 04:48:26 -0700534 testonly = true
535 sources = [
536 "call_test.cc",
537 "call_test.h",
538 "configurable_frame_size_encoder.cc",
539 "configurable_frame_size_encoder.h",
540 "constants.cc",
541 "constants.h",
kjellander0f380d82016-06-01 04:48:26 -0700542 "drifting_clock.cc",
543 "drifting_clock.h",
544 "encoder_settings.cc",
545 "encoder_settings.h",
kjellander0f380d82016-06-01 04:48:26 -0700546 "fake_decoder.cc",
547 "fake_decoder.h",
548 "fake_encoder.cc",
549 "fake_encoder.h",
sakal55d932b2016-09-30 06:19:08 -0700550 "fake_videorenderer.h",
kjellander0f380d82016-06-01 04:48:26 -0700551 "layer_filtering_transport.cc",
552 "layer_filtering_transport.h",
553 "mock_transport.h",
554 "mock_voe_channel_proxy.h",
555 "mock_voice_engine.h",
556 "null_transport.cc",
557 "null_transport.h",
558 "rtp_rtcp_observer.h",
559 "statistics.cc",
560 "statistics.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",
perkj16ccfdf2017-02-28 14:41:05 -0800577 ":fake_audio_device",
kjellander0f380d82016-06-01 04:48:26 -0700578 ":rtp_test_utils",
579 ":test_support",
perkjc5726c12017-03-01 03:37:08 -0800580 ":video_test_common",
kjellander0f380d82016-06-01 04:48:26 -0700581 "..:webrtc_common",
mbonadei3edccb92017-06-01 04:47:20 -0700582 "../api:transport_api",
583 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100584 "../api:video_frame_api_i420",
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",
ilnikd60d06a2017-04-05 03:02:20 -0700587 "../api/video_codecs:video_codecs_api",
kjellander94cee312016-06-10 01:56:57 -0700588 "../audio",
kjellander94cee312016-06-10 01:56:57 -0700589 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100590 "../call:call_interfaces",
sprangdb2a9fc2017-08-09 06:42:32 -0700591 "../call:rtp_sender",
aleloi440b6d92017-08-22 05:43:23 -0700592 "../call:video_stream_api",
mbonadei3edccb92017-06-01 04:47:20 -0700593 "../common_video",
594 "../logging:rtc_event_log_api",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100595 "../media:rtc_media_base",
mbonadei3edccb92017-06-01 04:47:20 -0700596 "../modules/audio_device:mock_audio_device",
aleloi10111bc2016-11-17 06:48:48 -0800597 "../modules/audio_mixer:audio_mixer_impl",
aleloidd310712016-11-17 06:28:59 -0800598 "../modules/audio_processing",
mbonadei3edccb92017-06-01 04:47:20 -0700599 "../modules/rtp_rtcp",
600 "../modules/rtp_rtcp:mock_rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100601 "../modules/rtp_rtcp:rtp_rtcp_format",
charujaincb728ea2017-09-18 03:08:08 -0700602 "../modules/video_coding:video_coding_utility",
mbonadei3edccb92017-06-01 04:47:20 -0700603 "../modules/video_coding:webrtc_h264",
604 "../modules/video_coding:webrtc_vp8",
605 "../modules/video_coding:webrtc_vp9",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100606 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700607 "../rtc_base:rtc_base_approved",
608 "../rtc_base:rtc_task_queue",
609 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700610 "../system_wrappers",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100611 "../system_wrappers:field_trial_api",
kjellander94cee312016-06-10 01:56:57 -0700612 "../video",
mbonadei3edccb92017-06-01 04:47:20 -0700613 "../voice_engine",
kjellander0f380d82016-06-01 04:48:26 -0700614 "//testing/gmock",
615 "//testing/gtest",
kjellander0f380d82016-06-01 04:48:26 -0700616 ]
mbonadei148d5a22017-04-28 05:24:50 -0700617 if (!is_android && !build_with_chromium) {
oprypin92220ff2017-03-23 03:40:03 -0700618 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
619 }
kjellander0f380d82016-06-01 04:48:26 -0700620}
621
622config("test_renderer_exported_config") {
623 if (is_win && is_clang) {
624 # GN orders flags on a target before flags from configs. The default config
625 # adds -Wall, and this flag have to be after -Wall -- so they need to
626 # come from a config and cannot be on the target directly.
ehmaldonado4bc4d272016-08-25 04:15:40 -0700627 cflags = [
kjellander0f380d82016-06-01 04:48:26 -0700628 "-Wno-bool-conversion",
629 "-Wno-comment",
630 "-Wno-delete-non-virtual-dtor",
631 ]
632 }
633}
634
ehmaldonado38a21322016-09-02 04:10:34 -0700635rtc_source_set("test_renderer") {
mbonadei9c296b32017-09-05 05:11:41 -0700636 public_deps = [
637 ":test_renderer_generic",
638 ]
kjellander0f380d82016-06-01 04:48:26 -0700639 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700640 if (is_mac) {
mbonadei9c296b32017-09-05 05:11:41 -0700641 public_deps += [ ":test_renderer_objc" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700642 }
643}
644
645if (is_mac) {
646 rtc_source_set("test_renderer_objc") {
647 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700648 visibility = [ ":test_renderer" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700649 sources = [
650 "mac/video_renderer_mac.h",
651 "mac/video_renderer_mac.mm",
652 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700653 deps = [
mbonadei9c296b32017-09-05 05:11:41 -0700654 ":test_renderer_generic",
mbonadeicd95a4e2017-08-23 23:55:54 -0700655 "../rtc_base:rtc_base_approved",
656 ]
657 libs = [
658 "Cocoa.framework",
659 "OpenGL.framework",
660 "CoreVideo.framework",
661 ]
662 if (!build_with_chromium && is_clang) {
663 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
664 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
665 }
666 }
667}
668
669rtc_source_set("test_renderer_generic") {
670 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700671 visibility = [
672 ":test_renderer",
673 ":test_renderer_objc",
674 ]
kjellander0f380d82016-06-01 04:48:26 -0700675 libs = []
676 sources = [
kjellander0f380d82016-06-01 04:48:26 -0700677 "video_renderer.cc",
678 "video_renderer.h",
679 "win/d3d_renderer.cc",
680 "win/d3d_renderer.h",
681 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700682 deps = [
683 ":test_support",
684 "..:webrtc_common",
685 "../common_video",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100686 "../media:rtc_media_base",
mbonadeicd95a4e2017-08-23 23:55:54 -0700687 "../modules/media_file",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100688 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700689 "../rtc_base:rtc_base_approved",
690 "//testing/gtest",
691 ]
Edward Lemur84a87c42017-11-07 19:07:31 +0100692 if (!(is_linux && use_x11) && !is_mac && !is_win) {
kjellander0f380d82016-06-01 04:48:26 -0700693 sources += [ "null_platform_renderer.cc" ]
694 }
Edward Lemur84a87c42017-11-07 19:07:31 +0100695 if ((is_linux && use_x11) || is_mac) {
kjellander0f380d82016-06-01 04:48:26 -0700696 sources += [
697 "gl/gl_renderer.cc",
698 "gl/gl_renderer.h",
699 ]
700 }
701
Edward Lemur84a87c42017-11-07 19:07:31 +0100702 if (is_linux && use_x11) {
703 sources += [
704 "linux/glx_renderer.cc",
705 "linux/glx_renderer.h",
706 "linux/video_renderer_linux.cc",
707 ]
kjellander0f380d82016-06-01 04:48:26 -0700708 libs += [
709 "Xext",
710 "X11",
711 "GL",
712 ]
713 }
714 if (is_android) {
715 libs += [
716 "GLESv2",
717 "log",
718 ]
719 }
kjellander0f380d82016-06-01 04:48:26 -0700720
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700721 public_configs = [ ":test_renderer_exported_config" ]
kjellander0f380d82016-06-01 04:48:26 -0700722
kjellandere40a7ee2016-10-16 23:56:12 -0700723 if (!build_with_chromium && is_clang) {
724 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700725 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700726 }
kjellander0f380d82016-06-01 04:48:26 -0700727}
kwiberg37e99fd2017-04-10 05:15:48 -0700728
729rtc_source_set("audio_codec_mocks") {
730 testonly = true
731 sources = [
kwiberg2b3aa142017-06-14 03:31:17 -0700732 "mock_audio_decoder.cc",
kwiberg37e99fd2017-04-10 05:15:48 -0700733 "mock_audio_decoder.h",
734 "mock_audio_decoder_factory.h",
ossueb1fde42017-05-02 06:46:30 -0700735 "mock_audio_encoder.cc",
736 "mock_audio_encoder.h",
737 "mock_audio_encoder_factory.h",
738 ]
739
740 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700741 ":test_support",
kwiberg529662a2017-09-04 05:43:17 -0700742 "../api:array_view",
ossueb1fde42017-05-02 06:46:30 -0700743 "../api/audio_codecs:audio_codecs_api",
mbonadei3edccb92017-06-01 04:47:20 -0700744 "../api/audio_codecs:builtin_audio_decoder_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700745 "../rtc_base:rtc_base_approved",
ossueb1fde42017-05-02 06:46:30 -0700746 "//testing/gmock",
kwiberg37e99fd2017-04-10 05:15:48 -0700747 ]
748}
sakald7fdb802017-05-26 01:51:53 -0700749
750if (!build_with_chromium && is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000751 rtc_android_library("native_test_java") {
sakald7fdb802017-05-26 01:51:53 -0700752 testonly = true
753 java_files = [
754 "android/org/webrtc/native_test/RTCNativeUnitTest.java",
755 "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
756 ]
757 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700758 "../rtc_base:base_java",
sakald7fdb802017-05-26 01:51:53 -0700759 "//testing/android/native_test:native_test_java",
sakald7fdb802017-05-26 01:51:53 -0700760 ]
761 }
762}