blob: 29d577445c40dbe256b9db8ec72fff379de2bfa7 [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",
Oleh Prypind136b282018-10-03 13:53:44 +0200130 "../rtc_base:checks",
Edward Lemure66572b2018-01-05 15:34:09 +0100131 "../rtc_base:rtc_base_approved",
132 ]
133}
134
mbonadeicd95a4e2017-08-23 23:55:54 -0700135if (is_ios) {
136 rtc_source_set("test_support_objc") {
137 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700138 visibility = [ ":test_support" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700139 sources = [
140 "ios/test_support.h",
141 "ios/test_support.mm",
142 ]
denicijad207a392017-09-11 06:43:28 -0700143 deps = [
Edward Lemure66572b2018-01-05 15:34:09 +0100144 ":perf_test",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200145 "../sdk:helpers_objc",
denicijad207a392017-09-11 06:43:28 -0700146 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700147 }
148}
149
Patrik Höglund34924c22018-01-19 09:11:07 +0100150config("suppress_warning_4373") {
151 if (is_win) {
152 cflags = [
153 # MSVC has a bug which generates this warning when using mocks; see the
154 # section on warning 4373 in he googlemock FAQ. This warning isn't the
155 # least relevant for us, anyway.
156 "/wd4373",
157 ]
158 }
159}
160
Sebastian Jansson2afd2812018-08-23 14:44:05 +0200161config("test_main_direct_config") {
162 visibility = [ ":*" ]
163 defines = [ "UNIT_TEST" ]
164}
mbonadei148d5a22017-04-28 05:24:50 -0700165rtc_source_set("test_support") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000166 visibility = [ "*" ]
mbonadei148d5a22017-04-28 05:24:50 -0700167 testonly = true
kjellander32c4a202016-08-30 02:53:49 -0700168
Mirko Bonadei65ce3112018-01-26 11:57:47 +0100169 all_dependent_configs = [
170 ":suppress_warning_4373",
171 "//third_party/googletest:gmock_config",
172 "//third_party/googletest:gtest_config",
173 ]
Patrik Höglund34924c22018-01-19 09:11:07 +0100174
mbonadei148d5a22017-04-28 05:24:50 -0700175 sources = [
176 "gmock.h",
177 "gtest.h",
mbonadei148d5a22017-04-28 05:24:50 -0700178 ]
179
Patrik Höglund7696bef2018-03-15 15:05:39 +0100180 public_deps = []
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200181 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700182 public_deps += [ ":test_support_objc" ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200183 }
184
Sebastian Jansson2afd2812018-08-23 14:44:05 +0200185 public_configs = [ ":test_main_direct_config" ]
mbonadei148d5a22017-04-28 05:24:50 -0700186 deps = [
ehmaldonadof6a861a2017-07-19 10:40:47 -0700187 "../rtc_base:rtc_base_approved",
mbonadei148d5a22017-04-28 05:24:50 -0700188 "//testing/gmock",
189 "//testing/gtest",
190 ]
191
mbonadei148d5a22017-04-28 05:24:50 -0700192 if (!build_with_chromium && is_clang) {
193 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
194 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
195 }
kjellander32c4a202016-08-30 02:53:49 -0700196}
197
oprypinfbbba3f2017-09-25 08:34:41 -0700198if (rtc_include_tests) {
Artem Titov40a7a352018-10-15 15:25:34 +0200199 rtc_source_set("test_main_lib") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000200 visibility = [ "*" ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200201 testonly = true
Oleh Prypin5ab68542017-09-25 09:18:00 +0000202 sources = [
Artem Titov40a7a352018-10-15 15:25:34 +0200203 "test_main_lib.cc",
204 "test_main_lib.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000205 ]
206
Oleh Prypin5ab68542017-09-25 09:18:00 +0000207 deps = [
208 ":field_trial",
Edward Lemure66572b2018-01-05 15:34:09 +0100209 ":perf_test",
Artem Titov40a7a352018-10-15 15:25:34 +0200210 ":test_support",
Niels Möller8909a632018-09-06 08:42:44 +0200211 "../rtc_base:rtc_base",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200212 "../system_wrappers:field_trial",
213 "../system_wrappers:metrics",
Mirko Bonadeibc6a06c2018-10-19 08:43:53 +0200214 "../third_party/abseil-cpp/absl/memory:memory",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000215 "//testing/gtest",
Patrik Höglund77301932018-10-09 15:09:51 +0200216
217 # TODO(bugs.webrtc.org/9792): This is needed for downstream projects on
218 # Android, where it's replaced by an internal version of fileutils that
219 # has a certain flag. Remove this once the internal fileutils has been
220 # eliminated.
221 "../test:fileutils",
mbonadei9452c622017-04-27 12:29:29 -0700222 ]
223 }
mbonadei9452c622017-04-27 12:29:29 -0700224
Artem Titov40a7a352018-10-15 15:25:34 +0200225 rtc_source_set("test_main") {
226 visibility = [ "*" ]
227 testonly = true
228 sources = [
229 "test_main.cc",
230 ]
231
232 deps = [
233 ":test_main_lib",
234 ]
235 }
236
Oleh Prypin5ab68542017-09-25 09:18:00 +0000237 rtc_source_set("video_test_support") {
238 testonly = true
239
240 sources = [
241 "testsupport/frame_reader.h",
242 "testsupport/frame_writer.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000243 "testsupport/mock/mock_frame_reader.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000244 "testsupport/y4m_frame_writer.cc",
245 "testsupport/yuv_frame_reader.cc",
246 "testsupport/yuv_frame_writer.cc",
247 ]
248
249 deps = [
Patrik Höglund7696bef2018-03-15 15:05:39 +0100250 ":fileutils",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000251 ":test_support",
252 ":video_test_common",
253 "..:webrtc_common",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200254 "../api/video:video_frame",
255 "../api/video:video_frame_i420",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000256 "../common_video",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100257 "../rtc_base:checks",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000258 "../rtc_base:rtc_base_approved",
259 "../system_wrappers",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000260 "//testing/gtest",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100261 "//third_party/libyuv",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000262 ]
263
264 if (!is_ios) {
265 deps += [ "//third_party:jpeg" ]
266 sources += [ "testsupport/jpeg_frame_writer.cc" ]
267 } else {
268 sources += [ "testsupport/jpeg_frame_writer_ios.cc" ]
269 }
270
Oleh Prypin5ab68542017-09-25 09:18:00 +0000271 if (!build_with_chromium && is_clang) {
272 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
273 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
274 }
275
276 if (is_android) {
277 deps += [ "//base:base" ]
278 }
Oleh Prypin5ab68542017-09-25 09:18:00 +0000279 }
280
Edward Lemuraf8659a2017-09-27 14:46:24 +0200281 rtc_source_set("test_support_test_artifacts") {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000282 testonly = true
283 sources = [
Edward Lemuraf8659a2017-09-27 14:46:24 +0200284 "testsupport/test_artifacts.cc",
285 "testsupport/test_artifacts.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000286 ]
287 deps = [
288 ":fileutils",
289 "../rtc_base:rtc_base_approved",
290 ]
291 }
292
293 test_support_unittests_resources = [
294 "../resources/foreman_cif_short.yuv",
295 "../resources/video_coding/frame-ethernet-ii.pcap",
296 "../resources/video_coding/frame-loopback.pcap",
297 "../resources/video_coding/pltype103.rtp",
298 "../resources/video_coding/pltype103_header_only.rtp",
299 "../resources/video_coding/ssrcs-2.pcap",
300 "../resources/video_coding/ssrcs-3.pcap",
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200301 ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200302
303 if (is_ios) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000304 bundle_data("test_support_unittests_bundle_data") {
305 testonly = true
306 sources = test_support_unittests_resources
307 outputs = [
308 "{{bundle_resources_dir}}/{{source_file_part}}",
309 ]
310 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200311 }
312
Oleh Prypin5ab68542017-09-25 09:18:00 +0000313 rtc_test("test_support_unittests") {
314 deps = [
Sebastian Jansson09408112018-04-24 14:41:22 +0200315 ":direct_transport",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200316 ":fake_video_codecs",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100317 ":fileutils",
Mirko Bonadei46399992018-08-22 15:32:38 +0200318 ":fileutils_unittests",
Edward Lemure66572b2018-01-05 15:34:09 +0100319 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000320 ":rtp_test_utils",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200321 ":test_common",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200322 ":test_main",
323 ":test_support",
324 ":test_support_test_artifacts",
325 ":video_test_common",
326 ":video_test_support",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200327 "../api:create_simulcast_test_fixture_api",
328 "../api:simulcast_test_fixture_api",
Danil Chapovalov99b71df2018-10-26 15:57:48 +0200329 "../api/test/video:function_video_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200330 "../api/video:video_frame_i420",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200331 "../modules/rtp_rtcp:rtp_rtcp",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200332 "../modules/video_capture",
333 "../modules/video_coding:simulcast_test_fixture_impl",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000334 "../rtc_base:rtc_base_approved",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200335 "../test:single_threaded_task_queue",
Sebastian Jansson98b07e92018-09-27 13:47:01 +0200336 "scenario:scenario_unittests",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200337 "//testing/gmock",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200338 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200339 "//third_party/abseil-cpp/absl/memory",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000340 ]
341 sources = [
Sebastian Jansson09408112018-04-24 14:41:22 +0200342 "direct_transport_unittest.cc",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200343 "fake_vp8_encoder_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000344 "frame_generator_unittest.cc",
345 "rtp_file_reader_unittest.cc",
346 "rtp_file_writer_unittest.cc",
347 "single_threaded_task_queue_unittest.cc",
348 "testsupport/always_passing_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000349 "testsupport/perf_test_unittest.cc",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200350 "testsupport/test_artifacts_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000351 "testsupport/y4m_frame_writer_unittest.cc",
352 "testsupport/yuv_frame_reader_unittest.cc",
353 "testsupport/yuv_frame_writer_unittest.cc",
354 ]
355
Oleh Prypin5ab68542017-09-25 09:18:00 +0000356 if (!build_with_chromium && is_clang) {
357 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
358 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
359 }
360
361 data = test_support_unittests_resources
362 if (is_android) {
363 deps += [ "//testing/android/native_test:native_test_support" ]
364 shard_timeout = 900
365 }
366
367 if (is_ios) {
368 deps += [ ":test_support_unittests_bundle_data" ]
369 }
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200370
Mirko Bonadei9098b302018-04-06 10:48:10 +0200371 if (!is_android && !build_with_chromium) {
372 # This is needed in order to avoid:
373 # undefined symbol: webrtc::videocapturemodule::VideoCaptureImpl::Create
374 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
375 }
Oleh Prypin5ab68542017-09-25 09:18:00 +0000376 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200377}
378
mbonadeicd95a4e2017-08-23 23:55:54 -0700379if (is_ios) {
Patrik Höglund8434aeb2018-10-05 14:52:11 +0200380 rtc_source_set("fileutils_ios_objc") {
Artem Titov8f726be2018-10-23 15:50:10 +0200381 visibility = [
382 ":fileutils",
383 ":fileutils_override_impl",
384 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700385 sources = [
Patrik Höglund8434aeb2018-10-05 14:52:11 +0200386 "testsupport/iosfileutils.h",
mbonadeicd95a4e2017-08-23 23:55:54 -0700387 "testsupport/iosfileutils.mm",
388 ]
389 deps = [
390 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100391 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700392 "../rtc_base:rtc_base_approved",
Anders Carlsson7bca8ca2018-08-30 09:30:29 +0200393 "../sdk:helpers_objc",
mbonadeicd95a4e2017-08-23 23:55:54 -0700394 ]
395 }
396}
397
Patrik Höglund8434aeb2018-10-05 14:52:11 +0200398if (is_mac) {
399 rtc_source_set("fileutils_mac_objc") {
Artem Titov8f726be2018-10-23 15:50:10 +0200400 visibility = [
401 ":fileutils",
402 ":fileutils_override_impl",
403 ]
Patrik Höglund8434aeb2018-10-05 14:52:11 +0200404 sources = [
405 "testsupport/macfileutils.h",
406 "testsupport/macfileutils.mm",
407 ]
408 deps = [
409 "../rtc_base:checks",
410 ]
411 }
412}
413
mbonadei9452c622017-04-27 12:29:29 -0700414rtc_source_set("fileutils") {
415 testonly = true
Patrik Höglund7696bef2018-03-15 15:05:39 +0100416 visibility = [ "*" ]
mbonadei9452c622017-04-27 12:29:29 -0700417 sources = [
418 "testsupport/fileutils.cc",
419 "testsupport/fileutils.h",
420 ]
mbonadei3edccb92017-06-01 04:47:20 -0700421 deps = [
Artem Titov8f726be2018-10-23 15:50:10 +0200422 ":fileutils_override_api",
423 ":fileutils_override_impl",
424 "..:webrtc_common",
425 "../rtc_base:checks",
426 "../rtc_base:rtc_base_approved",
427 "../rtc_base/system:arch",
428 "//third_party/abseil-cpp/absl/types:optional",
429 ]
430 if (is_ios) {
431 deps += [ ":fileutils_ios_objc" ]
432 }
433 if (is_mac) {
434 deps += [ ":fileutils_mac_objc" ]
435 }
436 if (is_win) {
437 deps += [ "../rtc_base:rtc_base" ]
438 }
439}
440
441# We separate header into own target to make it possible for downstream
442# projects to override implementation.
443rtc_source_set("fileutils_override_api") {
444 testonly = true
445 sources = [
446 "testsupport/fileutils_override.h",
447 ]
448}
449
450rtc_source_set("fileutils_override_impl") {
451 testonly = true
452 visibility = [ ":fileutils" ]
453 sources = [
454 "testsupport/fileutils_override.cc",
455 ]
456 deps = [
457 ":fileutils_override_api",
mbonadei3edccb92017-06-01 04:47:20 -0700458 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100459 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700460 "../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +0200461 "../rtc_base/system:arch",
Danil Chapovalov431abd92018-06-18 12:54:17 +0200462 "//third_party/abseil-cpp/absl/types:optional",
mbonadei3edccb92017-06-01 04:47:20 -0700463 ]
mbonadei9452c622017-04-27 12:29:29 -0700464 if (is_ios) {
Patrik Höglund8434aeb2018-10-05 14:52:11 +0200465 deps += [ ":fileutils_ios_objc" ]
466 }
467 if (is_mac) {
468 deps += [ ":fileutils_mac_objc" ]
mbonadei3edccb92017-06-01 04:47:20 -0700469 }
470 if (is_win) {
ehmaldonadof6a861a2017-07-19 10:40:47 -0700471 deps += [ "../rtc_base:rtc_base" ]
mbonadei9452c622017-04-27 12:29:29 -0700472 }
mbonadei9452c622017-04-27 12:29:29 -0700473}
474
475rtc_source_set("run_test") {
476 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700477 if (is_mac) {
478 public_deps = [
479 ":run_test_objc",
480 ]
481 } else {
482 public_deps = [
483 ":run_test_generic",
484 ]
485 }
486}
487
488rtc_source_set("run_test_interface") {
mbonadei9452c622017-04-27 12:29:29 -0700489 sources = [
490 "run_test.h",
491 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700492}
493
494if (is_mac) {
495 rtc_source_set("run_test_objc") {
496 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700497 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700498 sources = [
499 "mac/run_test.mm",
500 ]
mbonadei9c296b32017-09-05 05:11:41 -0700501 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700502 ":run_test_interface",
503 ]
mbonadei9452c622017-04-27 12:29:29 -0700504 }
505}
506
mbonadeicd95a4e2017-08-23 23:55:54 -0700507rtc_source_set("run_test_generic") {
508 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700509 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700510 sources = [
511 "run_test.cc",
512 ]
mbonadei9c296b32017-09-05 05:11:41 -0700513 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700514 ":run_test_interface",
515 ]
516}
517
ehmaldonado37535bf2016-12-05 06:42:45 -0800518rtc_source_set("fileutils_unittests") {
519 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700520 visibility = [ ":*" ] # Only targets in this file can depend on this.
ehmaldonado37535bf2016-12-05 06:42:45 -0800521 sources = [
522 "testsupport/fileutils_unittest.cc",
523 ]
524 deps = [
525 ":fileutils",
mbonadei3edccb92017-06-01 04:47:20 -0700526 ":test_support",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100527 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700528 "../rtc_base:rtc_base_approved",
ehmaldonado37535bf2016-12-05 06:42:45 -0800529 "//testing/gtest",
Danil Chapovalov431abd92018-06-18 12:54:17 +0200530 "//third_party/abseil-cpp/absl/types:optional",
ehmaldonado37535bf2016-12-05 06:42:45 -0800531 ]
532}
kjellander0f380d82016-06-01 04:48:26 -0700533
perkj488c5dc2017-02-08 05:55:51 -0800534rtc_source_set("direct_transport") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000535 visibility = [ "*" ]
perkj488c5dc2017-02-08 05:55:51 -0800536 testonly = true
537 sources = [
538 "direct_transport.cc",
539 "direct_transport.h",
perkj488c5dc2017-02-08 05:55:51 -0800540 ]
541 if (!build_with_chromium && is_clang) {
542 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
543 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
544 }
545 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700546 "..:webrtc_common",
Artem Titov46c4e602018-08-17 14:26:54 +0200547 "../api:simulated_network_api",
perkj488c5dc2017-02-08 05:55:51 -0800548 "../api:transport_api",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100549 "../call:call_interfaces",
Artem Titov46c4e602018-08-17 14:26:54 +0200550 "../call:simulated_packet_receiver",
mbonadei3edccb92017-06-01 04:47:20 -0700551 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700552 "../rtc_base:rtc_base_approved",
eladalon413ee9a2017-08-22 04:02:52 -0700553 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700554 "../system_wrappers",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200555 "//third_party/abseil-cpp/absl/memory",
perkj488c5dc2017-02-08 05:55:51 -0800556 ]
eladalon413ee9a2017-08-22 04:02:52 -0700557 public_deps = [
558 ":single_threaded_task_queue",
Erik Språng09708512018-03-14 15:16:50 +0100559 "../call:fake_network",
eladalon413ee9a2017-08-22 04:02:52 -0700560 ]
561}
562
563rtc_source_set("single_threaded_task_queue") {
564 testonly = true
565 sources = [
566 "single_threaded_task_queue.cc",
567 "single_threaded_task_queue.h",
568 ]
569 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100570 "../rtc_base:checks",
eladalon413ee9a2017-08-22 04:02:52 -0700571 "../rtc_base:rtc_base_approved",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200572 "//third_party/abseil-cpp/absl/memory",
eladalon413ee9a2017-08-22 04:02:52 -0700573 ]
perkj488c5dc2017-02-08 05:55:51 -0800574}
575
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200576rtc_source_set("fake_video_codecs") {
577 testonly = true
578 visibility = [ "*" ]
579 sources = [
580 "configurable_frame_size_encoder.cc",
581 "configurable_frame_size_encoder.h",
582 "fake_decoder.cc",
583 "fake_decoder.h",
584 "fake_encoder.cc",
585 "fake_encoder.h",
Per Kjellander841c9122018-10-04 18:40:28 +0200586 "fake_vp8_decoder.cc",
587 "fake_vp8_decoder.h",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200588 "fake_vp8_encoder.cc",
589 "fake_vp8_encoder.h",
590 ]
591 if (!build_with_chromium && is_clang) {
592 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
593 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
594 }
595 deps = [
596 "..:webrtc_common",
Niels Möller4dc66c52018-10-05 14:17:58 +0200597 "../api/video:encoded_image",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200598 "../api/video:video_frame_i420",
Erik Språng4529fbc2018-10-12 10:30:31 +0200599 "../api/video_codecs:create_vp8_temporal_layers",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200600 "../api/video_codecs:video_codecs_api",
601 "../common_video:common_video",
602 "../modules/video_coding:video_codec_interface",
603 "../modules/video_coding:video_coding_utility",
604 "../modules/video_coding:webrtc_h264",
605 "../modules/video_coding:webrtc_vp8",
606 "../modules/video_coding:webrtc_vp9",
607 "../rtc_base:checks",
608 "../rtc_base:rtc_base_approved",
609 "../rtc_base:rtc_task_queue",
610 "../rtc_base:sequenced_task_checker",
611 "../system_wrappers",
612 ]
613}
614
ehmaldonado38a21322016-09-02 04:10:34 -0700615rtc_source_set("test_common") {
kjellander0f380d82016-06-01 04:48:26 -0700616 testonly = true
617 sources = [
618 "call_test.cc",
619 "call_test.h",
kjellander0f380d82016-06-01 04:48:26 -0700620 "constants.cc",
621 "constants.h",
kjellander0f380d82016-06-01 04:48:26 -0700622 "drifting_clock.cc",
623 "drifting_clock.h",
624 "encoder_settings.cc",
625 "encoder_settings.h",
sakal55d932b2016-09-30 06:19:08 -0700626 "fake_videorenderer.h",
kjellander0f380d82016-06-01 04:48:26 -0700627 "layer_filtering_transport.cc",
628 "layer_filtering_transport.h",
Danil Chapovalovdd7e2842018-03-09 15:37:03 +0000629 "mock_transport.cc",
kjellander0f380d82016-06-01 04:48:26 -0700630 "mock_transport.h",
kjellander0f380d82016-06-01 04:48:26 -0700631 "null_transport.cc",
632 "null_transport.h",
633 "rtp_rtcp_observer.h",
634 "statistics.cc",
635 "statistics.h",
Niels Möllercbcbc222018-09-28 09:07:24 +0200636 "video_decoder_proxy_factory.h",
637 "video_encoder_proxy_factory.h",
kjellander0f380d82016-06-01 04:48:26 -0700638 "win/run_loop_win.cc",
639 ]
640 if (!is_win) {
641 sources += [
642 "run_loop.cc",
643 "run_loop.h",
644 ]
645 }
646
kjellandere40a7ee2016-10-16 23:56:12 -0700647 if (!build_with_chromium && is_clang) {
648 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700649 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700650 }
651
652 deps = [
perkj488c5dc2017-02-08 05:55:51 -0800653 ":direct_transport",
Ilya Nikolaevskiyb0588e62018-08-27 14:12:27 +0200654 ":fake_video_codecs",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100655 ":fileutils",
kjellander0f380d82016-06-01 04:48:26 -0700656 ":rtp_test_utils",
657 ":test_support",
perkjc5726c12017-03-01 03:37:08 -0800658 ":video_test_common",
Patrik Höglundbe214a22018-01-04 12:14:35 +0100659 "../api:libjingle_peerconnection_api",
Artem Titov46c4e602018-08-17 14:26:54 +0200660 "../api:simulated_network_api",
mbonadei3edccb92017-06-01 04:47:20 -0700661 "../api:transport_api",
mbonadei3edccb92017-06-01 04:47:20 -0700662 "../api/audio_codecs:builtin_audio_decoder_factory",
ossueb1fde42017-05-02 06:46:30 -0700663 "../api/audio_codecs:builtin_audio_encoder_factory",
Danil Chapovalovddc84e92018-10-24 17:01:58 +0200664 "../api/test/video:function_video_factory",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200665 "../api/video:video_frame",
ilnikd60d06a2017-04-05 03:02:20 -0700666 "../api/video_codecs:video_codecs_api",
kjellander94cee312016-06-10 01:56:57 -0700667 "../audio",
kjellander94cee312016-06-10 01:56:57 -0700668 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100669 "../call:call_interfaces",
Artem Titov4e199e92018-08-20 13:30:39 +0200670 "../call:fake_network",
sprangdb2a9fc2017-08-09 06:42:32 -0700671 "../call:rtp_sender",
Artem Titov4e199e92018-08-20 13:30:39 +0200672 "../call:simulated_network",
Artem Titov46c4e602018-08-17 14:26:54 +0200673 "../call:simulated_packet_receiver",
aleloi440b6d92017-08-22 05:43:23 -0700674 "../call:video_stream_api",
mbonadei3edccb92017-06-01 04:47:20 -0700675 "../logging:rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800676 "../logging:rtc_event_log_impl_base",
Emircan Uysaler03e6ec92018-03-09 15:03:26 -0800677 "../media:rtc_internal_video_codecs",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100678 "../media:rtc_media_base",
Artem Titov3faa8322018-03-07 14:44:00 +0100679 "../modules/audio_device",
Paulina Hensman7bd79a02018-03-15 12:44:12 +0100680 "../modules/audio_device:audio_device_impl",
mbonadei3edccb92017-06-01 04:47:20 -0700681 "../modules/audio_device:mock_audio_device",
aleloi10111bc2016-11-17 06:48:48 -0800682 "../modules/audio_mixer:audio_mixer_impl",
aleloidd310712016-11-17 06:28:59 -0800683 "../modules/audio_processing",
Sebastian Jansson50eb4c42018-08-03 13:25:17 +0200684 "../modules/congestion_controller/bbr",
mbonadei3edccb92017-06-01 04:47:20 -0700685 "../modules/rtp_rtcp",
686 "../modules/rtp_rtcp:mock_rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100687 "../modules/rtp_rtcp:rtp_rtcp_format",
charujaincb728ea2017-09-18 03:08:08 -0700688 "../modules/video_coding:video_coding_utility",
mbonadei3edccb92017-06-01 04:47:20 -0700689 "../modules/video_coding:webrtc_h264",
Emircan Uysaler03e6ec92018-03-09 15:03:26 -0800690 "../modules/video_coding:webrtc_multiplex",
Sergio Garcia Murillo43800f92018-06-21 16:16:38 +0200691 "../modules/video_coding:webrtc_vp8",
mbonadei3edccb92017-06-01 04:47:20 -0700692 "../modules/video_coding:webrtc_vp9",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100693 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700694 "../rtc_base:rtc_base_approved",
Sebastian Jansson50eb4c42018-08-03 13:25:17 +0200695 "../rtc_base/experiments:congestion_controller_experiment",
mbonadei3edccb92017-06-01 04:47:20 -0700696 "../system_wrappers",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200697 "../system_wrappers:field_trial",
kjellander94cee312016-06-10 01:56:57 -0700698 "../video",
kjellander0f380d82016-06-01 04:48:26 -0700699 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200700 "//third_party/abseil-cpp/absl/memory",
kjellander0f380d82016-06-01 04:48:26 -0700701 ]
mbonadei148d5a22017-04-28 05:24:50 -0700702 if (!is_android && !build_with_chromium) {
oprypin92220ff2017-03-23 03:40:03 -0700703 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
704 }
kjellander0f380d82016-06-01 04:48:26 -0700705}
706
ehmaldonado38a21322016-09-02 04:10:34 -0700707rtc_source_set("test_renderer") {
mbonadei9c296b32017-09-05 05:11:41 -0700708 public_deps = [
709 ":test_renderer_generic",
710 ]
kjellander0f380d82016-06-01 04:48:26 -0700711 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700712 if (is_mac) {
mbonadei9c296b32017-09-05 05:11:41 -0700713 public_deps += [ ":test_renderer_objc" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700714 }
715}
716
717if (is_mac) {
718 rtc_source_set("test_renderer_objc") {
719 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700720 visibility = [ ":test_renderer" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700721 sources = [
722 "mac/video_renderer_mac.h",
723 "mac/video_renderer_mac.mm",
724 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700725 deps = [
mbonadei9c296b32017-09-05 05:11:41 -0700726 ":test_renderer_generic",
mbonadeicd95a4e2017-08-23 23:55:54 -0700727 "../rtc_base:rtc_base_approved",
728 ]
729 libs = [
730 "Cocoa.framework",
731 "OpenGL.framework",
732 "CoreVideo.framework",
733 ]
734 if (!build_with_chromium && is_clang) {
735 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
736 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
737 }
738 }
739}
740
741rtc_source_set("test_renderer_generic") {
742 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700743 visibility = [
744 ":test_renderer",
745 ":test_renderer_objc",
746 ]
kjellander0f380d82016-06-01 04:48:26 -0700747 libs = []
748 sources = [
kjellander0f380d82016-06-01 04:48:26 -0700749 "video_renderer.cc",
750 "video_renderer.h",
751 "win/d3d_renderer.cc",
752 "win/d3d_renderer.h",
753 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700754 deps = [
755 ":test_support",
756 "..:webrtc_common",
Niels Möllerc6ce9c52018-05-11 11:15:30 +0200757 "../api/video:video_frame",
mbonadeicd95a4e2017-08-23 23:55:54 -0700758 "../common_video",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100759 "../media:rtc_media_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100760 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700761 "../rtc_base:rtc_base_approved",
762 "//testing/gtest",
763 ]
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100764 if (!(is_linux && rtc_use_x11) && !is_mac && !is_win) {
kjellander0f380d82016-06-01 04:48:26 -0700765 sources += [ "null_platform_renderer.cc" ]
766 }
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100767 if ((is_linux && rtc_use_x11) || is_mac) {
kjellander0f380d82016-06-01 04:48:26 -0700768 sources += [
769 "gl/gl_renderer.cc",
770 "gl/gl_renderer.h",
771 ]
772 }
773
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100774 if (is_linux && rtc_use_x11) {
Edward Lemur84a87c42017-11-07 19:07:31 +0100775 sources += [
776 "linux/glx_renderer.cc",
777 "linux/glx_renderer.h",
778 "linux/video_renderer_linux.cc",
779 ]
kjellander0f380d82016-06-01 04:48:26 -0700780 libs += [
781 "Xext",
782 "X11",
783 "GL",
784 ]
785 }
786 if (is_android) {
787 libs += [
788 "GLESv2",
789 "log",
790 ]
791 }
kjellander0f380d82016-06-01 04:48:26 -0700792
kjellandere40a7ee2016-10-16 23:56:12 -0700793 if (!build_with_chromium && is_clang) {
794 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700795 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700796 }
kjellander0f380d82016-06-01 04:48:26 -0700797}
kwiberg37e99fd2017-04-10 05:15:48 -0700798
799rtc_source_set("audio_codec_mocks") {
800 testonly = true
801 sources = [
kwiberg2b3aa142017-06-14 03:31:17 -0700802 "mock_audio_decoder.cc",
kwiberg37e99fd2017-04-10 05:15:48 -0700803 "mock_audio_decoder.h",
804 "mock_audio_decoder_factory.h",
ossueb1fde42017-05-02 06:46:30 -0700805 "mock_audio_encoder.cc",
806 "mock_audio_encoder.h",
807 "mock_audio_encoder_factory.h",
808 ]
809
810 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700811 ":test_support",
kwiberg529662a2017-09-04 05:43:17 -0700812 "../api:array_view",
ossueb1fde42017-05-02 06:46:30 -0700813 "../api/audio_codecs:audio_codecs_api",
mbonadei3edccb92017-06-01 04:47:20 -0700814 "../api/audio_codecs:builtin_audio_decoder_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700815 "../rtc_base:rtc_base_approved",
kwiberg37e99fd2017-04-10 05:15:48 -0700816 ]
817}
sakald7fdb802017-05-26 01:51:53 -0700818
819if (!build_with_chromium && is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000820 rtc_android_library("native_test_java") {
sakald7fdb802017-05-26 01:51:53 -0700821 testonly = true
822 java_files = [
823 "android/org/webrtc/native_test/RTCNativeUnitTest.java",
824 "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
825 ]
826 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700827 "../rtc_base:base_java",
sakald7fdb802017-05-26 01:51:53 -0700828 "//testing/android/native_test:native_test_java",
sakald7fdb802017-05-26 01:51:53 -0700829 ]
830 }
831}