blob: 74563657c3b818498aefca335df492b08d729ee2 [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 = [
kjellander0f380d82016-06-01 04:48:26 -070019 ":rtp_test_utils",
20 ":test_common",
21 ":test_renderer",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000022 ":test_support",
kjellander0f380d82016-06-01 04:48:26 -070023 ":video_test_common",
24 ]
mbonadei148d5a22017-04-28 05:24:50 -070025
oprypinfbbba3f2017-09-25 08:34:41 -070026 if (rtc_include_tests) {
mbonadei148d5a22017-04-28 05:24:50 -070027 deps += [
28 ":test_main",
29 ":test_support_unittests",
Sebastian Jansson98b07e92018-09-27 13:47:01 +020030 "scenario/scenario_tests",
mbonadei148d5a22017-04-28 05:24:50 -070031 ]
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",
Sebastian Janssonf1f363f2018-08-13 14:24:58 +020047 "test_video_capturer.cc",
48 "test_video_capturer.h",
ehmaldonado656610f2017-02-06 02:21:11 -080049 "vcm_capturer.cc",
50 "vcm_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 Chapovalovabd42732018-09-10 14:07:45 +020074 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalov431abd92018-06-18 12:54:17 +020075 "//third_party/abseil-cpp/absl/types:optional",
kjellander0f380d82016-06-01 04:48:26 -070076 ]
77}
78
ehmaldonado38a21322016-09-02 04:10:34 -070079rtc_source_set("rtp_test_utils") {
kjellander0f380d82016-06-01 04:48:26 -070080 testonly = true
81 sources = [
82 "rtcp_packet_parser.cc",
83 "rtcp_packet_parser.h",
84 "rtp_file_reader.cc",
85 "rtp_file_reader.h",
86 "rtp_file_writer.cc",
87 "rtp_file_writer.h",
88 ]
89
kjellandere40a7ee2016-10-16 23:56:12 -070090 if (!build_with_chromium && is_clang) {
91 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070092 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070093 }
94
95 deps = [
96 "..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -070097 "../api:array_view",
kjellander0f380d82016-06-01 04:48:26 -070098 "../modules/rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +010099 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100100 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700101 "../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +0200102 "../rtc_base/system:arch",
kjellander0f380d82016-06-01 04:48:26 -0700103 "//testing/gtest",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000104 ]
105}
106
ehmaldonado38a21322016-09-02 04:10:34 -0700107rtc_source_set("field_trial") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000108 visibility = [ "*" ]
kjellander0f380d82016-06-01 04:48:26 -0700109 testonly = true
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000110 sources = [
111 "field_trial.cc",
112 "field_trial.h",
113 ]
114
115 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000116 "..:webrtc_common",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200117 "../system_wrappers:field_trial",
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",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200144 "../sdk:helpers_objc",
denicijad207a392017-09-11 06:43:28 -0700145 ]
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
Sebastian Jansson2afd2812018-08-23 14:44:05 +0200160config("test_main_direct_config") {
161 visibility = [ ":*" ]
162 defines = [ "UNIT_TEST" ]
163}
mbonadei148d5a22017-04-28 05:24:50 -0700164rtc_source_set("test_support") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000165 visibility = [ "*" ]
mbonadei148d5a22017-04-28 05:24:50 -0700166 testonly = true
kjellander32c4a202016-08-30 02:53:49 -0700167
Mirko Bonadei65ce3112018-01-26 11:57:47 +0100168 all_dependent_configs = [
169 ":suppress_warning_4373",
170 "//third_party/googletest:gmock_config",
171 "//third_party/googletest:gtest_config",
172 ]
Patrik Höglund34924c22018-01-19 09:11:07 +0100173
mbonadei148d5a22017-04-28 05:24:50 -0700174 sources = [
175 "gmock.h",
176 "gtest.h",
mbonadei148d5a22017-04-28 05:24:50 -0700177 ]
178
Patrik Höglund7696bef2018-03-15 15:05:39 +0100179 public_deps = []
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200180 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700181 public_deps += [ ":test_support_objc" ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200182 }
183
Sebastian Jansson2afd2812018-08-23 14:44:05 +0200184 public_configs = [ ":test_main_direct_config" ]
mbonadei148d5a22017-04-28 05:24:50 -0700185 deps = [
ehmaldonadof6a861a2017-07-19 10:40:47 -0700186 "../rtc_base:rtc_base_approved",
mbonadei148d5a22017-04-28 05:24:50 -0700187 "//testing/gmock",
188 "//testing/gtest",
189 ]
190
mbonadei148d5a22017-04-28 05:24:50 -0700191 if (!build_with_chromium && is_clang) {
192 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
193 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
194 }
kjellander32c4a202016-08-30 02:53:49 -0700195}
196
oprypinfbbba3f2017-09-25 08:34:41 -0700197if (rtc_include_tests) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000198 rtc_source_set("test_main") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000199 visibility = [ "*" ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200200 testonly = true
Oleh Prypin5ab68542017-09-25 09:18:00 +0000201 sources = [
202 "test_main.cc",
203 ]
204
205 public_deps = [
206 ":test_support",
207 ]
208 deps = [
209 ":field_trial",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100210 ":fileutils",
Edward Lemure66572b2018-01-05 15:34:09 +0100211 ":perf_test",
Niels Möller8909a632018-09-06 08:42:44 +0200212 "../rtc_base:rtc_base",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200213 "../system_wrappers:field_trial",
214 "../system_wrappers:metrics",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000215 "../system_wrappers:runtime_enabled_features_default",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000216 "//testing/gtest",
mbonadei9452c622017-04-27 12:29:29 -0700217 ]
218 }
mbonadei9452c622017-04-27 12:29:29 -0700219
Oleh Prypin5ab68542017-09-25 09:18:00 +0000220 rtc_source_set("video_test_support") {
221 testonly = true
222
223 sources = [
224 "testsupport/frame_reader.h",
225 "testsupport/frame_writer.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000226 "testsupport/mock/mock_frame_reader.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000227 "testsupport/y4m_frame_writer.cc",
228 "testsupport/yuv_frame_reader.cc",
229 "testsupport/yuv_frame_writer.cc",
230 ]
231
232 deps = [
Patrik Höglund7696bef2018-03-15 15:05:39 +0100233 ":fileutils",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000234 ":test_support",
235 ":video_test_common",
236 "..:webrtc_common",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200237 "../api/video:video_frame",
238 "../api/video:video_frame_i420",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000239 "../common_video",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100240 "../rtc_base:checks",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000241 "../rtc_base:rtc_base_approved",
242 "../system_wrappers",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000243 "//testing/gtest",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100244 "//third_party/libyuv",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000245 ]
246
247 if (!is_ios) {
248 deps += [ "//third_party:jpeg" ]
249 sources += [ "testsupport/jpeg_frame_writer.cc" ]
250 } else {
251 sources += [ "testsupport/jpeg_frame_writer_ios.cc" ]
252 }
253
Oleh Prypin5ab68542017-09-25 09:18:00 +0000254 if (!build_with_chromium && is_clang) {
255 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
256 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
257 }
258
259 if (is_android) {
260 deps += [ "//base:base" ]
261 }
Oleh Prypin5ab68542017-09-25 09:18:00 +0000262 }
263
Edward Lemuraf8659a2017-09-27 14:46:24 +0200264 rtc_source_set("test_support_test_artifacts") {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000265 testonly = true
266 sources = [
Edward Lemuraf8659a2017-09-27 14:46:24 +0200267 "testsupport/test_artifacts.cc",
268 "testsupport/test_artifacts.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000269 ]
270 deps = [
271 ":fileutils",
272 "../rtc_base:rtc_base_approved",
273 ]
274 }
275
276 test_support_unittests_resources = [
277 "../resources/foreman_cif_short.yuv",
278 "../resources/video_coding/frame-ethernet-ii.pcap",
279 "../resources/video_coding/frame-loopback.pcap",
280 "../resources/video_coding/pltype103.rtp",
281 "../resources/video_coding/pltype103_header_only.rtp",
282 "../resources/video_coding/ssrcs-2.pcap",
283 "../resources/video_coding/ssrcs-3.pcap",
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200284 ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200285
286 if (is_ios) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000287 bundle_data("test_support_unittests_bundle_data") {
288 testonly = true
289 sources = test_support_unittests_resources
290 outputs = [
291 "{{bundle_resources_dir}}/{{source_file_part}}",
292 ]
293 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200294 }
295
Oleh Prypin5ab68542017-09-25 09:18:00 +0000296 rtc_test("test_support_unittests") {
297 deps = [
Sebastian Jansson09408112018-04-24 14:41:22 +0200298 ":direct_transport",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200299 ":fake_video_codecs",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100300 ":fileutils",
Mirko Bonadei46399992018-08-22 15:32:38 +0200301 ":fileutils_unittests",
Edward Lemure66572b2018-01-05 15:34:09 +0100302 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000303 ":rtp_test_utils",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200304 ":test_common",
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",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200310 "../api:create_simulcast_test_fixture_api",
311 "../api:simulcast_test_fixture_api",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200312 "../api/video:video_frame_i420",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200313 "../modules/rtp_rtcp:rtp_rtcp",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200314 "../modules/video_capture",
315 "../modules/video_coding:simulcast_test_fixture_impl",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000316 "../rtc_base:rtc_base_approved",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200317 "../test:single_threaded_task_queue",
Sebastian Jansson98b07e92018-09-27 13:47:01 +0200318 "scenario:scenario_unittests",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200319 "//testing/gmock",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200320 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200321 "//third_party/abseil-cpp/absl/memory",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000322 ]
323 sources = [
Sebastian Jansson09408112018-04-24 14:41:22 +0200324 "direct_transport_unittest.cc",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200325 "fake_vp8_encoder_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000326 "frame_generator_unittest.cc",
327 "rtp_file_reader_unittest.cc",
328 "rtp_file_writer_unittest.cc",
329 "single_threaded_task_queue_unittest.cc",
330 "testsupport/always_passing_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000331 "testsupport/perf_test_unittest.cc",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200332 "testsupport/test_artifacts_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000333 "testsupport/y4m_frame_writer_unittest.cc",
334 "testsupport/yuv_frame_reader_unittest.cc",
335 "testsupport/yuv_frame_writer_unittest.cc",
336 ]
337
Oleh Prypin5ab68542017-09-25 09:18:00 +0000338 if (!build_with_chromium && is_clang) {
339 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
340 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
341 }
342
343 data = test_support_unittests_resources
344 if (is_android) {
345 deps += [ "//testing/android/native_test:native_test_support" ]
346 shard_timeout = 900
347 }
348
349 if (is_ios) {
350 deps += [ ":test_support_unittests_bundle_data" ]
351 }
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200352
Mirko Bonadei9098b302018-04-06 10:48:10 +0200353 if (!is_android && !build_with_chromium) {
354 # This is needed in order to avoid:
355 # undefined symbol: webrtc::videocapturemodule::VideoCaptureImpl::Create
356 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
357 }
Oleh Prypin5ab68542017-09-25 09:18:00 +0000358 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200359}
360
mbonadeicd95a4e2017-08-23 23:55:54 -0700361if (is_ios) {
362 rtc_source_set("fileutils_objc") {
mbonadei9c296b32017-09-05 05:11:41 -0700363 visibility = [ ":fileutils" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700364 sources = [
365 "testsupport/iosfileutils.mm",
366 ]
367 deps = [
368 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100369 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700370 "../rtc_base:rtc_base_approved",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200371 "../sdk:helpers_objc",
mbonadeicd95a4e2017-08-23 23:55:54 -0700372 ]
373 }
374}
375
mbonadei9452c622017-04-27 12:29:29 -0700376rtc_source_set("fileutils") {
377 testonly = true
Patrik Höglund7696bef2018-03-15 15:05:39 +0100378 visibility = [ "*" ]
mbonadei9452c622017-04-27 12:29:29 -0700379 sources = [
380 "testsupport/fileutils.cc",
381 "testsupport/fileutils.h",
382 ]
mbonadei3edccb92017-06-01 04:47:20 -0700383 deps = [
384 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100385 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700386 "../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +0200387 "../rtc_base/system:arch",
Danil Chapovalov431abd92018-06-18 12:54:17 +0200388 "//third_party/abseil-cpp/absl/types:optional",
mbonadei3edccb92017-06-01 04:47:20 -0700389 ]
mbonadei9452c622017-04-27 12:29:29 -0700390 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700391 deps += [ ":fileutils_objc" ]
mbonadei3edccb92017-06-01 04:47:20 -0700392 }
393 if (is_win) {
ehmaldonadof6a861a2017-07-19 10:40:47 -0700394 deps += [ "../rtc_base:rtc_base" ]
mbonadei9452c622017-04-27 12:29:29 -0700395 }
mbonadei9452c622017-04-27 12:29:29 -0700396}
397
398rtc_source_set("run_test") {
399 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700400 if (is_mac) {
401 public_deps = [
402 ":run_test_objc",
403 ]
404 } else {
405 public_deps = [
406 ":run_test_generic",
407 ]
408 }
409}
410
411rtc_source_set("run_test_interface") {
mbonadei9452c622017-04-27 12:29:29 -0700412 sources = [
413 "run_test.h",
414 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700415}
416
417if (is_mac) {
418 rtc_source_set("run_test_objc") {
419 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700420 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700421 sources = [
422 "mac/run_test.mm",
423 ]
mbonadei9c296b32017-09-05 05:11:41 -0700424 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700425 ":run_test_interface",
426 ]
mbonadei9452c622017-04-27 12:29:29 -0700427 }
428}
429
mbonadeicd95a4e2017-08-23 23:55:54 -0700430rtc_source_set("run_test_generic") {
431 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700432 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700433 sources = [
434 "run_test.cc",
435 ]
mbonadei9c296b32017-09-05 05:11:41 -0700436 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700437 ":run_test_interface",
438 ]
439}
440
ehmaldonado37535bf2016-12-05 06:42:45 -0800441rtc_source_set("fileutils_unittests") {
442 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700443 visibility = [ ":*" ] # Only targets in this file can depend on this.
ehmaldonado37535bf2016-12-05 06:42:45 -0800444 sources = [
445 "testsupport/fileutils_unittest.cc",
446 ]
447 deps = [
448 ":fileutils",
mbonadei3edccb92017-06-01 04:47:20 -0700449 ":test_support",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100450 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700451 "../rtc_base:rtc_base_approved",
ehmaldonado37535bf2016-12-05 06:42:45 -0800452 "//testing/gtest",
Danil Chapovalov431abd92018-06-18 12:54:17 +0200453 "//third_party/abseil-cpp/absl/types:optional",
ehmaldonado37535bf2016-12-05 06:42:45 -0800454 ]
455}
kjellander0f380d82016-06-01 04:48:26 -0700456
perkj488c5dc2017-02-08 05:55:51 -0800457rtc_source_set("direct_transport") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000458 visibility = [ "*" ]
perkj488c5dc2017-02-08 05:55:51 -0800459 testonly = true
460 sources = [
461 "direct_transport.cc",
462 "direct_transport.h",
perkj488c5dc2017-02-08 05:55:51 -0800463 ]
464 if (!build_with_chromium && is_clang) {
465 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
466 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
467 }
468 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700469 "..:webrtc_common",
Artem Titov46c4e602018-08-17 14:26:54 +0200470 "../api:simulated_network_api",
perkj488c5dc2017-02-08 05:55:51 -0800471 "../api:transport_api",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100472 "../call:call_interfaces",
Artem Titov46c4e602018-08-17 14:26:54 +0200473 "../call:simulated_packet_receiver",
mbonadei3edccb92017-06-01 04:47:20 -0700474 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700475 "../rtc_base:rtc_base_approved",
eladalon413ee9a2017-08-22 04:02:52 -0700476 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700477 "../system_wrappers",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200478 "//third_party/abseil-cpp/absl/memory",
perkj488c5dc2017-02-08 05:55:51 -0800479 ]
eladalon413ee9a2017-08-22 04:02:52 -0700480 public_deps = [
481 ":single_threaded_task_queue",
Erik Språng09708512018-03-14 15:16:50 +0100482 "../call:fake_network",
eladalon413ee9a2017-08-22 04:02:52 -0700483 ]
484}
485
486rtc_source_set("single_threaded_task_queue") {
487 testonly = true
488 sources = [
489 "single_threaded_task_queue.cc",
490 "single_threaded_task_queue.h",
491 ]
492 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100493 "../rtc_base:checks",
eladalon413ee9a2017-08-22 04:02:52 -0700494 "../rtc_base:rtc_base_approved",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200495 "//third_party/abseil-cpp/absl/memory",
eladalon413ee9a2017-08-22 04:02:52 -0700496 ]
perkj488c5dc2017-02-08 05:55:51 -0800497}
498
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200499rtc_source_set("fake_video_codecs") {
500 testonly = true
501 visibility = [ "*" ]
502 sources = [
503 "configurable_frame_size_encoder.cc",
504 "configurable_frame_size_encoder.h",
505 "fake_decoder.cc",
506 "fake_decoder.h",
507 "fake_encoder.cc",
508 "fake_encoder.h",
509 "fake_vp8_encoder.cc",
510 "fake_vp8_encoder.h",
511 ]
512 if (!build_with_chromium && is_clang) {
513 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
514 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
515 }
516 deps = [
517 "..:webrtc_common",
518 "../api/video:video_frame_i420",
519 "../api/video_codecs:video_codecs_api",
520 "../common_video:common_video",
521 "../modules/video_coding:video_codec_interface",
522 "../modules/video_coding:video_coding_utility",
523 "../modules/video_coding:webrtc_h264",
524 "../modules/video_coding:webrtc_vp8",
525 "../modules/video_coding:webrtc_vp9",
526 "../rtc_base:checks",
527 "../rtc_base:rtc_base_approved",
528 "../rtc_base:rtc_task_queue",
529 "../rtc_base:sequenced_task_checker",
530 "../system_wrappers",
531 ]
532}
533
ehmaldonado38a21322016-09-02 04:10:34 -0700534rtc_source_set("test_common") {
kjellander0f380d82016-06-01 04:48:26 -0700535 testonly = true
536 sources = [
537 "call_test.cc",
538 "call_test.h",
kjellander0f380d82016-06-01 04:48:26 -0700539 "constants.cc",
540 "constants.h",
kjellander0f380d82016-06-01 04:48:26 -0700541 "drifting_clock.cc",
542 "drifting_clock.h",
543 "encoder_settings.cc",
544 "encoder_settings.h",
sakal55d932b2016-09-30 06:19:08 -0700545 "fake_videorenderer.h",
Rasmus Brandt0cedc052018-05-31 12:53:00 +0200546 "function_video_decoder_factory.h",
Niels Möller4db138e2018-04-19 09:04:13 +0200547 "function_video_encoder_factory.h",
kjellander0f380d82016-06-01 04:48:26 -0700548 "layer_filtering_transport.cc",
549 "layer_filtering_transport.h",
Danil Chapovalovdd7e2842018-03-09 15:37:03 +0000550 "mock_transport.cc",
kjellander0f380d82016-06-01 04:48:26 -0700551 "mock_transport.h",
kjellander0f380d82016-06-01 04:48:26 -0700552 "null_transport.cc",
553 "null_transport.h",
554 "rtp_rtcp_observer.h",
555 "statistics.cc",
556 "statistics.h",
Niels Möllercbcbc222018-09-28 09:07:24 +0200557 "video_decoder_proxy_factory.h",
558 "video_encoder_proxy_factory.h",
kjellander0f380d82016-06-01 04:48:26 -0700559 "win/run_loop_win.cc",
560 ]
561 if (!is_win) {
562 sources += [
563 "run_loop.cc",
564 "run_loop.h",
565 ]
566 }
567
kjellandere40a7ee2016-10-16 23:56:12 -0700568 if (!build_with_chromium && is_clang) {
569 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700570 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700571 }
572
573 deps = [
perkj488c5dc2017-02-08 05:55:51 -0800574 ":direct_transport",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200575 ":fake_video_codecs",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100576 ":fileutils",
kjellander0f380d82016-06-01 04:48:26 -0700577 ":rtp_test_utils",
578 ":test_support",
perkjc5726c12017-03-01 03:37:08 -0800579 ":video_test_common",
Patrik Höglundbe214a22018-01-04 12:14:35 +0100580 "../api:libjingle_peerconnection_api",
Artem Titov46c4e602018-08-17 14:26:54 +0200581 "../api:simulated_network_api",
mbonadei3edccb92017-06-01 04:47:20 -0700582 "../api:transport_api",
mbonadei3edccb92017-06-01 04:47:20 -0700583 "../api/audio_codecs:builtin_audio_decoder_factory",
ossueb1fde42017-05-02 06:46:30 -0700584 "../api/audio_codecs:builtin_audio_encoder_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200585 "../api/video:video_frame",
ilnikd60d06a2017-04-05 03:02:20 -0700586 "../api/video_codecs:video_codecs_api",
kjellander94cee312016-06-10 01:56:57 -0700587 "../audio",
kjellander94cee312016-06-10 01:56:57 -0700588 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100589 "../call:call_interfaces",
Artem Titov4e199e92018-08-20 13:30:39 +0200590 "../call:fake_network",
sprangdb2a9fc2017-08-09 06:42:32 -0700591 "../call:rtp_sender",
Artem Titov4e199e92018-08-20 13:30:39 +0200592 "../call:simulated_network",
Artem Titov46c4e602018-08-17 14:26:54 +0200593 "../call:simulated_packet_receiver",
aleloi440b6d92017-08-22 05:43:23 -0700594 "../call:video_stream_api",
mbonadei3edccb92017-06-01 04:47:20 -0700595 "../logging:rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800596 "../logging:rtc_event_log_impl_base",
Emircan Uysaler03e6ec92018-03-09 15:03:26 -0800597 "../media:rtc_internal_video_codecs",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100598 "../media:rtc_media_base",
Artem Titov3faa8322018-03-07 14:44:00 +0100599 "../modules/audio_device",
Paulina Hensman7bd79a02018-03-15 12:44:12 +0100600 "../modules/audio_device:audio_device_impl",
mbonadei3edccb92017-06-01 04:47:20 -0700601 "../modules/audio_device:mock_audio_device",
aleloi10111bc2016-11-17 06:48:48 -0800602 "../modules/audio_mixer:audio_mixer_impl",
aleloidd310712016-11-17 06:28:59 -0800603 "../modules/audio_processing",
Sebastian Jansson50eb4c42018-08-03 13:25:17 +0200604 "../modules/congestion_controller/bbr",
mbonadei3edccb92017-06-01 04:47:20 -0700605 "../modules/rtp_rtcp",
606 "../modules/rtp_rtcp:mock_rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100607 "../modules/rtp_rtcp:rtp_rtcp_format",
charujaincb728ea2017-09-18 03:08:08 -0700608 "../modules/video_coding:video_coding_utility",
mbonadei3edccb92017-06-01 04:47:20 -0700609 "../modules/video_coding:webrtc_h264",
Emircan Uysaler03e6ec92018-03-09 15:03:26 -0800610 "../modules/video_coding:webrtc_multiplex",
Sergio Garcia Murillo43800f92018-06-21 16:16:38 +0200611 "../modules/video_coding:webrtc_vp8",
mbonadei3edccb92017-06-01 04:47:20 -0700612 "../modules/video_coding:webrtc_vp9",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100613 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700614 "../rtc_base:rtc_base_approved",
Sebastian Jansson50eb4c42018-08-03 13:25:17 +0200615 "../rtc_base/experiments:congestion_controller_experiment",
mbonadei3edccb92017-06-01 04:47:20 -0700616 "../system_wrappers",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200617 "../system_wrappers:field_trial",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000618 "../system_wrappers:runtime_enabled_features_api",
kjellander94cee312016-06-10 01:56:57 -0700619 "../video",
kjellander0f380d82016-06-01 04:48:26 -0700620 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200621 "//third_party/abseil-cpp/absl/memory",
kjellander0f380d82016-06-01 04:48:26 -0700622 ]
mbonadei148d5a22017-04-28 05:24:50 -0700623 if (!is_android && !build_with_chromium) {
oprypin92220ff2017-03-23 03:40:03 -0700624 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
625 }
kjellander0f380d82016-06-01 04:48:26 -0700626}
627
ehmaldonado38a21322016-09-02 04:10:34 -0700628rtc_source_set("test_renderer") {
mbonadei9c296b32017-09-05 05:11:41 -0700629 public_deps = [
630 ":test_renderer_generic",
631 ]
kjellander0f380d82016-06-01 04:48:26 -0700632 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700633 if (is_mac) {
mbonadei9c296b32017-09-05 05:11:41 -0700634 public_deps += [ ":test_renderer_objc" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700635 }
636}
637
638if (is_mac) {
639 rtc_source_set("test_renderer_objc") {
640 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700641 visibility = [ ":test_renderer" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700642 sources = [
643 "mac/video_renderer_mac.h",
644 "mac/video_renderer_mac.mm",
645 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700646 deps = [
mbonadei9c296b32017-09-05 05:11:41 -0700647 ":test_renderer_generic",
mbonadeicd95a4e2017-08-23 23:55:54 -0700648 "../rtc_base:rtc_base_approved",
649 ]
650 libs = [
651 "Cocoa.framework",
652 "OpenGL.framework",
653 "CoreVideo.framework",
654 ]
655 if (!build_with_chromium && is_clang) {
656 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
657 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
658 }
659 }
660}
661
662rtc_source_set("test_renderer_generic") {
663 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700664 visibility = [
665 ":test_renderer",
666 ":test_renderer_objc",
667 ]
kjellander0f380d82016-06-01 04:48:26 -0700668 libs = []
669 sources = [
kjellander0f380d82016-06-01 04:48:26 -0700670 "video_renderer.cc",
671 "video_renderer.h",
672 "win/d3d_renderer.cc",
673 "win/d3d_renderer.h",
674 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700675 deps = [
676 ":test_support",
677 "..:webrtc_common",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200678 "../api/video:video_frame",
mbonadeicd95a4e2017-08-23 23:55:54 -0700679 "../common_video",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100680 "../media:rtc_media_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100681 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700682 "../rtc_base:rtc_base_approved",
683 "//testing/gtest",
684 ]
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100685 if (!(is_linux && rtc_use_x11) && !is_mac && !is_win) {
kjellander0f380d82016-06-01 04:48:26 -0700686 sources += [ "null_platform_renderer.cc" ]
687 }
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100688 if ((is_linux && rtc_use_x11) || is_mac) {
kjellander0f380d82016-06-01 04:48:26 -0700689 sources += [
690 "gl/gl_renderer.cc",
691 "gl/gl_renderer.h",
692 ]
693 }
694
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100695 if (is_linux && rtc_use_x11) {
Edward Lemur84a87c42017-11-07 19:07:31 +0100696 sources += [
697 "linux/glx_renderer.cc",
698 "linux/glx_renderer.h",
699 "linux/video_renderer_linux.cc",
700 ]
kjellander0f380d82016-06-01 04:48:26 -0700701 libs += [
702 "Xext",
703 "X11",
704 "GL",
705 ]
706 }
707 if (is_android) {
708 libs += [
709 "GLESv2",
710 "log",
711 ]
712 }
kjellander0f380d82016-06-01 04:48:26 -0700713
kjellandere40a7ee2016-10-16 23:56:12 -0700714 if (!build_with_chromium && is_clang) {
715 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700716 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700717 }
kjellander0f380d82016-06-01 04:48:26 -0700718}
kwiberg37e99fd2017-04-10 05:15:48 -0700719
720rtc_source_set("audio_codec_mocks") {
721 testonly = true
722 sources = [
kwiberg2b3aa142017-06-14 03:31:17 -0700723 "mock_audio_decoder.cc",
kwiberg37e99fd2017-04-10 05:15:48 -0700724 "mock_audio_decoder.h",
725 "mock_audio_decoder_factory.h",
ossueb1fde42017-05-02 06:46:30 -0700726 "mock_audio_encoder.cc",
727 "mock_audio_encoder.h",
728 "mock_audio_encoder_factory.h",
729 ]
730
731 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700732 ":test_support",
kwiberg529662a2017-09-04 05:43:17 -0700733 "../api:array_view",
ossueb1fde42017-05-02 06:46:30 -0700734 "../api/audio_codecs:audio_codecs_api",
mbonadei3edccb92017-06-01 04:47:20 -0700735 "../api/audio_codecs:builtin_audio_decoder_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700736 "../rtc_base:rtc_base_approved",
kwiberg37e99fd2017-04-10 05:15:48 -0700737 ]
738}
sakald7fdb802017-05-26 01:51:53 -0700739
740if (!build_with_chromium && is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000741 rtc_android_library("native_test_java") {
sakald7fdb802017-05-26 01:51:53 -0700742 testonly = true
743 java_files = [
744 "android/org/webrtc/native_test/RTCNativeUnitTest.java",
745 "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
746 ]
747 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700748 "../rtc_base:base_java",
sakald7fdb802017-05-26 01:51:53 -0700749 "//testing/android/native_test:native_test_java",
sakald7fdb802017-05-26 01:51:53 -0700750 ]
751 }
752}