Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: webrtc/test/fake_network_pipe.cc

Issue 2024293003: Fix FakeNetworkPipe to not deliver packet faster than requested. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/video/end_to_end_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/fake_network_pipe.cc
diff --git a/webrtc/test/fake_network_pipe.cc b/webrtc/test/fake_network_pipe.cc
index 360b32ccf810a20b3e3f8fee88dc2f4e66aeb1ec..19f1b5451c82c99bf3bb9b3a2e7c1a9eca00e3d2 100644
--- a/webrtc/test/fake_network_pipe.cc
+++ b/webrtc/test/fake_network_pipe.cc
@@ -100,8 +100,9 @@ void FakeNetworkPipe::SendPacket(const uint8_t* data, size_t data_length) {
int64_t network_start_time = time_now;
// Check if there already are packets on the link and change network start
- // time if there is.
- if (!capacity_link_.empty())
+ // time forward if there is.
+ if (!capacity_link_.empty() &&
+ network_start_time < capacity_link_.back()->arrival_time())
network_start_time = capacity_link_.back()->arrival_time();
int64_t arrival_time = network_start_time + capacity_delay_ms;
« no previous file with comments | « no previous file | webrtc/video/end_to_end_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698