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 a1264b2ff95e3ab469ad893cc71ade7980a48380..62dd2c3956eec857fddad54d511c9faa384fbe32 100644 |
--- a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc |
+++ b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc |
@@ -19,6 +19,7 @@ |
using ::testing::_; |
using ::testing::InSequence; |
using ::testing::Invoke; |
+using ::testing::Return; |
namespace webrtc { |
@@ -107,6 +108,40 @@ TEST_F(RemoteEstimatorProxyTest, DuplicatedPackets) { |
Process(); |
} |
+TEST_F(RemoteEstimatorProxyTest, FeedbackWithMissingStart) { |
+ // First feedback. |
+ IncomingPacket(kBaseSeq, kBaseTimeMs); |
+ IncomingPacket(kBaseSeq + 1, kBaseTimeMs + 1000); |
+ EXPECT_CALL(router_, SendFeedback(_)).Times(1).WillOnce(Return(true)); |
+ Process(); |
+ |
+ // Second feedback starts with a missing packet (DROP kBaseSeq + 2). |
+ IncomingPacket(kBaseSeq + 3, kBaseTimeMs + 3000); |
+ |
+ EXPECT_CALL(router_, SendFeedback(_)) |
+ .Times(1) |
+ .WillOnce(Invoke([this](rtcp::TransportFeedback* packet) { |
+ packet->Build(); |
+ EXPECT_EQ(kBaseSeq + 2, packet->GetBaseSequence()); |
+ EXPECT_EQ(kMediaSsrc, packet->GetMediaSourceSsrc()); |
+ |
+ std::vector<rtcp::TransportFeedback::StatusSymbol> status_vec = |
+ packet->GetStatusVector(); |
+ EXPECT_EQ(2u, status_vec.size()); |
+ EXPECT_EQ(rtcp::TransportFeedback::StatusSymbol::kNotReceived, |
+ status_vec[0]); |
+ EXPECT_EQ(rtcp::TransportFeedback::StatusSymbol::kReceivedSmallDelta, |
+ status_vec[1]); |
+ std::vector<int64_t> delta_vec = packet->GetReceiveDeltasUs(); |
+ EXPECT_EQ(1u, delta_vec.size()); |
+ EXPECT_EQ(kBaseTimeMs + 3000, |
+ (packet->GetBaseTimeUs() + delta_vec[0]) / 1000); |
+ return true; |
+ })); |
+ |
+ Process(); |
+} |
+ |
TEST_F(RemoteEstimatorProxyTest, SendsFeedbackWithVaryingDeltas) { |
IncomingPacket(kBaseSeq, kBaseTimeMs); |
IncomingPacket(kBaseSeq + 1, kBaseTimeMs + kMaxSmallDeltaMs); |