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

Unified Diff: webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc

Issue 2157843002: Fix crash which happens when there's reordering in the beginning of a call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comment. Created 4 years, 5 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 | « webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc
index 62dd2c3956eec857fddad54d511c9faa384fbe32..d999525be0ef0e450152e77c0aa7e263b1bde098 100644
--- a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc
+++ b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc
@@ -48,7 +48,7 @@ class RemoteEstimatorProxyTest : public ::testing::Test {
}
SimulatedClock clock_;
- MockPacketRouter router_;
+ testing::StrictMock<MockPacketRouter> router_;
RemoteEstimatorProxy proxy_;
const size_t kDefaultPacketSize = 100;
@@ -225,6 +225,28 @@ TEST_F(RemoteEstimatorProxyTest, SendsFragmentedFeedback) {
Process();
}
+TEST_F(RemoteEstimatorProxyTest, GracefullyHandlesReorderingAndWrap) {
+ const int64_t kDeltaMs = 1000;
+ const uint16_t kLargeSeq = 62762;
+ IncomingPacket(kBaseSeq, kBaseTimeMs);
+ IncomingPacket(kLargeSeq, kBaseTimeMs + kDeltaMs);
+
+ EXPECT_CALL(router_, SendFeedback(_))
+ .Times(1)
+ .WillOnce(Invoke([this](rtcp::TransportFeedback* packet) {
+ packet->Build();
+ EXPECT_EQ(kBaseSeq, packet->GetBaseSequence());
+ EXPECT_EQ(kMediaSsrc, packet->GetMediaSourceSsrc());
+
+ std::vector<int64_t> delta_vec = packet->GetReceiveDeltasUs();
+ EXPECT_EQ(1u, delta_vec.size());
+ EXPECT_EQ(kBaseTimeMs, (packet->GetBaseTimeUs() + delta_vec[0]) / 1000);
+ return true;
+ }));
+
+ Process();
+}
+
TEST_F(RemoteEstimatorProxyTest, ResendsTimestampsOnReordering) {
IncomingPacket(kBaseSeq, kBaseTimeMs);
IncomingPacket(kBaseSeq + 2, kBaseTimeMs + 2);
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698