xref: /aosp_15_r20/external/webrtc/test/network/BUILD.gn (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1*d9f75844SAndroid Build Coastguard Worker# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
2*d9f75844SAndroid Build Coastguard Worker#
3*d9f75844SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license
4*d9f75844SAndroid Build Coastguard Worker# that can be found in the LICENSE file in the root of the source
5*d9f75844SAndroid Build Coastguard Worker# tree. An additional intellectual property rights grant can be found
6*d9f75844SAndroid Build Coastguard Worker# in the file PATENTS.  All contributing project authors may
7*d9f75844SAndroid Build Coastguard Worker# be found in the AUTHORS file in the root of the source tree.
8*d9f75844SAndroid Build Coastguard Worker
9*d9f75844SAndroid Build Coastguard Workerimport("../../webrtc.gni")
10*d9f75844SAndroid Build Coastguard Worker
11*d9f75844SAndroid Build Coastguard Workerrtc_library("emulated_network") {
12*d9f75844SAndroid Build Coastguard Worker  visibility = [
13*d9f75844SAndroid Build Coastguard Worker    ":*",
14*d9f75844SAndroid Build Coastguard Worker    "../../api:create_network_emulation_manager",
15*d9f75844SAndroid Build Coastguard Worker    "../../api/test/network_emulation:create_cross_traffic",
16*d9f75844SAndroid Build Coastguard Worker  ]
17*d9f75844SAndroid Build Coastguard Worker  if (rtc_include_tests) {
18*d9f75844SAndroid Build Coastguard Worker    visibility += [
19*d9f75844SAndroid Build Coastguard Worker      "../peer_scenario:*",
20*d9f75844SAndroid Build Coastguard Worker      "../scenario:*",
21*d9f75844SAndroid Build Coastguard Worker    ]
22*d9f75844SAndroid Build Coastguard Worker  }
23*d9f75844SAndroid Build Coastguard Worker  testonly = true
24*d9f75844SAndroid Build Coastguard Worker  sources = [
25*d9f75844SAndroid Build Coastguard Worker    "cross_traffic.cc",
26*d9f75844SAndroid Build Coastguard Worker    "cross_traffic.h",
27*d9f75844SAndroid Build Coastguard Worker    "emulated_network_manager.cc",
28*d9f75844SAndroid Build Coastguard Worker    "emulated_network_manager.h",
29*d9f75844SAndroid Build Coastguard Worker    "emulated_turn_server.cc",
30*d9f75844SAndroid Build Coastguard Worker    "emulated_turn_server.h",
31*d9f75844SAndroid Build Coastguard Worker    "fake_network_socket_server.cc",
32*d9f75844SAndroid Build Coastguard Worker    "fake_network_socket_server.h",
33*d9f75844SAndroid Build Coastguard Worker    "network_emulation.cc",
34*d9f75844SAndroid Build Coastguard Worker    "network_emulation.h",
35*d9f75844SAndroid Build Coastguard Worker    "network_emulation_manager.cc",
36*d9f75844SAndroid Build Coastguard Worker    "network_emulation_manager.h",
37*d9f75844SAndroid Build Coastguard Worker    "traffic_route.cc",
38*d9f75844SAndroid Build Coastguard Worker    "traffic_route.h",
39*d9f75844SAndroid Build Coastguard Worker  ]
40*d9f75844SAndroid Build Coastguard Worker  deps = [
41*d9f75844SAndroid Build Coastguard Worker    "../../api:array_view",
42*d9f75844SAndroid Build Coastguard Worker    "../../api:field_trials_view",
43*d9f75844SAndroid Build Coastguard Worker    "../../api:network_emulation_manager_api",
44*d9f75844SAndroid Build Coastguard Worker    "../../api:packet_socket_factory",
45*d9f75844SAndroid Build Coastguard Worker    "../../api:scoped_refptr",
46*d9f75844SAndroid Build Coastguard Worker    "../../api:sequence_checker",
47*d9f75844SAndroid Build Coastguard Worker    "../../api:simulated_network_api",
48*d9f75844SAndroid Build Coastguard Worker    "../../api:time_controller",
49*d9f75844SAndroid Build Coastguard Worker    "../../api/numerics",
50*d9f75844SAndroid Build Coastguard Worker    "../../api/task_queue:pending_task_safety_flag",
51*d9f75844SAndroid Build Coastguard Worker    "../../api/test/network_emulation",
52*d9f75844SAndroid Build Coastguard Worker    "../../api/transport:stun_types",
53*d9f75844SAndroid Build Coastguard Worker    "../../api/units:data_rate",
54*d9f75844SAndroid Build Coastguard Worker    "../../api/units:data_size",
55*d9f75844SAndroid Build Coastguard Worker    "../../api/units:time_delta",
56*d9f75844SAndroid Build Coastguard Worker    "../../api/units:timestamp",
57*d9f75844SAndroid Build Coastguard Worker    "../../call:simulated_network",
58*d9f75844SAndroid Build Coastguard Worker    "../../p2p:p2p_server_utils",
59*d9f75844SAndroid Build Coastguard Worker    "../../p2p:rtc_p2p",
60*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base",
61*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:copy_on_write_buffer",
62*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:ip_address",
63*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:logging",
64*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:macromagic",
65*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:network_constants",
66*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:random",
67*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:rtc_base_tests_utils",
68*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:rtc_event",
69*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:rtc_task_queue",
70*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:safe_minmax",
71*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:socket",
72*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:socket_address",
73*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:socket_server",
74*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:stringutils",
75*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:task_queue_for_test",
76*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:threading",
77*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base/memory:always_valid_pointer",
78*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base/synchronization:mutex",
79*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base/system:no_unique_address",
80*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base/task_utils:repeating_task",
81*d9f75844SAndroid Build Coastguard Worker    "../../system_wrappers",
82*d9f75844SAndroid Build Coastguard Worker    "../../test:scoped_key_value_config",
83*d9f75844SAndroid Build Coastguard Worker    "../scenario:column_printer",
84*d9f75844SAndroid Build Coastguard Worker    "../time_controller",
85*d9f75844SAndroid Build Coastguard Worker  ]
86*d9f75844SAndroid Build Coastguard Worker  absl_deps = [
87*d9f75844SAndroid Build Coastguard Worker    "//third_party/abseil-cpp/absl/algorithm:container",
88*d9f75844SAndroid Build Coastguard Worker    "//third_party/abseil-cpp/absl/memory",
89*d9f75844SAndroid Build Coastguard Worker    "//third_party/abseil-cpp/absl/strings",
90*d9f75844SAndroid Build Coastguard Worker    "//third_party/abseil-cpp/absl/types:optional",
91*d9f75844SAndroid Build Coastguard Worker  ]
92*d9f75844SAndroid Build Coastguard Worker}
93*d9f75844SAndroid Build Coastguard Worker
94*d9f75844SAndroid Build Coastguard Workerrtc_library("network_emulation_unittest") {
95*d9f75844SAndroid Build Coastguard Worker  testonly = true
96*d9f75844SAndroid Build Coastguard Worker  sources = [ "network_emulation_unittest.cc" ]
97*d9f75844SAndroid Build Coastguard Worker  deps = [
98*d9f75844SAndroid Build Coastguard Worker    ":emulated_network",
99*d9f75844SAndroid Build Coastguard Worker    "../:test_support",
100*d9f75844SAndroid Build Coastguard Worker    "../../api:simulated_network_api",
101*d9f75844SAndroid Build Coastguard Worker    "../../api/units:time_delta",
102*d9f75844SAndroid Build Coastguard Worker    "../../call:simulated_network",
103*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:gunit_helpers",
104*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:logging",
105*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:rtc_event",
106*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:task_queue_for_test",
107*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base/synchronization:mutex",
108*d9f75844SAndroid Build Coastguard Worker  ]
109*d9f75844SAndroid Build Coastguard Worker}
110*d9f75844SAndroid Build Coastguard Worker
111*d9f75844SAndroid Build Coastguard Workerif (rtc_include_tests && !build_with_chromium) {
112*d9f75844SAndroid Build Coastguard Worker  rtc_library("network_emulation_pc_unittest") {
113*d9f75844SAndroid Build Coastguard Worker    testonly = true
114*d9f75844SAndroid Build Coastguard Worker    sources = [ "network_emulation_pc_unittest.cc" ]
115*d9f75844SAndroid Build Coastguard Worker    deps = [
116*d9f75844SAndroid Build Coastguard Worker      ":emulated_network",
117*d9f75844SAndroid Build Coastguard Worker      "../:test_support",
118*d9f75844SAndroid Build Coastguard Worker      "../../api:callfactory_api",
119*d9f75844SAndroid Build Coastguard Worker      "../../api:libjingle_peerconnection_api",
120*d9f75844SAndroid Build Coastguard Worker      "../../api:scoped_refptr",
121*d9f75844SAndroid Build Coastguard Worker      "../../api:simulated_network_api",
122*d9f75844SAndroid Build Coastguard Worker      "../../api/rtc_event_log:rtc_event_log_factory",
123*d9f75844SAndroid Build Coastguard Worker      "../../api/task_queue:default_task_queue_factory",
124*d9f75844SAndroid Build Coastguard Worker      "../../api/transport:field_trial_based_config",
125*d9f75844SAndroid Build Coastguard Worker      "../../call:simulated_network",
126*d9f75844SAndroid Build Coastguard Worker      "../../media:rtc_audio_video",
127*d9f75844SAndroid Build Coastguard Worker      "../../media:rtc_media_engine_defaults",
128*d9f75844SAndroid Build Coastguard Worker      "../../modules/audio_device:audio_device_impl",
129*d9f75844SAndroid Build Coastguard Worker      "../../p2p:rtc_p2p",
130*d9f75844SAndroid Build Coastguard Worker      "../../pc:pc_test_utils",
131*d9f75844SAndroid Build Coastguard Worker      "../../pc:peerconnection_wrapper",
132*d9f75844SAndroid Build Coastguard Worker      "../../rtc_base",
133*d9f75844SAndroid Build Coastguard Worker      "../../rtc_base:gunit_helpers",
134*d9f75844SAndroid Build Coastguard Worker      "../../rtc_base:logging",
135*d9f75844SAndroid Build Coastguard Worker      "../../rtc_base:rtc_event",
136*d9f75844SAndroid Build Coastguard Worker      "../../rtc_base:task_queue_for_test",
137*d9f75844SAndroid Build Coastguard Worker    ]
138*d9f75844SAndroid Build Coastguard Worker  }
139*d9f75844SAndroid Build Coastguard Worker}
140*d9f75844SAndroid Build Coastguard Worker
141*d9f75844SAndroid Build Coastguard Workerrtc_library("cross_traffic_unittest") {
142*d9f75844SAndroid Build Coastguard Worker  testonly = true
143*d9f75844SAndroid Build Coastguard Worker  sources = [ "cross_traffic_unittest.cc" ]
144*d9f75844SAndroid Build Coastguard Worker  deps = [
145*d9f75844SAndroid Build Coastguard Worker    ":emulated_network",
146*d9f75844SAndroid Build Coastguard Worker    "../:test_support",
147*d9f75844SAndroid Build Coastguard Worker    "../../api:network_emulation_manager_api",
148*d9f75844SAndroid Build Coastguard Worker    "../../api:simulated_network_api",
149*d9f75844SAndroid Build Coastguard Worker    "../../call:simulated_network",
150*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base",
151*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:logging",
152*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:network_constants",
153*d9f75844SAndroid Build Coastguard Worker    "../../rtc_base:rtc_event",
154*d9f75844SAndroid Build Coastguard Worker    "../time_controller",
155*d9f75844SAndroid Build Coastguard Worker  ]
156*d9f75844SAndroid Build Coastguard Worker  absl_deps = [
157*d9f75844SAndroid Build Coastguard Worker    "//third_party/abseil-cpp/absl/memory",
158*d9f75844SAndroid Build Coastguard Worker    "//third_party/abseil-cpp/absl/types:optional",
159*d9f75844SAndroid Build Coastguard Worker  ]
160*d9f75844SAndroid Build Coastguard Worker}
161*d9f75844SAndroid Build Coastguard Worker
162*d9f75844SAndroid Build Coastguard Workerif (rtc_include_tests) {
163*d9f75844SAndroid Build Coastguard Worker  rtc_library("feedback_generator") {
164*d9f75844SAndroid Build Coastguard Worker    testonly = true
165*d9f75844SAndroid Build Coastguard Worker    sources = [
166*d9f75844SAndroid Build Coastguard Worker      "feedback_generator.cc",
167*d9f75844SAndroid Build Coastguard Worker      "feedback_generator.h",
168*d9f75844SAndroid Build Coastguard Worker    ]
169*d9f75844SAndroid Build Coastguard Worker    deps = [
170*d9f75844SAndroid Build Coastguard Worker      ":emulated_network",
171*d9f75844SAndroid Build Coastguard Worker      "../../api/transport:network_control",
172*d9f75844SAndroid Build Coastguard Worker      "../../api/transport:test_feedback_generator_interface",
173*d9f75844SAndroid Build Coastguard Worker      "../../call:simulated_network",
174*d9f75844SAndroid Build Coastguard Worker      "../../rtc_base:checks",
175*d9f75844SAndroid Build Coastguard Worker      "../time_controller",
176*d9f75844SAndroid Build Coastguard Worker    ]
177*d9f75844SAndroid Build Coastguard Worker    absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
178*d9f75844SAndroid Build Coastguard Worker  }
179*d9f75844SAndroid Build Coastguard Worker
180*d9f75844SAndroid Build Coastguard Worker  rtc_library("feedback_generator_unittest") {
181*d9f75844SAndroid Build Coastguard Worker    testonly = true
182*d9f75844SAndroid Build Coastguard Worker    sources = [ "feedback_generator_unittest.cc" ]
183*d9f75844SAndroid Build Coastguard Worker    deps = [
184*d9f75844SAndroid Build Coastguard Worker      "../:test_support",
185*d9f75844SAndroid Build Coastguard Worker      "../../api/transport:test_feedback_generator",
186*d9f75844SAndroid Build Coastguard Worker    ]
187*d9f75844SAndroid Build Coastguard Worker  }
188*d9f75844SAndroid Build Coastguard Worker
189*d9f75844SAndroid Build Coastguard Worker  if (!build_with_chromium) {
190*d9f75844SAndroid Build Coastguard Worker    rtc_library("network_emulation_unittests") {
191*d9f75844SAndroid Build Coastguard Worker      testonly = true
192*d9f75844SAndroid Build Coastguard Worker      deps = [
193*d9f75844SAndroid Build Coastguard Worker        ":cross_traffic_unittest",
194*d9f75844SAndroid Build Coastguard Worker        ":feedback_generator_unittest",
195*d9f75844SAndroid Build Coastguard Worker        ":network_emulation_pc_unittest",
196*d9f75844SAndroid Build Coastguard Worker        ":network_emulation_unittest",
197*d9f75844SAndroid Build Coastguard Worker      ]
198*d9f75844SAndroid Build Coastguard Worker    }
199*d9f75844SAndroid Build Coastguard Worker  }
200*d9f75844SAndroid Build Coastguard Worker}
201