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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc

Issue 1738763002: Remove DCHECK on duplicate packets in RemoteEstimatorProxy. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 status_vec[0]); 75 status_vec[0]);
76 std::vector<int64_t> delta_vec = packet->GetReceiveDeltasUs(); 76 std::vector<int64_t> delta_vec = packet->GetReceiveDeltasUs();
77 EXPECT_EQ(1u, delta_vec.size()); 77 EXPECT_EQ(1u, delta_vec.size());
78 EXPECT_EQ(kBaseTimeMs, (packet->GetBaseTimeUs() + delta_vec[0]) / 1000); 78 EXPECT_EQ(kBaseTimeMs, (packet->GetBaseTimeUs() + delta_vec[0]) / 1000);
79 return true; 79 return true;
80 })); 80 }));
81 81
82 Process(); 82 Process();
83 } 83 }
84 84
85 TEST_F(RemoteEstimatorProxyTest, DuplicatedPackets) {
86 IncomingPacket(kBaseSeq, kBaseTimeMs);
87 IncomingPacket(kBaseSeq, kBaseTimeMs + 1000);
88
89 EXPECT_CALL(router_, SendFeedback(_))
90 .Times(1)
91 .WillOnce(Invoke([this](rtcp::TransportFeedback* packet) {
92 packet->Build();
93 EXPECT_EQ(kBaseSeq, packet->GetBaseSequence());
94 EXPECT_EQ(kMediaSsrc, packet->GetMediaSourceSsrc());
95
96 std::vector<rtcp::TransportFeedback::StatusSymbol> status_vec =
97 packet->GetStatusVector();
98 EXPECT_EQ(1u, status_vec.size());
99 EXPECT_EQ(rtcp::TransportFeedback::StatusSymbol::kReceivedSmallDelta,
100 status_vec[0]);
101 std::vector<int64_t> delta_vec = packet->GetReceiveDeltasUs();
102 EXPECT_EQ(1u, delta_vec.size());
103 EXPECT_EQ(kBaseTimeMs, (packet->GetBaseTimeUs() + delta_vec[0]) / 1000);
104 return true;
105 }));
106
107 Process();
108 }
109
85 TEST_F(RemoteEstimatorProxyTest, SendsFeedbackWithVaryingDeltas) { 110 TEST_F(RemoteEstimatorProxyTest, SendsFeedbackWithVaryingDeltas) {
86 IncomingPacket(kBaseSeq, kBaseTimeMs); 111 IncomingPacket(kBaseSeq, kBaseTimeMs);
87 IncomingPacket(kBaseSeq + 1, kBaseTimeMs + kMaxSmallDeltaMs); 112 IncomingPacket(kBaseSeq + 1, kBaseTimeMs + kMaxSmallDeltaMs);
88 IncomingPacket(kBaseSeq + 2, kBaseTimeMs + (2 * kMaxSmallDeltaMs) + 1); 113 IncomingPacket(kBaseSeq + 2, kBaseTimeMs + (2 * kMaxSmallDeltaMs) + 1);
89 114
90 EXPECT_CALL(router_, SendFeedback(_)) 115 EXPECT_CALL(router_, SendFeedback(_))
91 .Times(1) 116 .Times(1)
92 .WillOnce(Invoke([this](rtcp::TransportFeedback* packet) { 117 .WillOnce(Invoke([this](rtcp::TransportFeedback* packet) {
93 packet->Build(); 118 packet->Build();
94 EXPECT_EQ(kBaseSeq, packet->GetBaseSequence()); 119 EXPECT_EQ(kBaseSeq, packet->GetBaseSequence());
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 (packet->GetBaseTimeUs() + delta_vec[0]) / 1000); 288 (packet->GetBaseTimeUs() + delta_vec[0]) / 1000);
264 EXPECT_EQ(kTimeoutTimeMs - kBaseTimeMs, delta_vec[1] / 1000); 289 EXPECT_EQ(kTimeoutTimeMs - kBaseTimeMs, delta_vec[1] / 1000);
265 EXPECT_EQ(1, delta_vec[2] / 1000); 290 EXPECT_EQ(1, delta_vec[2] / 1000);
266 return true; 291 return true;
267 })); 292 }));
268 293
269 Process(); 294 Process();
270 } 295 }
271 296
272 } // namespace webrtc 297 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698