Move call/simulated_network to test/network
Old target and call/simulated.h exist but refer to new target in test/network.
Bug: webrtc:14525
Change-Id: Ida04cef17913f2f829d7e925ae454dc40d5e8240
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349264
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42191}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index 152f2cb..3a99738 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -865,7 +865,7 @@
":peer_network_dependencies",
":simulated_network_api",
":time_controller",
- "../call:simulated_network",
+ "..//test/network:simulated_network",
"../rtc_base:checks",
"../rtc_base:network",
"../rtc_base:network_constants",
diff --git a/api/test/network_emulation_manager.cc b/api/test/network_emulation_manager.cc
index 07676ea..f2153a7 100644
--- a/api/test/network_emulation_manager.cc
+++ b/api/test/network_emulation_manager.cc
@@ -11,8 +11,8 @@
#include <utility>
-#include "call/simulated_network.h"
#include "rtc_base/checks.h"
+#include "test/network/simulated_network.h"
namespace webrtc {
diff --git a/audio/BUILD.gn b/audio/BUILD.gn
index ef5ec3d..f48b0bc 100644
--- a/audio/BUILD.gn
+++ b/audio/BUILD.gn
@@ -134,7 +134,6 @@
"../api/audio:audio_device",
"../api/task_queue",
"../call:fake_network",
- "../call:simulated_network",
"../modules/audio_device:test_audio_device_module",
"../system_wrappers",
"../test:test_common",
diff --git a/audio/test/audio_end_to_end_test.cc b/audio/test/audio_end_to_end_test.cc
index b1e2712..769d7d3 100644
--- a/audio/test/audio_end_to_end_test.cc
+++ b/audio/test/audio_end_to_end_test.cc
@@ -15,7 +15,6 @@
#include "api/task_queue/task_queue_base.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "modules/audio_device/include/test_audio_device.h"
#include "system_wrappers/include/sleep.h"
#include "test/gtest.h"
diff --git a/call/BUILD.gn b/call/BUILD.gn
index 00fa602..8d5c3ef 100644
--- a/call/BUILD.gn
+++ b/call/BUILD.gn
@@ -336,6 +336,7 @@
"../system_wrappers",
"../system_wrappers:field_trial",
"../system_wrappers:metrics",
+ "../test/network:simulated_network",
"../video",
"../video:decode_synchronizer",
"../video/config:encoder_config",
@@ -399,24 +400,9 @@
}
rtc_library("simulated_network") {
- sources = [
- "simulated_network.cc",
- "simulated_network.h",
- ]
- deps = [
- "../api:sequence_checker",
- "../api:simulated_network_api",
- "../api/units:data_rate",
- "../api/units:data_size",
- "../api/units:time_delta",
- "../api/units:timestamp",
- "../rtc_base:checks",
- "../rtc_base:macromagic",
- "../rtc_base:race_checker",
- "../rtc_base:random",
- "../rtc_base/synchronization:mutex",
- ]
- absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
+ # TODO(bugs.webrtc.org/14525): Remove target and directly depend on test/network:simulated_network.
+ sources = [ "simulated_network.h" ]
+ deps = [ "../test/network:simulated_network" ]
}
rtc_source_set("simulated_packet_receiver") {
@@ -434,7 +420,6 @@
]
deps = [
":call_interfaces",
- ":simulated_network",
":simulated_packet_receiver",
"../api:rtp_parameters",
"../api:sequence_checker",
@@ -447,6 +432,7 @@
"../rtc_base:macromagic",
"../rtc_base/synchronization:mutex",
"../system_wrappers",
+ "../test/network:simulated_network",
]
}
@@ -606,6 +592,7 @@
"../test:test_support",
"../test:video_test_common",
"../test:video_test_constants",
+ "../test/network:simulated_network",
"../video",
"../video/config:encoder_config",
"//testing/gtest",
@@ -663,13 +650,9 @@
rtc_library("fake_network_pipe_unittests") {
testonly = true
- sources = [
- "fake_network_pipe_unittest.cc",
- "simulated_network_unittest.cc",
- ]
+ sources = [ "fake_network_pipe_unittest.cc" ]
deps = [
":fake_network",
- ":simulated_network",
"../api:simulated_network_api",
"../api/units:data_rate",
"../api/units:time_delta",
@@ -678,6 +661,7 @@
"../rtc_base:checks",
"../system_wrappers",
"../test:test_support",
+ "../test/network:simulated_network",
"//testing/gtest",
]
absl_deps = [ "//third_party/abseil-cpp/absl/algorithm:container" ]
diff --git a/call/DEPS b/call/DEPS
index b1b66ac..236b37e 100644
--- a/call/DEPS
+++ b/call/DEPS
@@ -28,5 +28,9 @@
],
"call_perf_tests\.cc": [
"+media/engine",
+ ],
+ "simulated_network\.h": [
+ "+test/network/simulated_network.h",
]
+
}
diff --git a/call/bitrate_estimator_tests.cc b/call/bitrate_estimator_tests.cc
index d945dfcc..2ffba5d 100644
--- a/call/bitrate_estimator_tests.cc
+++ b/call/bitrate_estimator_tests.cc
@@ -16,7 +16,6 @@
#include "absl/strings/string_view.h"
#include "api/test/create_frame_generator.h"
#include "call/call.h"
-#include "call/simulated_network.h"
#include "rtc_base/checks.h"
#include "rtc_base/event.h"
#include "rtc_base/logging.h"
diff --git a/call/call_perf_tests.cc b/call/call_perf_tests.cc
index dfdfec8..e1d0d4c 100644
--- a/call/call_perf_tests.cc
+++ b/call/call_perf_tests.cc
@@ -29,7 +29,6 @@
#include "api/video_codecs/video_encoder.h"
#include "call/call.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "media/engine/internal_encoder_factory.h"
#include "media/engine/simulcast_encoder_adapter.h"
#include "modules/audio_coding/include/audio_coding_module.h"
@@ -51,6 +50,7 @@
#include "test/field_trial.h"
#include "test/frame_generator_capturer.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/null_transport.h"
#include "test/rtp_rtcp_observer.h"
#include "test/test_flags.h"
diff --git a/call/degraded_call.h b/call/degraded_call.h
index b345ba9..2a158bd 100644
--- a/call/degraded_call.h
+++ b/call/degraded_call.h
@@ -34,12 +34,12 @@
#include "call/flexfec_receive_stream.h"
#include "call/packet_receiver.h"
#include "call/rtp_transport_controller_send_interface.h"
-#include "call/simulated_network.h"
#include "call/video_receive_stream.h"
#include "call/video_send_stream.h"
#include "rtc_base/copy_on_write_buffer.h"
#include "rtc_base/network/sent_packet.h"
#include "system_wrappers/include/clock.h"
+#include "test/network/simulated_network.h"
#include "video/config/video_encoder_config.h"
namespace webrtc {
diff --git a/call/fake_network_pipe_unittest.cc b/call/fake_network_pipe_unittest.cc
index 31f97fc..800d5a8 100644
--- a/call/fake_network_pipe_unittest.cc
+++ b/call/fake_network_pipe_unittest.cc
@@ -15,7 +15,6 @@
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
-#include "call/simulated_network.h"
#include "modules/rtp_rtcp/include/rtp_header_extension_map.h"
#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
@@ -23,6 +22,7 @@
#include "system_wrappers/include/clock.h"
#include "test/gmock.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
using ::testing::_;
using ::testing::Property;
diff --git a/call/rampup_tests.h b/call/rampup_tests.h
index ba9989d..e09986d 100644
--- a/call/rampup_tests.h
+++ b/call/rampup_tests.h
@@ -23,7 +23,6 @@
#include "api/test/metrics/metric.h"
#include "api/test/simulated_network.h"
#include "call/call.h"
-#include "call/simulated_network.h"
#include "rtc_base/event.h"
#include "rtc_base/task_utils/repeating_task.h"
#include "test/call_test.h"
diff --git a/call/simulated_network.h b/call/simulated_network.h
index 02a37a3..5003e37 100644
--- a/call/simulated_network.h
+++ b/call/simulated_network.h
@@ -10,125 +10,8 @@
#ifndef CALL_SIMULATED_NETWORK_H_
#define CALL_SIMULATED_NETWORK_H_
-#include <stdint.h>
-
-#include <deque>
-#include <queue>
-#include <vector>
-
-#include "absl/types/optional.h"
-#include "api/sequence_checker.h"
-#include "api/test/simulated_network.h"
-#include "api/units/data_size.h"
-#include "api/units/timestamp.h"
-#include "rtc_base/race_checker.h"
-#include "rtc_base/random.h"
-#include "rtc_base/synchronization/mutex.h"
-#include "rtc_base/thread_annotations.h"
-
-namespace webrtc {
-
-// Class simulating a network link.
-//
-// This is a basic implementation of NetworkBehaviorInterface that supports:
-// - Packet loss
-// - Capacity delay
-// - Extra delay with or without packets reorder
-// - Packet overhead
-// - Queue max capacity
-class RTC_EXPORT SimulatedNetwork : public SimulatedNetworkInterface {
- public:
- using Config = BuiltInNetworkBehaviorConfig;
- explicit SimulatedNetwork(Config config, uint64_t random_seed = 1);
- ~SimulatedNetwork() override;
-
- // Sets a new configuration. This will affect packets that will be sent with
- // EnqueuePacket but also packets in the network that have not left the
- // network emulation. Packets that are ready to be retrieved by
- // DequeueDeliverablePackets are not affected by the new configuration.
- // TODO(bugs.webrtc.org/14525): Fix SetConfig and make it apply only to the
- // part of the packet that is currently being sent (instead of applying to
- // all of it).
- void SetConfig(const Config& config) override;
- void UpdateConfig(std::function<void(BuiltInNetworkBehaviorConfig*)>
- config_modifier) override;
- void PauseTransmissionUntil(int64_t until_us) override;
-
- // NetworkBehaviorInterface
- bool EnqueuePacket(PacketInFlightInfo packet) override;
- std::vector<PacketDeliveryInfo> DequeueDeliverablePackets(
- int64_t receive_time_us) override;
-
- absl::optional<int64_t> NextDeliveryTimeUs() const override;
-
- private:
- struct PacketInfo {
- PacketInFlightInfo packet;
- // Time when the packet has left (or will leave) the network.
- int64_t arrival_time_us;
- };
- // Contains current configuration state.
- struct ConfigState {
- // Static link configuration.
- Config config;
- // The probability to drop the packet if we are currently dropping a
- // burst of packet
- double prob_loss_bursting;
- // The probability to drop a burst of packets.
- double prob_start_bursting;
- // Used for temporary delay spikes.
- int64_t pause_transmission_until_us = 0;
- };
-
- // Moves packets from capacity- to delay link.
- void UpdateCapacityQueue(ConfigState state, int64_t time_now_us)
- RTC_RUN_ON(&process_checker_);
- ConfigState GetConfigState() const;
-
- mutable Mutex config_lock_;
-
- // Guards the data structures involved in delay and loss processing, such as
- // the packet queues.
- rtc::RaceChecker process_checker_;
- // Models the capacity of the network by rejecting packets if the queue is
- // full and keeping them in the queue until they are ready to exit (according
- // to the link capacity, which cannot be violated, e.g. a 1 kbps link will
- // only be able to deliver 1000 bits per second).
- //
- // Invariant:
- // The head of the `capacity_link_` has arrival_time_us correctly set to the
- // time when the packet is supposed to be delivered (without accounting
- // potential packet loss or potential extra delay and without accounting for a
- // new configuration of the network, which requires a re-computation of the
- // arrival_time_us).
- std::queue<PacketInfo> capacity_link_ RTC_GUARDED_BY(process_checker_);
- // Models the extra delay of the network (see `queue_delay_ms`
- // and `delay_standard_deviation_ms` in BuiltInNetworkBehaviorConfig), packets
- // in the `delay_link_` have technically already left the network and don't
- // use its capacity but they are not delivered yet.
- std::deque<PacketInfo> delay_link_ RTC_GUARDED_BY(process_checker_);
- // Represents the next moment in time when the network is supposed to deliver
- // packets to the client (either by pulling them from `delay_link_` or
- // `capacity_link_` or both).
- absl::optional<int64_t> next_process_time_us_
- RTC_GUARDED_BY(process_checker_);
-
- ConfigState config_state_ RTC_GUARDED_BY(config_lock_);
-
- Random random_ RTC_GUARDED_BY(process_checker_);
- // Are we currently dropping a burst of packets?
- bool bursting_;
-
- // The send time of the last enqueued packet, this is only used to check that
- // the send time of enqueued packets is monotonically increasing.
- int64_t last_enqueue_time_us_;
-
- // The last time a packet left the capacity_link_ (used to enforce
- // the capacity of the link and avoid packets starts to get sent before
- // the link it free).
- int64_t last_capacity_link_exit_time_;
-};
-
-} // namespace webrtc
+// TODO(bugs.webrtc.org/14525): Remove once downstream projects does not use
+// it.
+#include "test/network/simulated_network.h"
#endif // CALL_SIMULATED_NETWORK_H_
diff --git a/net/dcsctp/socket/BUILD.gn b/net/dcsctp/socket/BUILD.gn
index 406593e..7af8063 100644
--- a/net/dcsctp/socket/BUILD.gn
+++ b/net/dcsctp/socket/BUILD.gn
@@ -236,7 +236,6 @@
"../../../api/task_queue",
"../../../api/task_queue:pending_task_safety_flag",
"../../../api/units:time_delta",
- "../../../call:simulated_network",
"../../../rtc_base:checks",
"../../../rtc_base:copy_on_write_buffer",
"../../../rtc_base:gunit_helpers",
diff --git a/net/dcsctp/socket/dcsctp_socket_network_test.cc b/net/dcsctp/socket/dcsctp_socket_network_test.cc
index f73ecce..d9d9720 100644
--- a/net/dcsctp/socket/dcsctp_socket_network_test.cc
+++ b/net/dcsctp/socket/dcsctp_socket_network_test.cc
@@ -23,7 +23,6 @@
#include "api/test/create_network_emulation_manager.h"
#include "api/test/network_emulation_manager.h"
#include "api/units/time_delta.h"
-#include "call/simulated_network.h"
#include "net/dcsctp/public/dcsctp_options.h"
#include "net/dcsctp/public/dcsctp_socket.h"
#include "net/dcsctp/public/types.h"
diff --git a/pc/BUILD.gn b/pc/BUILD.gn
index 18063ae..9c62915 100644
--- a/pc/BUILD.gn
+++ b/pc/BUILD.gn
@@ -2833,6 +2833,7 @@
sources = [ "test/svc_e2e_tests.cc" ]
data = svc_tests_resources
deps = [
+ "..//test/network:simulated_network",
"../api:create_network_emulation_manager",
"../api:create_peer_connection_quality_test_frame_generator",
"../api:create_peerconnection_quality_test_fixture",
@@ -2848,7 +2849,6 @@
"../api/test/pclf:media_quality_test_params",
"../api/test/pclf:peer_configurer",
"../api/video_codecs:video_codecs_api",
- "../call:simulated_network",
"../modules/video_coding:webrtc_vp9",
"../modules/video_coding/svc:scalability_mode_util",
"../rtc_base/containers:flat_map",
diff --git a/pc/test/svc_e2e_tests.cc b/pc/test/svc_e2e_tests.cc
index 678c36b..1f1a41f 100644
--- a/pc/test/svc_e2e_tests.cc
+++ b/pc/test/svc_e2e_tests.cc
@@ -27,7 +27,6 @@
#include "api/test/simulated_network.h"
#include "api/test/time_controller.h"
#include "api/video_codecs/vp9_profile.h"
-#include "call/simulated_network.h"
#include "modules/video_coding/codecs/vp9/include/vp9.h"
#include "modules/video_coding/svc/scalability_mode_util.h"
#include "rtc_base/containers/flat_map.h"
@@ -35,6 +34,7 @@
#include "test/field_trial.h"
#include "test/gmock.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/pc/e2e/analyzer/video/default_video_quality_analyzer.h"
#include "test/pc/e2e/network_quality_metrics_reporter.h"
#include "test/testsupport/file_utils.h"
diff --git a/rtc_tools/BUILD.gn b/rtc_tools/BUILD.gn
index fa0ab39..35f36be 100644
--- a/rtc_tools/BUILD.gn
+++ b/rtc_tools/BUILD.gn
@@ -201,6 +201,7 @@
"..//api/video_codecs:video_encoder_factory_template_libvpx_vp8_adapter",
"..//api/video_codecs:video_encoder_factory_template_libvpx_vp9_adapter",
"..//api/video_codecs:video_encoder_factory_template_open_h264_adapter",
+ "..//test/network:simulated_network",
"../api:create_frame_generator",
"../api:rtp_parameters",
"../api:transport_api",
@@ -213,7 +214,6 @@
"../call:fake_network",
"../call:rtp_interfaces",
"../call:rtp_sender",
- "../call:simulated_network",
"../call:simulated_packet_receiver",
"../call:video_stream_api",
"../media:media_constants",
diff --git a/test/BUILD.gn b/test/BUILD.gn
index 783e94a..aeb5146 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -1266,6 +1266,7 @@
":test_video_capturer",
":video_test_common",
":video_test_constants",
+ "..//test/network:simulated_network",
"../api:array_view",
"../api:create_frame_generator",
"../api:frame_generator_api",
@@ -1290,7 +1291,6 @@
"../call",
"../call:call_interfaces",
"../call:fake_network",
- "../call:simulated_network",
"../call:simulated_packet_receiver",
"../call:video_stream_api",
"../modules/audio_device:test_audio_device_module",
diff --git a/test/call_test.cc b/test/call_test.cc
index cb2c0f0..734571a 100644
--- a/test/call_test.cc
+++ b/test/call_test.cc
@@ -23,13 +23,13 @@
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "call/fake_network_pipe.h"
#include "call/packet_receiver.h"
-#include "call/simulated_network.h"
#include "modules/audio_device/include/test_audio_device.h"
#include "modules/audio_mixer/audio_mixer_impl.h"
#include "rtc_base/checks.h"
#include "rtc_base/event.h"
#include "rtc_base/task_queue_for_test.h"
#include "test/fake_encoder.h"
+#include "test/network/simulated_network.h"
#include "test/rtp_rtcp_observer.h"
#include "test/testsupport/file_utils.h"
#include "test/video_test_constants.h"
diff --git a/test/network/BUILD.gn b/test/network/BUILD.gn
index e9bd263..36459b1 100644
--- a/test/network/BUILD.gn
+++ b/test/network/BUILD.gn
@@ -38,6 +38,7 @@
"traffic_route.h",
]
deps = [
+ "../..//test/network:simulated_network",
"../../api:array_view",
"../../api:field_trials_view",
"../../api:network_emulation_manager_api",
@@ -55,7 +56,6 @@
"../../api/units:data_size",
"../../api/units:time_delta",
"../../api/units:timestamp",
- "../../call:simulated_network",
"../../p2p:basic_packet_socket_factory",
"../../p2p:p2p_server_utils",
"../../p2p:rtc_p2p",
@@ -101,9 +101,9 @@
deps = [
":emulated_network",
"../:test_support",
+ "../..//test/network:simulated_network",
"../../api:simulated_network_api",
"../../api/units:time_delta",
- "../../call:simulated_network",
"../../rtc_base:gunit_helpers",
"../../rtc_base:logging",
"../../rtc_base:rtc_event",
@@ -119,6 +119,7 @@
deps = [
":emulated_network",
"../:test_support",
+ "../..//test/network:simulated_network",
"../../api:enable_media_with_defaults",
"../../api:libjingle_peerconnection_api",
"../../api:scoped_refptr",
@@ -126,7 +127,6 @@
"../../api/rtc_event_log:rtc_event_log_factory",
"../../api/task_queue:default_task_queue_factory",
"../../api/transport:field_trial_based_config",
- "../../call:simulated_network",
"../../media:rtc_audio_video",
"../../modules/audio_device:test_audio_device_module",
"../../p2p:basic_packet_socket_factory",
@@ -148,9 +148,9 @@
deps = [
":emulated_network",
"../:test_support",
+ "../..//test/network:simulated_network",
"../../api:network_emulation_manager_api",
"../../api:simulated_network_api",
- "../../call:simulated_network",
"../../rtc_base:logging",
"../../rtc_base:network_constants",
"../../rtc_base:rtc_event",
@@ -171,9 +171,9 @@
]
deps = [
":emulated_network",
+ "../..//test/network:simulated_network",
"../../api/transport:network_control",
"../../api/transport:test_feedback_generator_interface",
- "../../call:simulated_network",
"../../rtc_base:checks",
"../time_controller",
]
@@ -197,7 +197,46 @@
":feedback_generator_unittest",
":network_emulation_pc_unittest",
":network_emulation_unittest",
+ ":simulated_network_unittest",
]
}
}
}
+
+rtc_library("simulated_network") {
+ sources = [
+ "simulated_network.cc",
+ "simulated_network.h",
+ ]
+ deps = [
+ "../../api:sequence_checker",
+ "../../api:simulated_network_api",
+ "../../api/units:data_rate",
+ "../../api/units:data_size",
+ "../../api/units:time_delta",
+ "../../api/units:timestamp",
+ "../../rtc_base:checks",
+ "../../rtc_base:macromagic",
+ "../../rtc_base:race_checker",
+ "../../rtc_base:random",
+ "../../rtc_base/synchronization:mutex",
+ ]
+ absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
+}
+
+if (rtc_include_tests) {
+ rtc_library("simulated_network_unittest") {
+ testonly = true
+ sources = [ "simulated_network_unittest.cc" ]
+ deps = [
+ ":simulated_network",
+ "../:test_support",
+ "../../api:simulated_network_api",
+ "../../api/units:data_rate",
+ "../../api/units:data_size",
+ "../../api/units:time_delta",
+ "//testing/gtest",
+ ]
+ absl_deps = [ "//third_party/abseil-cpp/absl/algorithm:container" ]
+ }
+}
diff --git a/test/network/cross_traffic_unittest.cc b/test/network/cross_traffic_unittest.cc
index 0f98fc9..e9412a7 100644
--- a/test/network/cross_traffic_unittest.cc
+++ b/test/network/cross_traffic_unittest.cc
@@ -19,13 +19,13 @@
#include "absl/types/optional.h"
#include "api/test/network_emulation_manager.h"
#include "api/test/simulated_network.h"
-#include "call/simulated_network.h"
#include "rtc_base/event.h"
#include "rtc_base/logging.h"
#include "rtc_base/network_constants.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/network/network_emulation_manager.h"
+#include "test/network/simulated_network.h"
#include "test/network/traffic_route.h"
#include "test/time_controller/simulated_time_controller.h"
diff --git a/test/network/feedback_generator.h b/test/network/feedback_generator.h
index ecd4597..5664b2b 100644
--- a/test/network/feedback_generator.h
+++ b/test/network/feedback_generator.h
@@ -17,9 +17,9 @@
#include "api/transport/network_types.h"
#include "api/transport/test/feedback_generator_interface.h"
-#include "call/simulated_network.h"
#include "test/network/network_emulation.h"
#include "test/network/network_emulation_manager.h"
+#include "test/network/simulated_network.h"
#include "test/time_controller/simulated_time_controller.h"
namespace webrtc {
diff --git a/test/network/network_emulation_manager.cc b/test/network/network_emulation_manager.cc
index dd0e93d..05a1a30 100644
--- a/test/network/network_emulation_manager.cc
+++ b/test/network/network_emulation_manager.cc
@@ -16,8 +16,8 @@
#include "api/field_trials_view.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
-#include "call/simulated_network.h"
#include "test/network/emulated_turn_server.h"
+#include "test/network/simulated_network.h"
#include "test/network/traffic_route.h"
#include "test/time_controller/real_time_controller.h"
#include "test/time_controller/simulated_time_controller.h"
diff --git a/test/network/network_emulation_pc_unittest.cc b/test/network/network_emulation_pc_unittest.cc
index 73ac54e..838749c 100644
--- a/test/network/network_emulation_pc_unittest.cc
+++ b/test/network/network_emulation_pc_unittest.cc
@@ -17,7 +17,6 @@
#include "api/scoped_refptr.h"
#include "api/task_queue/default_task_queue_factory.h"
#include "api/transport/field_trial_based_config.h"
-#include "call/simulated_network.h"
#include "media/engine/webrtc_media_engine.h"
#include "modules/audio_device/include/test_audio_device.h"
#include "p2p/base/basic_packet_socket_factory.h"
@@ -30,6 +29,7 @@
#include "test/gtest.h"
#include "test/network/network_emulation.h"
#include "test/network/network_emulation_manager.h"
+#include "test/network/simulated_network.h"
namespace webrtc {
namespace test {
diff --git a/test/network/network_emulation_unittest.cc b/test/network/network_emulation_unittest.cc
index 2e67a5a..69704ad 100644
--- a/test/network/network_emulation_unittest.cc
+++ b/test/network/network_emulation_unittest.cc
@@ -16,7 +16,6 @@
#include "api/test/simulated_network.h"
#include "api/units/time_delta.h"
-#include "call/simulated_network.h"
#include "rtc_base/event.h"
#include "rtc_base/gunit.h"
#include "rtc_base/synchronization/mutex.h"
@@ -24,6 +23,7 @@
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/network/network_emulation_manager.h"
+#include "test/network/simulated_network.h"
namespace webrtc {
namespace test {
diff --git a/call/simulated_network.cc b/test/network/simulated_network.cc
similarity index 99%
rename from call/simulated_network.cc
rename to test/network/simulated_network.cc
index 8f9d76d..776fccb 100644
--- a/call/simulated_network.cc
+++ b/test/network/simulated_network.cc
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "call/simulated_network.h"
+#include "test/network/simulated_network.h"
#include <algorithm>
#include <cmath>
diff --git a/test/network/simulated_network.h b/test/network/simulated_network.h
new file mode 100644
index 0000000..336bae8
--- /dev/null
+++ b/test/network/simulated_network.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright 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.
+ */
+#ifndef TEST_NETWORK_SIMULATED_NETWORK_H_
+#define TEST_NETWORK_SIMULATED_NETWORK_H_
+
+#include <stdint.h>
+
+#include <deque>
+#include <queue>
+#include <vector>
+
+#include "absl/types/optional.h"
+#include "api/sequence_checker.h"
+#include "api/test/simulated_network.h"
+#include "api/units/data_size.h"
+#include "api/units/timestamp.h"
+#include "rtc_base/race_checker.h"
+#include "rtc_base/random.h"
+#include "rtc_base/synchronization/mutex.h"
+#include "rtc_base/thread_annotations.h"
+
+namespace webrtc {
+
+// Class simulating a network link.
+//
+// This is a basic implementation of NetworkBehaviorInterface that supports:
+// - Packet loss
+// - Capacity delay
+// - Extra delay with or without packets reorder
+// - Packet overhead
+// - Queue max capacity
+class RTC_EXPORT SimulatedNetwork : public SimulatedNetworkInterface {
+ public:
+ using Config = BuiltInNetworkBehaviorConfig;
+ explicit SimulatedNetwork(Config config, uint64_t random_seed = 1);
+ ~SimulatedNetwork() override;
+
+ // Sets a new configuration. This will affect packets that will be sent with
+ // EnqueuePacket but also packets in the network that have not left the
+ // network emulation. Packets that are ready to be retrieved by
+ // DequeueDeliverablePackets are not affected by the new configuration.
+ // TODO(bugs.webrtc.org/14525): Fix SetConfig and make it apply only to the
+ // part of the packet that is currently being sent (instead of applying to
+ // all of it).
+ void SetConfig(const Config& config) override;
+ void UpdateConfig(std::function<void(BuiltInNetworkBehaviorConfig*)>
+ config_modifier) override;
+ void PauseTransmissionUntil(int64_t until_us) override;
+
+ // NetworkBehaviorInterface
+ bool EnqueuePacket(PacketInFlightInfo packet) override;
+ std::vector<PacketDeliveryInfo> DequeueDeliverablePackets(
+ int64_t receive_time_us) override;
+
+ absl::optional<int64_t> NextDeliveryTimeUs() const override;
+
+ private:
+ struct PacketInfo {
+ PacketInFlightInfo packet;
+ // Time when the packet has left (or will leave) the network.
+ int64_t arrival_time_us;
+ };
+ // Contains current configuration state.
+ struct ConfigState {
+ // Static link configuration.
+ Config config;
+ // The probability to drop the packet if we are currently dropping a
+ // burst of packet
+ double prob_loss_bursting;
+ // The probability to drop a burst of packets.
+ double prob_start_bursting;
+ // Used for temporary delay spikes.
+ int64_t pause_transmission_until_us = 0;
+ };
+
+ // Moves packets from capacity- to delay link.
+ void UpdateCapacityQueue(ConfigState state, int64_t time_now_us)
+ RTC_RUN_ON(&process_checker_);
+ ConfigState GetConfigState() const;
+
+ mutable Mutex config_lock_;
+
+ // Guards the data structures involved in delay and loss processing, such as
+ // the packet queues.
+ rtc::RaceChecker process_checker_;
+ // Models the capacity of the network by rejecting packets if the queue is
+ // full and keeping them in the queue until they are ready to exit (according
+ // to the link capacity, which cannot be violated, e.g. a 1 kbps link will
+ // only be able to deliver 1000 bits per second).
+ //
+ // Invariant:
+ // The head of the `capacity_link_` has arrival_time_us correctly set to the
+ // time when the packet is supposed to be delivered (without accounting
+ // potential packet loss or potential extra delay and without accounting for a
+ // new configuration of the network, which requires a re-computation of the
+ // arrival_time_us).
+ std::queue<PacketInfo> capacity_link_ RTC_GUARDED_BY(process_checker_);
+ // Models the extra delay of the network (see `queue_delay_ms`
+ // and `delay_standard_deviation_ms` in BuiltInNetworkBehaviorConfig), packets
+ // in the `delay_link_` have technically already left the network and don't
+ // use its capacity but they are not delivered yet.
+ std::deque<PacketInfo> delay_link_ RTC_GUARDED_BY(process_checker_);
+ // Represents the next moment in time when the network is supposed to deliver
+ // packets to the client (either by pulling them from `delay_link_` or
+ // `capacity_link_` or both).
+ absl::optional<int64_t> next_process_time_us_
+ RTC_GUARDED_BY(process_checker_);
+
+ ConfigState config_state_ RTC_GUARDED_BY(config_lock_);
+
+ Random random_ RTC_GUARDED_BY(process_checker_);
+ // Are we currently dropping a burst of packets?
+ bool bursting_;
+
+ // The send time of the last enqueued packet, this is only used to check that
+ // the send time of enqueued packets is monotonically increasing.
+ int64_t last_enqueue_time_us_;
+
+ // The last time a packet left the capacity_link_ (used to enforce
+ // the capacity of the link and avoid packets starts to get sent before
+ // the link it free).
+ int64_t last_capacity_link_exit_time_;
+};
+
+} // namespace webrtc
+
+#endif // TEST_NETWORK_SIMULATED_NETWORK_H_
diff --git a/call/simulated_network_unittest.cc b/test/network/simulated_network_unittest.cc
similarity index 99%
rename from call/simulated_network_unittest.cc
rename to test/network/simulated_network_unittest.cc
index 825dd6d..dcc3180 100644
--- a/call/simulated_network_unittest.cc
+++ b/test/network/simulated_network_unittest.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 "call/simulated_network.h"
+#include "test/network/simulated_network.h"
#include <algorithm>
#include <map>
diff --git a/test/pc/e2e/BUILD.gn b/test/pc/e2e/BUILD.gn
index c4cc0e1..c285514 100644
--- a/test/pc/e2e/BUILD.gn
+++ b/test/pc/e2e/BUILD.gn
@@ -287,6 +287,7 @@
":default_audio_quality_analyzer",
":network_quality_metrics_reporter",
":stats_based_network_quality_metrics_reporter",
+ "../../..//test/network:simulated_network",
"../../../api:create_network_emulation_manager",
"../../../api:create_peer_connection_quality_test_frame_generator",
"../../../api:create_peerconnection_quality_test_fixture",
@@ -304,7 +305,6 @@
"../../../api/test/pclf:peer_configurer",
"../../../api/video_codecs:builtin_video_decoder_factory",
"../../../api/video_codecs:builtin_video_encoder_factory",
- "../../../call:simulated_network",
"../../../media:rtc_audio_video",
"../../../modules/audio_device:audio_device_impl",
"../../../p2p:rtc_p2p",
diff --git a/test/pc/e2e/peer_connection_e2e_smoke_test.cc b/test/pc/e2e/peer_connection_e2e_smoke_test.cc
index 018e6ae..2478289 100644
--- a/test/pc/e2e/peer_connection_e2e_smoke_test.cc
+++ b/test/pc/e2e/peer_connection_e2e_smoke_test.cc
@@ -22,10 +22,10 @@
#include "api/test/pclf/media_quality_test_params.h"
#include "api/test/pclf/peer_configurer.h"
#include "api/test/peerconnection_quality_test_fixture.h"
-#include "call/simulated_network.h"
#include "system_wrappers/include/field_trial.h"
#include "test/field_trial.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.h"
#include "test/pc/e2e/analyzer/video/default_video_quality_analyzer.h"
#include "test/pc/e2e/analyzer/video/default_video_quality_analyzer_shared_objects.h"
diff --git a/test/scenario/BUILD.gn b/test/scenario/BUILD.gn
index 33bd3d8..b8d4a91 100644
--- a/test/scenario/BUILD.gn
+++ b/test/scenario/BUILD.gn
@@ -77,6 +77,7 @@
"../:test_common",
"../:test_support",
"../:video_test_common",
+ "../..//test/network:simulated_network",
"../../api:array_view",
"../../api:create_frame_generator",
"../../api:fec_controller_api",
@@ -110,7 +111,6 @@
"../../call",
"../../call:call_interfaces",
"../../call:rtp_sender",
- "../../call:simulated_network",
"../../call:video_stream_api",
"../../common_video",
"../../media:media_constants",
diff --git a/test/scenario/network_node.h b/test/scenario/network_node.h
index 614dc13..790a7dc 100644
--- a/test/scenario/network_node.h
+++ b/test/scenario/network_node.h
@@ -19,10 +19,10 @@
#include "api/call/transport.h"
#include "api/units/timestamp.h"
#include "call/call.h"
-#include "call/simulated_network.h"
#include "rtc_base/copy_on_write_buffer.h"
#include "rtc_base/synchronization/mutex.h"
#include "test/network/network_emulation.h"
+#include "test/network/simulated_network.h"
#include "test/scenario/column_printer.h"
#include "test/scenario/scenario_config.h"
diff --git a/video/BUILD.gn b/video/BUILD.gn
index 2f25d3a..c6c6730 100644
--- a/video/BUILD.gn
+++ b/video/BUILD.gn
@@ -513,6 +513,7 @@
]
deps = [
":frame_dumping_decoder",
+ "..//test/network:simulated_network",
"../api:create_frame_generator",
"../api:fec_controller_api",
"../api:frame_generator_api",
@@ -534,7 +535,6 @@
"../api/video:video_rtp_headers",
"../api/video_codecs:video_codecs_api",
"../call:fake_network",
- "../call:simulated_network",
"../common_video",
"../media:media_constants",
"../media:rtc_audio_video",
@@ -623,6 +623,7 @@
sources = [ "pc_full_stack_tests.cc" ]
deps = [
+ "..//test/network:simulated_network",
"../api:create_network_emulation_manager",
"../api:create_peer_connection_quality_test_frame_generator",
"../api:create_peerconnection_quality_test_fixture",
@@ -637,7 +638,6 @@
"../api/test/pclf:media_quality_test_params",
"../api/test/pclf:peer_configurer",
"../api/video_codecs:video_codecs_api",
- "../call:simulated_network",
"../modules/video_coding:webrtc_vp9",
"../system_wrappers:field_trial",
"../test:field_trial",
@@ -820,6 +820,7 @@
":video_stream_buffer_controller",
":video_stream_encoder_impl",
":video_stream_encoder_interface",
+ "..//test/network:simulated_network",
"../api:array_view",
"../api:bitrate_allocation",
"../api:create_frame_generator",
@@ -879,7 +880,6 @@
"../call:rtp_interfaces",
"../call:rtp_receiver",
"../call:rtp_sender",
- "../call:simulated_network",
"../call:simulated_packet_receiver",
"../call:video_stream_api",
"../call/adaptation:resource_adaptation",
diff --git a/video/end_to_end_tests/bandwidth_tests.cc b/video/end_to_end_tests/bandwidth_tests.cc
index 7dd7556..0dee93c 100644
--- a/video/end_to_end_tests/bandwidth_tests.cc
+++ b/video/end_to_end_tests/bandwidth_tests.cc
@@ -16,7 +16,6 @@
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video/video_bitrate_allocation.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "modules/rtp_rtcp/source/rtp_rtcp_impl2.h"
#include "rtc_base/rate_limiter.h"
#include "rtc_base/synchronization/mutex.h"
@@ -26,6 +25,7 @@
#include "test/fake_encoder.h"
#include "test/field_trial.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/rtcp_packet_parser.h"
#include "test/rtp_rtcp_observer.h"
#include "test/video_encoder_proxy_factory.h"
diff --git a/video/end_to_end_tests/call_operation_tests.cc b/video/end_to_end_tests/call_operation_tests.cc
index 4a8490b..fe965f2 100644
--- a/video/end_to_end_tests/call_operation_tests.cc
+++ b/video/end_to_end_tests/call_operation_tests.cc
@@ -14,13 +14,13 @@
#include "api/test/frame_generator_interface.h"
#include "api/test/simulated_network.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "rtc_base/task_queue_for_test.h"
#include "system_wrappers/include/sleep.h"
#include "test/call_test.h"
#include "test/field_trial.h"
#include "test/frame_forwarder.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/null_transport.h"
#include "test/video_test_constants.h"
diff --git a/video/end_to_end_tests/extended_reports_tests.cc b/video/end_to_end_tests/extended_reports_tests.cc
index e481282..ae29b9c 100644
--- a/video/end_to_end_tests/extended_reports_tests.cc
+++ b/video/end_to_end_tests/extended_reports_tests.cc
@@ -24,7 +24,6 @@
#include "call/call.h"
#include "call/fake_network_pipe.h"
#include "call/rtp_config.h"
-#include "call/simulated_network.h"
#include "call/simulated_packet_receiver.h"
#include "call/video_receive_stream.h"
#include "call/video_send_stream.h"
@@ -37,6 +36,7 @@
#include "test/call_test.h"
#include "test/field_trial.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/rtcp_packet_parser.h"
#include "test/rtp_rtcp_observer.h"
#include "test/video_test_constants.h"
diff --git a/video/end_to_end_tests/fec_tests.cc b/video/end_to_end_tests/fec_tests.cc
index 879f22d..457c0da 100644
--- a/video/end_to_end_tests/fec_tests.cc
+++ b/video/end_to_end_tests/fec_tests.cc
@@ -14,7 +14,6 @@
#include "api/test/simulated_network.h"
#include "api/test/video/function_video_encoder_factory.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "media/engine/internal_decoder_factory.h"
#include "modules/include/module_common_types_public.h"
#include "modules/rtp_rtcp/source/byte_io.h"
@@ -25,6 +24,7 @@
#include "test/field_trial.h"
#include "test/gmock.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/rtcp_packet_parser.h"
#include "test/video_test_constants.h"
diff --git a/video/end_to_end_tests/multi_codec_receive_tests.cc b/video/end_to_end_tests/multi_codec_receive_tests.cc
index 55641ac..fe223af 100644
--- a/video/end_to_end_tests/multi_codec_receive_tests.cc
+++ b/video/end_to_end_tests/multi_codec_receive_tests.cc
@@ -13,7 +13,6 @@
#include "api/test/simulated_network.h"
#include "api/test/video/function_video_encoder_factory.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "modules/include/module_common_types_public.h"
#include "modules/rtp_rtcp/source/rtp_packet.h"
#include "modules/video_coding/codecs/h264/include/h264.h"
@@ -24,6 +23,7 @@
#include "test/call_test.h"
#include "test/gmock.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/video_test_constants.h"
using ::testing::Contains;
diff --git a/video/end_to_end_tests/multi_stream_tester.cc b/video/end_to_end_tests/multi_stream_tester.cc
index f22b68b..9fe3433 100644
--- a/video/end_to_end_tests/multi_stream_tester.cc
+++ b/video/end_to_end_tests/multi_stream_tester.cc
@@ -22,12 +22,12 @@
#include "api/test/video/function_video_encoder_factory.h"
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "media/engine/internal_decoder_factory.h"
#include "modules/video_coding/codecs/vp8/include/vp8.h"
#include "rtc_base/task_queue_for_test.h"
#include "test/call_test.h"
#include "test/encoder_settings.h"
+#include "test/network/simulated_network.h"
#include "test/video_test_constants.h"
namespace webrtc {
diff --git a/video/end_to_end_tests/network_state_tests.cc b/video/end_to_end_tests/network_state_tests.cc
index a80c5e2..c0532a3 100644
--- a/video/end_to_end_tests/network_state_tests.cc
+++ b/video/end_to_end_tests/network_state_tests.cc
@@ -17,7 +17,6 @@
#include "api/test/simulated_network.h"
#include "api/video_codecs/video_encoder.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "modules/rtp_rtcp/source/rtp_packet.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/task_queue_for_test.h"
@@ -25,6 +24,7 @@
#include "test/call_test.h"
#include "test/fake_encoder.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/video_encoder_proxy_factory.h"
namespace webrtc {
diff --git a/video/end_to_end_tests/retransmission_tests.cc b/video/end_to_end_tests/retransmission_tests.cc
index 68fc251..f74af24 100644
--- a/video/end_to_end_tests/retransmission_tests.cc
+++ b/video/end_to_end_tests/retransmission_tests.cc
@@ -16,7 +16,6 @@
#include "api/test/video/function_video_encoder_factory.h"
#include "api/units/time_delta.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "modules/rtp_rtcp/source/rtp_packet.h"
#include "modules/video_coding/codecs/vp8/include/vp8.h"
#include "rtc_base/event.h"
@@ -25,6 +24,7 @@
#include "test/call_test.h"
#include "test/field_trial.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/rtcp_packet_parser.h"
#include "test/video_test_constants.h"
diff --git a/video/end_to_end_tests/rtp_rtcp_tests.cc b/video/end_to_end_tests/rtp_rtcp_tests.cc
index 35507e5..00a46dd 100644
--- a/video/end_to_end_tests/rtp_rtcp_tests.cc
+++ b/video/end_to_end_tests/rtp_rtcp_tests.cc
@@ -12,7 +12,6 @@
#include "api/test/simulated_network.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "modules/include/module_common_types_public.h"
#include "modules/rtp_rtcp/source/rtp_packet.h"
#include "modules/video_coding/codecs/vp8/include/vp8.h"
@@ -21,6 +20,7 @@
#include "rtc_base/task_queue_for_test.h"
#include "test/call_test.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/rtcp_packet_parser.h"
#include "test/video_test_constants.h"
diff --git a/video/end_to_end_tests/ssrc_tests.cc b/video/end_to_end_tests/ssrc_tests.cc
index b6ee7d2..9ffedd6 100644
--- a/video/end_to_end_tests/ssrc_tests.cc
+++ b/video/end_to_end_tests/ssrc_tests.cc
@@ -13,13 +13,13 @@
#include "api/test/simulated_network.h"
#include "call/fake_network_pipe.h"
#include "call/packet_receiver.h"
-#include "call/simulated_network.h"
#include "modules/rtp_rtcp/source/rtp_packet.h"
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
#include "modules/rtp_rtcp/source/rtp_util.h"
#include "rtc_base/task_queue_for_test.h"
#include "test/call_test.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/rtcp_packet_parser.h"
#include "test/video_test_constants.h"
diff --git a/video/end_to_end_tests/stats_tests.cc b/video/end_to_end_tests/stats_tests.cc
index 58f4b30..ddeeb41 100644
--- a/video/end_to_end_tests/stats_tests.cc
+++ b/video/end_to_end_tests/stats_tests.cc
@@ -16,7 +16,6 @@
#include "api/test/simulated_network.h"
#include "api/test/video/function_video_encoder_factory.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "modules/rtp_rtcp/source/rtp_packet.h"
#include "modules/video_coding/include/video_coding_defines.h"
#include "rtc_base/strings/string_builder.h"
@@ -27,6 +26,7 @@
#include "test/call_test.h"
#include "test/fake_encoder.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/rtcp_packet_parser.h"
#include "test/video_test_constants.h"
diff --git a/video/end_to_end_tests/transport_feedback_tests.cc b/video/end_to_end_tests/transport_feedback_tests.cc
index 36be6d9..5231af0 100644
--- a/video/end_to_end_tests/transport_feedback_tests.cc
+++ b/video/end_to_end_tests/transport_feedback_tests.cc
@@ -16,7 +16,6 @@
#include "api/units/time_delta.h"
#include "call/call.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "modules/rtp_rtcp/source/byte_io.h"
#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
#include "modules/rtp_rtcp/source/rtp_packet.h"
@@ -25,6 +24,7 @@
#include "test/call_test.h"
#include "test/field_trial.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/rtcp_packet_parser.h"
#include "test/video_test_constants.h"
#include "video/end_to_end_tests/multi_stream_tester.h"
diff --git a/video/pc_full_stack_tests.cc b/video/pc_full_stack_tests.cc
index a4d3cda..000316b 100644
--- a/video/pc_full_stack_tests.cc
+++ b/video/pc_full_stack_tests.cc
@@ -26,11 +26,11 @@
#include "api/test/simulated_network.h"
#include "api/test/time_controller.h"
#include "api/video_codecs/vp9_profile.h"
-#include "call/simulated_network.h"
#include "modules/video_coding/codecs/vp9/include/vp9.h"
#include "system_wrappers/include/field_trial.h"
#include "test/field_trial.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/pc/e2e/network_quality_metrics_reporter.h"
#include "test/testsupport/file_utils.h"
diff --git a/video/picture_id_tests.cc b/video/picture_id_tests.cc
index e60a93c..e78f7d3 100644
--- a/video/picture_id_tests.cc
+++ b/video/picture_id_tests.cc
@@ -13,7 +13,6 @@
#include "api/test/simulated_network.h"
#include "api/test/video/function_video_encoder_factory.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "media/engine/internal_encoder_factory.h"
#include "media/engine/simulcast_encoder_adapter.h"
#include "modules/rtp_rtcp/source/create_video_rtp_depacketizer.h"
@@ -25,6 +24,7 @@
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/task_queue_for_test.h"
#include "test/call_test.h"
+#include "test/network/simulated_network.h"
#include "test/video_test_constants.h"
namespace webrtc {
diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc
index 995fada..ee2a66d 100644
--- a/video/video_quality_test.cc
+++ b/video/video_quality_test.cc
@@ -31,7 +31,6 @@
#include "api/video/builtin_video_bitrate_allocator_factory.h"
#include "api/video_codecs/video_encoder.h"
#include "call/fake_network_pipe.h"
-#include "call/simulated_network.h"
#include "media/base/media_constants.h"
#include "media/engine/adm_helpers.h"
#include "media/engine/fake_video_codec_factory.h"
@@ -45,6 +44,7 @@
#include "modules/video_coding/utility/ivf_file_writer.h"
#include "rtc_base/strings/string_builder.h"
#include "rtc_base/task_queue_for_test.h"
+#include "test/network/simulated_network.h"
#include "test/platform_video_capturer.h"
#include "test/test_flags.h"
#include "test/testsupport/file_utils.h"
diff --git a/video/video_send_stream_tests.cc b/video/video_send_stream_tests.cc
index c96f5d3..38b21bc 100644
--- a/video/video_send_stream_tests.cc
+++ b/video/video_send_stream_tests.cc
@@ -26,7 +26,6 @@
#include "call/call.h"
#include "call/fake_network_pipe.h"
#include "call/rtp_transport_controller_send.h"
-#include "call/simulated_network.h"
#include "call/video_send_stream.h"
#include "media/engine/internal_encoder_factory.h"
#include "media/engine/simulcast_encoder_adapter.h"
@@ -66,6 +65,7 @@
#include "test/frame_utils.h"
#include "test/gmock.h"
#include "test/gtest.h"
+#include "test/network/simulated_network.h"
#include "test/null_transport.h"
#include "test/rtcp_packet_parser.h"
#include "test/rtp_rtcp_observer.h"