diff --git a/BUILD.gn b/BUILD.gn index 28ad562887..23ce0f07b3 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -497,7 +497,7 @@ if (rtc_include_tests) { "rtc_base/task_utils:to_queued_task_unittests", "sdk:sdk_tests", "test:test_main", - "test/scenario/network:network_emulation_unittests", + "test/network:network_emulation_unittests", ] if (rtc_enable_protobuf) { diff --git a/api/BUILD.gn b/api/BUILD.gn index 2ca55c7fd0..01d79ea9a8 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -345,7 +345,7 @@ if (rtc_include_tests) { ] deps = [ ":network_emulation_manager_api", - "../test/scenario/network:emulated_network", + "../test/network:emulated_network", "//third_party/abseil-cpp/absl/memory", ] } diff --git a/api/test/create_network_emulation_manager.cc b/api/test/create_network_emulation_manager.cc index 677f19ceca..7a9cb04686 100644 --- a/api/test/create_network_emulation_manager.cc +++ b/api/test/create_network_emulation_manager.cc @@ -12,7 +12,7 @@ #include "api/test/create_network_emulation_manager.h" #include "absl/memory/memory.h" -#include "test/scenario/network/network_emulation_manager.h" +#include "test/network/network_emulation_manager.h" namespace webrtc { diff --git a/api/transport/BUILD.gn b/api/transport/BUILD.gn index 03a779e653..07605308ec 100644 --- a/api/transport/BUILD.gn +++ b/api/transport/BUILD.gn @@ -105,7 +105,7 @@ if (rtc_include_tests) { deps = [ ":network_control", ":test_feedback_generator_interface", - "../../test/scenario/network:feedback_generator", + "../../test/network:feedback_generator", "//third_party/abseil-cpp/absl/memory", ] } diff --git a/api/transport/test/create_feedback_generator.cc b/api/transport/test/create_feedback_generator.cc index 873a79aba1..9eb54ea61a 100644 --- a/api/transport/test/create_feedback_generator.cc +++ b/api/transport/test/create_feedback_generator.cc @@ -11,7 +11,7 @@ #include "absl/memory/memory.h" -#include "test/scenario/network/feedback_generator.h" +#include "test/network/feedback_generator.h" namespace webrtc { diff --git a/test/network/BUILD.gn b/test/network/BUILD.gn new file mode 100644 index 0000000000..c8f14ddb73 --- /dev/null +++ b/test/network/BUILD.gn @@ -0,0 +1,158 @@ +# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +import("../../webrtc.gni") + +rtc_source_set("emulated_network") { + visibility = [ + "../../api:create_network_emulation_manager", + ":*", + ] + if (rtc_include_tests) { + visibility += [ "../scenario" ] + } + testonly = true + sources = [ + "cross_traffic.cc", + "cross_traffic.h", + "emulated_network_manager.cc", + "emulated_network_manager.h", + "fake_network_socket.cc", + "fake_network_socket.h", + "fake_network_socket_server.cc", + "fake_network_socket_server.h", + "network_emulation.cc", + "network_emulation.h", + "network_emulation_manager.cc", + "network_emulation_manager.h", + "traffic_route.cc", + "traffic_route.h", + ] + deps = [ + "../../api:network_emulation_manager_api", + "../../api:simulated_network_api", + "../../api/units:data_rate", + "../../api/units:data_size", + "../../api/units:time_delta", + "../../api/units:timestamp", + "../../rtc_base", + "../../rtc_base:rtc_base_tests_utils", + "../../rtc_base:rtc_task_queue", + "../../rtc_base:safe_minmax", + "../../rtc_base:task_queue_for_test", + "../../rtc_base/synchronization:sequence_checker", + "../../rtc_base/task_utils:repeating_task", + "../../rtc_base/third_party/sigslot", + "../../system_wrappers", + "../scenario:column_printer", + "../time_controller", + "//third_party/abseil-cpp/absl/memory", + "//third_party/abseil-cpp/absl/types:optional", + ] +} + +rtc_source_set("network_emulation_unittest") { + testonly = true + sources = [ + "network_emulation_unittest.cc", + ] + deps = [ + ":emulated_network", + "../:test_support", + "../../api:simulated_network_api", + "../../api/units:time_delta", + "../../call:simulated_network", + "../../rtc_base:gunit_helpers", + "../../rtc_base:logging", + "../../rtc_base:rtc_event", + "../../system_wrappers:system_wrappers", + "//third_party/abseil-cpp/absl/memory", + ] +} + +rtc_source_set("network_emulation_pc_unittest") { + testonly = true + sources = [ + "network_emulation_pc_unittest.cc", + ] + deps = [ + ":emulated_network", + "../:test_support", + "../../api:callfactory_api", + "../../api:libjingle_peerconnection_api", + "../../api:scoped_refptr", + "../../api:simulated_network_api", + "../../api/rtc_event_log:rtc_event_log_factory", + "../../api/task_queue:default_task_queue_factory", + "../../call:simulated_network", + "../../media:rtc_audio_video", + "../../media:rtc_media_engine_defaults", + "../../modules/audio_device:audio_device_impl", + "../../p2p:rtc_p2p", + "../../pc:pc_test_utils", + "../../pc:peerconnection_wrapper", + "../../rtc_base", + "../../rtc_base:gunit_helpers", + "../../rtc_base:logging", + "../../rtc_base:rtc_event", + "//third_party/abseil-cpp/absl/memory", + ] +} + +rtc_source_set("cross_traffic_unittest") { + testonly = true + sources = [ + "cross_traffic_unittest.cc", + ] + deps = [ + ":emulated_network", + "../:test_support", + "../../api:simulated_network_api", + "../../call:simulated_network", + "../../rtc_base:logging", + "../../rtc_base:rtc_event", + "//third_party/abseil-cpp/absl/memory", + ] +} + +rtc_source_set("feedback_generator") { + testonly = true + sources = [ + "feedback_generator.cc", + "feedback_generator.h", + ] + deps = [ + ":emulated_network", + "../../api/transport:test_feedback_generator_interface", + "../../call:simulated_network", + "../../rtc_base:checks", + "../time_controller", + "//third_party/abseil-cpp/absl/memory", + ] +} + +rtc_source_set("feedback_generator_unittest") { + testonly = true + sources = [ + "feedback_generator_unittest.cc", + ] + deps = [ + "../:test_support", + "../../api/transport:test_feedback_generator", + ] +} + +rtc_source_set("network_emulation_unittests") { + testonly = true + deps = [ + ":cross_traffic_unittest", + ":feedback_generator_unittest", + ":network_emulation_pc_unittest", + ":network_emulation_unittest", + ] +} diff --git a/test/network/OWNERS b/test/network/OWNERS new file mode 100644 index 0000000000..b177c4eec5 --- /dev/null +++ b/test/network/OWNERS @@ -0,0 +1 @@ +titovartem@webrtc.org diff --git a/test/scenario/network/cross_traffic.cc b/test/network/cross_traffic.cc similarity index 99% rename from test/scenario/network/cross_traffic.cc rename to test/network/cross_traffic.cc index 105ad48076..7f64d53258 100644 --- a/test/scenario/network/cross_traffic.cc +++ b/test/network/cross_traffic.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "test/scenario/network/cross_traffic.h" +#include "test/network/cross_traffic.h" #include #include diff --git a/test/scenario/network/cross_traffic.h b/test/network/cross_traffic.h similarity index 95% rename from test/scenario/network/cross_traffic.h rename to test/network/cross_traffic.h index 29625b8d3b..6a01a4e07e 100644 --- a/test/scenario/network/cross_traffic.h +++ b/test/network/cross_traffic.h @@ -8,9 +8,11 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef TEST_SCENARIO_NETWORK_CROSS_TRAFFIC_H_ -#define TEST_SCENARIO_NETWORK_CROSS_TRAFFIC_H_ +#ifndef TEST_NETWORK_CROSS_TRAFFIC_H_ +#define TEST_NETWORK_CROSS_TRAFFIC_H_ +#include +#include #include #include "api/units/data_rate.h" @@ -19,8 +21,8 @@ #include "api/units/timestamp.h" #include "rtc_base/random.h" #include "rtc_base/synchronization/sequence_checker.h" +#include "test/network/traffic_route.h" #include "test/scenario/column_printer.h" -#include "test/scenario/network/traffic_route.h" namespace webrtc { namespace test { @@ -130,4 +132,4 @@ class FakeTcpCrossTraffic } // namespace test } // namespace webrtc -#endif // TEST_SCENARIO_NETWORK_CROSS_TRAFFIC_H_ +#endif // TEST_NETWORK_CROSS_TRAFFIC_H_ diff --git a/test/scenario/network/cross_traffic_unittest.cc b/test/network/cross_traffic_unittest.cc similarity index 98% rename from test/scenario/network/cross_traffic_unittest.cc rename to test/network/cross_traffic_unittest.cc index 4bff27277a..cc20d6c41d 100644 --- a/test/scenario/network/cross_traffic_unittest.cc +++ b/test/network/cross_traffic_unittest.cc @@ -20,7 +20,7 @@ #include "rtc_base/logging.h" #include "test/gmock.h" #include "test/gtest.h" -#include "test/scenario/network/cross_traffic.h" +#include "test/network/cross_traffic.h" namespace webrtc { namespace test { diff --git a/test/scenario/network/emulated_network_manager.cc b/test/network/emulated_network_manager.cc similarity index 98% rename from test/scenario/network/emulated_network_manager.cc rename to test/network/emulated_network_manager.cc index 5ee9c1654f..5367a803a0 100644 --- a/test/scenario/network/emulated_network_manager.cc +++ b/test/network/emulated_network_manager.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "test/scenario/network/emulated_network_manager.h" +#include "test/network/emulated_network_manager.h" #include #include diff --git a/test/scenario/network/emulated_network_manager.h b/test/network/emulated_network_manager.h similarity index 87% rename from test/scenario/network/emulated_network_manager.h rename to test/network/emulated_network_manager.h index 7f941a46ab..4e50e662da 100644 --- a/test/scenario/network/emulated_network_manager.h +++ b/test/network/emulated_network_manager.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef TEST_SCENARIO_NETWORK_EMULATED_NETWORK_MANAGER_H_ -#define TEST_SCENARIO_NETWORK_EMULATED_NETWORK_MANAGER_H_ +#ifndef TEST_NETWORK_EMULATED_NETWORK_MANAGER_H_ +#define TEST_NETWORK_EMULATED_NETWORK_MANAGER_H_ #include #include @@ -21,8 +21,8 @@ #include "rtc_base/socket_server.h" #include "rtc_base/thread.h" #include "rtc_base/thread_checker.h" -#include "test/scenario/network/fake_network_socket_server.h" -#include "test/scenario/network/network_emulation.h" +#include "test/network/fake_network_socket_server.h" +#include "test/network/network_emulation.h" namespace webrtc { namespace test { @@ -66,4 +66,4 @@ class EmulatedNetworkManager : public rtc::NetworkManagerBase, } // namespace test } // namespace webrtc -#endif // TEST_SCENARIO_NETWORK_EMULATED_NETWORK_MANAGER_H_ +#endif // TEST_NETWORK_EMULATED_NETWORK_MANAGER_H_ diff --git a/test/scenario/network/fake_network_socket.cc b/test/network/fake_network_socket.cc similarity index 99% rename from test/scenario/network/fake_network_socket.cc rename to test/network/fake_network_socket.cc index 59699f5700..d514afe206 100644 --- a/test/scenario/network/fake_network_socket.cc +++ b/test/network/fake_network_socket.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "test/scenario/network/fake_network_socket.h" +#include "test/network/fake_network_socket.h" #include #include diff --git a/test/scenario/network/fake_network_socket.h b/test/network/fake_network_socket.h similarity index 93% rename from test/scenario/network/fake_network_socket.h rename to test/network/fake_network_socket.h index 26013d95dd..1715f1e4d6 100644 --- a/test/scenario/network/fake_network_socket.h +++ b/test/network/fake_network_socket.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef TEST_SCENARIO_NETWORK_FAKE_NETWORK_SOCKET_H_ -#define TEST_SCENARIO_NETWORK_FAKE_NETWORK_SOCKET_H_ +#ifndef TEST_NETWORK_FAKE_NETWORK_SOCKET_H_ +#define TEST_NETWORK_FAKE_NETWORK_SOCKET_H_ #include #include @@ -19,7 +19,7 @@ #include "rtc_base/copy_on_write_buffer.h" #include "rtc_base/critical_section.h" #include "rtc_base/socket_address.h" -#include "test/scenario/network/network_emulation.h" +#include "test/network/network_emulation.h" namespace webrtc { namespace test { @@ -102,4 +102,4 @@ class FakeNetworkSocket : public rtc::AsyncSocket, } // namespace test } // namespace webrtc -#endif // TEST_SCENARIO_NETWORK_FAKE_NETWORK_SOCKET_H_ +#endif // TEST_NETWORK_FAKE_NETWORK_SOCKET_H_ diff --git a/test/scenario/network/fake_network_socket_server.cc b/test/network/fake_network_socket_server.cc similarity index 97% rename from test/scenario/network/fake_network_socket_server.cc rename to test/network/fake_network_socket_server.cc index 407f760c67..df082dd348 100644 --- a/test/scenario/network/fake_network_socket_server.cc +++ b/test/network/fake_network_socket_server.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "test/scenario/network/fake_network_socket_server.h" +#include "test/network/fake_network_socket_server.h" #include #include "rtc_base/thread.h" diff --git a/test/scenario/network/fake_network_socket_server.h b/test/network/fake_network_socket_server.h similarity index 90% rename from test/scenario/network/fake_network_socket_server.h rename to test/network/fake_network_socket_server.h index d36b8f08cd..2597779e82 100644 --- a/test/scenario/network/fake_network_socket_server.h +++ b/test/network/fake_network_socket_server.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef TEST_SCENARIO_NETWORK_FAKE_NETWORK_SOCKET_SERVER_H_ -#define TEST_SCENARIO_NETWORK_FAKE_NETWORK_SOCKET_SERVER_H_ +#ifndef TEST_NETWORK_FAKE_NETWORK_SOCKET_SERVER_H_ +#define TEST_NETWORK_FAKE_NETWORK_SOCKET_SERVER_H_ #include #include @@ -24,7 +24,7 @@ #include "rtc_base/socket_server.h" #include "rtc_base/third_party/sigslot/sigslot.h" #include "system_wrappers/include/clock.h" -#include "test/scenario/network/fake_network_socket.h" +#include "test/network/fake_network_socket.h" namespace webrtc { namespace test { @@ -68,4 +68,4 @@ class FakeNetworkSocketServer : public rtc::SocketServer, } // namespace test } // namespace webrtc -#endif // TEST_SCENARIO_NETWORK_FAKE_NETWORK_SOCKET_SERVER_H_ +#endif // TEST_NETWORK_FAKE_NETWORK_SOCKET_SERVER_H_ diff --git a/test/scenario/network/feedback_generator.cc b/test/network/feedback_generator.cc similarity index 98% rename from test/scenario/network/feedback_generator.cc rename to test/network/feedback_generator.cc index 9512c47f4f..27b769034c 100644 --- a/test/scenario/network/feedback_generator.cc +++ b/test/network/feedback_generator.cc @@ -7,7 +7,7 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "test/scenario/network/feedback_generator.h" +#include "test/network/feedback_generator.h" #include "absl/memory/memory.h" #include "rtc_base/checks.h" diff --git a/test/scenario/network/feedback_generator.h b/test/network/feedback_generator.h similarity index 86% rename from test/scenario/network/feedback_generator.h rename to test/network/feedback_generator.h index 094ada55fc..a2c4909c8a 100644 --- a/test/scenario/network/feedback_generator.h +++ b/test/network/feedback_generator.h @@ -7,8 +7,8 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#ifndef TEST_SCENARIO_NETWORK_FEEDBACK_GENERATOR_H_ -#define TEST_SCENARIO_NETWORK_FEEDBACK_GENERATOR_H_ +#ifndef TEST_NETWORK_FEEDBACK_GENERATOR_H_ +#define TEST_NETWORK_FEEDBACK_GENERATOR_H_ #include #include @@ -16,8 +16,8 @@ #include "api/transport/test/feedback_generator_interface.h" #include "call/simulated_network.h" -#include "test/scenario/network/network_emulation.h" -#include "test/scenario/network/network_emulation_manager.h" +#include "test/network/network_emulation.h" +#include "test/network/network_emulation_manager.h" #include "test/time_controller/simulated_time_controller.h" namespace webrtc { @@ -54,4 +54,4 @@ class FeedbackGeneratorImpl std::vector feedback_; }; } // namespace webrtc -#endif // TEST_SCENARIO_NETWORK_FEEDBACK_GENERATOR_H_ +#endif // TEST_NETWORK_FEEDBACK_GENERATOR_H_ diff --git a/test/scenario/network/feedback_generator_unittest.cc b/test/network/feedback_generator_unittest.cc similarity index 100% rename from test/scenario/network/feedback_generator_unittest.cc rename to test/network/feedback_generator_unittest.cc diff --git a/test/scenario/network/network_emulation.cc b/test/network/network_emulation.cc similarity index 99% rename from test/scenario/network/network_emulation.cc rename to test/network/network_emulation.cc index cb611e2f09..8a1948661d 100644 --- a/test/scenario/network/network_emulation.cc +++ b/test/network/network_emulation.cc @@ -8,8 +8,9 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "test/scenario/network/network_emulation.h" +#include "test/network/network_emulation.h" +#include #include #include @@ -24,10 +25,7 @@ EmulatedIpPacket::EmulatedIpPacket(const rtc::SocketAddress& from, const rtc::SocketAddress& to, rtc::CopyOnWriteBuffer data, Timestamp arrival_time) - : from(from), - to(to), - data(data), - arrival_time(arrival_time) {} + : from(from), to(to), data(data), arrival_time(arrival_time) {} void LinkEmulation::OnPacketReceived(EmulatedIpPacket packet) { struct Closure { diff --git a/test/scenario/network/network_emulation.h b/test/network/network_emulation.h similarity index 98% rename from test/scenario/network/network_emulation.h rename to test/network/network_emulation.h index ff8444bf7e..24e2fd9098 100644 --- a/test/scenario/network/network_emulation.h +++ b/test/network/network_emulation.h @@ -8,10 +8,11 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef TEST_SCENARIO_NETWORK_NETWORK_EMULATION_H_ -#define TEST_SCENARIO_NETWORK_NETWORK_EMULATION_H_ +#ifndef TEST_NETWORK_NETWORK_EMULATION_H_ +#define TEST_NETWORK_NETWORK_EMULATION_H_ #include +#include #include #include #include @@ -317,4 +318,4 @@ class TwoWayFakeTrafficRoute { }; } // namespace webrtc -#endif // TEST_SCENARIO_NETWORK_NETWORK_EMULATION_H_ +#endif // TEST_NETWORK_NETWORK_EMULATION_H_ diff --git a/test/scenario/network/network_emulation_manager.cc b/test/network/network_emulation_manager.cc similarity index 98% rename from test/scenario/network/network_emulation_manager.cc rename to test/network/network_emulation_manager.cc index 8900ec49c2..4ae7299ebd 100644 --- a/test/scenario/network/network_emulation_manager.cc +++ b/test/network/network_emulation_manager.cc @@ -8,8 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "test/scenario/network/network_emulation_manager.h" -#include "test/time_controller/real_time_controller.h" +#include "test/network/network_emulation_manager.h" #include #include @@ -18,6 +17,7 @@ #include "api/units/time_delta.h" #include "api/units/timestamp.h" #include "rtc_base/fake_network.h" +#include "test/time_controller/real_time_controller.h" namespace webrtc { namespace test { @@ -62,8 +62,7 @@ NetworkEmulationManagerImpl::NetworkEmulationManagerImpl( next_ip4_address_(kMinIPv4Address), task_queue_(time_controller->GetTaskQueueFactory()->CreateTaskQueue( "NetworkEmulation", - TaskQueueFactory::Priority::NORMAL)) { -} + TaskQueueFactory::Priority::NORMAL)) {} // TODO(srte): Ensure that any pending task that must be run for consistency // (such as stats collection tasks) are not cancelled when the task queue is diff --git a/test/scenario/network/network_emulation_manager.h b/test/network/network_emulation_manager.h similarity index 89% rename from test/scenario/network/network_emulation_manager.h rename to test/network/network_emulation_manager.h index a10eca733e..c860362b92 100644 --- a/test/scenario/network/network_emulation_manager.h +++ b/test/network/network_emulation_manager.h @@ -8,10 +8,12 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef TEST_SCENARIO_NETWORK_NETWORK_EMULATION_MANAGER_H_ -#define TEST_SCENARIO_NETWORK_NETWORK_EMULATION_MANAGER_H_ +#ifndef TEST_NETWORK_NETWORK_EMULATION_MANAGER_H_ +#define TEST_NETWORK_NETWORK_EMULATION_MANAGER_H_ +#include #include +#include #include #include @@ -25,11 +27,11 @@ #include "rtc_base/task_utils/repeating_task.h" #include "rtc_base/thread.h" #include "system_wrappers/include/clock.h" -#include "test/scenario/network/cross_traffic.h" -#include "test/scenario/network/emulated_network_manager.h" -#include "test/scenario/network/fake_network_socket_server.h" -#include "test/scenario/network/network_emulation.h" -#include "test/scenario/network/traffic_route.h" +#include "test/network/cross_traffic.h" +#include "test/network/emulated_network_manager.h" +#include "test/network/fake_network_socket_server.h" +#include "test/network/network_emulation.h" +#include "test/network/traffic_route.h" #include "test/time_controller/time_controller.h" namespace webrtc { @@ -106,4 +108,4 @@ class NetworkEmulationManagerImpl : public NetworkEmulationManager { } // namespace test } // namespace webrtc -#endif // TEST_SCENARIO_NETWORK_NETWORK_EMULATION_MANAGER_H_ +#endif // TEST_NETWORK_NETWORK_EMULATION_MANAGER_H_ diff --git a/test/scenario/network/network_emulation_pc_unittest.cc b/test/network/network_emulation_pc_unittest.cc similarity index 98% rename from test/scenario/network/network_emulation_pc_unittest.cc rename to test/network/network_emulation_pc_unittest.cc index f9769bbc04..6c83a9960c 100644 --- a/test/scenario/network/network_emulation_pc_unittest.cc +++ b/test/network/network_emulation_pc_unittest.cc @@ -27,8 +27,8 @@ #include "rtc_base/gunit.h" #include "test/gmock.h" #include "test/gtest.h" -#include "test/scenario/network/network_emulation.h" -#include "test/scenario/network/network_emulation_manager.h" +#include "test/network/network_emulation.h" +#include "test/network/network_emulation_manager.h" namespace webrtc { namespace test { diff --git a/test/scenario/network/network_emulation_unittest.cc b/test/network/network_emulation_unittest.cc similarity index 99% rename from test/scenario/network/network_emulation_unittest.cc rename to test/network/network_emulation_unittest.cc index e965dbcdb9..26b1b37010 100644 --- a/test/scenario/network/network_emulation_unittest.cc +++ b/test/network/network_emulation_unittest.cc @@ -10,6 +10,7 @@ #include #include +#include #include "absl/memory/memory.h" #include "api/test/simulated_network.h" @@ -21,8 +22,8 @@ #include "system_wrappers/include/sleep.h" #include "test/gmock.h" #include "test/gtest.h" -#include "test/scenario/network/network_emulation.h" -#include "test/scenario/network/network_emulation_manager.h" +#include "test/network/network_emulation.h" +#include "test/network/network_emulation_manager.h" namespace webrtc { namespace test { diff --git a/test/scenario/network/traffic_route.cc b/test/network/traffic_route.cc similarity index 98% rename from test/scenario/network/traffic_route.cc rename to test/network/traffic_route.cc index 7ede034a1c..6bd453517f 100644 --- a/test/scenario/network/traffic_route.cc +++ b/test/network/traffic_route.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "test/scenario/network/traffic_route.h" +#include "test/network/traffic_route.h" #include diff --git a/test/scenario/network/traffic_route.h b/test/network/traffic_route.h similarity index 89% rename from test/scenario/network/traffic_route.h rename to test/network/traffic_route.h index 1f138f4773..1bb34c6b6c 100644 --- a/test/scenario/network/traffic_route.h +++ b/test/network/traffic_route.h @@ -8,15 +8,15 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef TEST_SCENARIO_NETWORK_TRAFFIC_ROUTE_H_ -#define TEST_SCENARIO_NETWORK_TRAFFIC_ROUTE_H_ +#ifndef TEST_NETWORK_TRAFFIC_ROUTE_H_ +#define TEST_NETWORK_TRAFFIC_ROUTE_H_ #include #include #include "rtc_base/copy_on_write_buffer.h" #include "system_wrappers/include/clock.h" -#include "test/scenario/network/network_emulation.h" +#include "test/network/network_emulation.h" namespace webrtc { namespace test { @@ -52,4 +52,4 @@ class TrafficRoute { } // namespace test } // namespace webrtc -#endif // TEST_SCENARIO_NETWORK_TRAFFIC_ROUTE_H_ +#endif // TEST_NETWORK_TRAFFIC_ROUTE_H_ diff --git a/test/scenario/BUILD.gn b/test/scenario/BUILD.gn index b8b4e77130..eac3ba805d 100644 --- a/test/scenario/BUILD.gn +++ b/test/scenario/BUILD.gn @@ -138,8 +138,8 @@ if (rtc_include_tests) { "../../system_wrappers:field_trial", "../../video", "../logging:log_writer", + "../network:emulated_network", "../time_controller", - "network:emulated_network", "//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/types:optional", ] diff --git a/test/scenario/call_client.h b/test/scenario/call_client.h index e863e602f6..b71f406193 100644 --- a/test/scenario/call_client.h +++ b/test/scenario/call_client.h @@ -24,8 +24,8 @@ #include "rtc_base/constructor_magic.h" #include "rtc_base/task_queue_for_test.h" #include "test/logging/log_writer.h" +#include "test/network/network_emulation.h" #include "test/scenario/column_printer.h" -#include "test/scenario/network/network_emulation.h" #include "test/scenario/network_node.h" #include "test/scenario/scenario_config.h" #include "test/time_controller/time_controller.h" diff --git a/test/scenario/network/BUILD.gn b/test/scenario/network/BUILD.gn deleted file mode 100644 index 339e441303..0000000000 --- a/test/scenario/network/BUILD.gn +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. -# -# Use of this source code is governed by a BSD-style license -# that can be found in the LICENSE file in the root of the source -# tree. An additional intellectual property rights grant can be found -# in the file PATENTS. All contributing project authors may -# be found in the AUTHORS file in the root of the source tree. - -import("../../../webrtc.gni") - -rtc_source_set("emulated_network") { - visibility = [ - "../../../api:create_network_emulation_manager", - ":*", - ] - if (rtc_include_tests) { - visibility += [ "../:scenario" ] - } - testonly = true - sources = [ - "cross_traffic.cc", - "cross_traffic.h", - "emulated_network_manager.cc", - "emulated_network_manager.h", - "fake_network_socket.cc", - "fake_network_socket.h", - "fake_network_socket_server.cc", - "fake_network_socket_server.h", - "network_emulation.cc", - "network_emulation.h", - "network_emulation_manager.cc", - "network_emulation_manager.h", - "traffic_route.cc", - "traffic_route.h", - ] - deps = [ - "../:column_printer", - "../../../api:network_emulation_manager_api", - "../../../api:simulated_network_api", - "../../../api/units:data_rate", - "../../../api/units:data_size", - "../../../api/units:time_delta", - "../../../api/units:timestamp", - "../../../rtc_base", - "../../../rtc_base:rtc_base_tests_utils", - "../../../rtc_base:rtc_task_queue", - "../../../rtc_base:safe_minmax", - "../../../rtc_base:task_queue_for_test", - "../../../rtc_base/synchronization:sequence_checker", - "../../../rtc_base/task_utils:repeating_task", - "../../../rtc_base/third_party/sigslot", - "../../../system_wrappers", - "../../time_controller", - "//third_party/abseil-cpp/absl/memory", - "//third_party/abseil-cpp/absl/types:optional", - ] -} - -rtc_source_set("network_emulation_unittest") { - testonly = true - sources = [ - "network_emulation_unittest.cc", - ] - deps = [ - ":emulated_network", - "../../../api:simulated_network_api", - "../../../api/units:time_delta", - "../../../call:simulated_network", - "../../../rtc_base:gunit_helpers", - "../../../rtc_base:logging", - "../../../rtc_base:rtc_event", - "../../../system_wrappers:system_wrappers", - "../../../test:test_support", - "//third_party/abseil-cpp/absl/memory", - ] -} - -rtc_source_set("network_emulation_pc_unittest") { - testonly = true - sources = [ - "network_emulation_pc_unittest.cc", - ] - deps = [ - ":emulated_network", - "../../../api:callfactory_api", - "../../../api:libjingle_peerconnection_api", - "../../../api:scoped_refptr", - "../../../api:simulated_network_api", - "../../../api/rtc_event_log:rtc_event_log_factory", - "../../../api/task_queue:default_task_queue_factory", - "../../../call:simulated_network", - "../../../media:rtc_audio_video", - "../../../media:rtc_media_engine_defaults", - "../../../modules/audio_device:audio_device_impl", - "../../../p2p:rtc_p2p", - "../../../pc:pc_test_utils", - "../../../pc:peerconnection_wrapper", - "../../../rtc_base", - "../../../rtc_base:gunit_helpers", - "../../../rtc_base:logging", - "../../../rtc_base:rtc_event", - "../../../test:test_support", - "//third_party/abseil-cpp/absl/memory", - ] -} - -rtc_source_set("cross_traffic_unittest") { - testonly = true - sources = [ - "cross_traffic_unittest.cc", - ] - deps = [ - ":emulated_network", - "../../../api:simulated_network_api", - "../../../call:simulated_network", - "../../../rtc_base:logging", - "../../../rtc_base:rtc_event", - "../../../test:test_support", - "//third_party/abseil-cpp/absl/memory", - ] -} - -rtc_source_set("feedback_generator") { - testonly = true - sources = [ - "feedback_generator.cc", - "feedback_generator.h", - ] - deps = [ - "../../../api/transport:test_feedback_generator_interface", - "../../../call:simulated_network", - "../../../rtc_base:checks", - "../../../test/scenario/network:emulated_network", - "../../../test/time_controller", - "//third_party/abseil-cpp/absl/memory", - ] -} - -rtc_source_set("feedback_generator_unittest") { - testonly = true - sources = [ - "feedback_generator_unittest.cc", - ] - deps = [ - "../../../api/transport:test_feedback_generator", - "../../../test:test_support", - ] -} - -rtc_source_set("network_emulation_unittests") { - testonly = true - deps = [ - ":cross_traffic_unittest", - ":feedback_generator_unittest", - ":network_emulation_pc_unittest", - ":network_emulation_unittest", - ] -} diff --git a/test/scenario/network_node.h b/test/scenario/network_node.h index 5dcfa527f0..bab045db92 100644 --- a/test/scenario/network_node.h +++ b/test/scenario/network_node.h @@ -23,8 +23,8 @@ #include "rtc_base/constructor_magic.h" #include "rtc_base/copy_on_write_buffer.h" #include "rtc_base/task_queue.h" +#include "test/network/network_emulation.h" #include "test/scenario/column_printer.h" -#include "test/scenario/network/network_emulation.h" #include "test/scenario/scenario_config.h" namespace webrtc { diff --git a/test/scenario/scenario.cc b/test/scenario/scenario.cc index 1845577fd2..9e6105b939 100644 --- a/test/scenario/scenario.cc +++ b/test/scenario/scenario.cc @@ -17,7 +17,7 @@ #include "rtc_base/flags.h" #include "rtc_base/socket_address.h" #include "test/logging/file_log_writer.h" -#include "test/scenario/network/network_emulation.h" +#include "test/network/network_emulation.h" #include "test/testsupport/file_utils.h" #include "test/time_controller/real_time_controller.h" #include "test/time_controller/simulated_time_controller.h" diff --git a/test/scenario/scenario.h b/test/scenario/scenario.h index c4e672ed41..fc4fcedb10 100644 --- a/test/scenario/scenario.h +++ b/test/scenario/scenario.h @@ -20,10 +20,10 @@ #include "rtc_base/task_queue.h" #include "rtc_base/task_utils/repeating_task.h" #include "test/logging/log_writer.h" +#include "test/network/network_emulation_manager.h" #include "test/scenario/audio_stream.h" #include "test/scenario/call_client.h" #include "test/scenario/column_printer.h" -#include "test/scenario/network/network_emulation_manager.h" #include "test/scenario/network_node.h" #include "test/scenario/scenario_config.h" #include "test/scenario/video_stream.h"