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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc

Issue 2589743002: Make OverheadObserver::OnOverheadChanged count RTP headers only (Closed)
Patch Set: Add explicit cast. Created 3 years, 11 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/rtp_rtcp/source/rtp_sender.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
index 254a7d0ae6ba80c1d00944f1e6d9475317d143ee..ddf6422a9f16822f1b873f34f99b9e9872b2537e 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
@@ -1394,21 +1394,16 @@ TEST_F(RtpSenderTest, OnOverheadChanged) {
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
&retransmission_rate_limiter_, &mock_overhead_observer));
- // Transport overhead is set to 28B.
- EXPECT_CALL(mock_overhead_observer, OnOverheadChanged(28)).Times(1);
- rtp_sender_->SetTransportOverhead(28);
-
// RTP overhead is 12B.
- // 28B + 12B = 40B
- EXPECT_CALL(mock_overhead_observer, OnOverheadChanged(40)).Times(1);
+ EXPECT_CALL(mock_overhead_observer, OnOverheadChanged(12)).Times(1);
SendGenericPayload();
rtp_sender_->RegisterRtpHeaderExtension(kRtpExtensionTransmissionTimeOffset,
kTransmissionTimeOffsetExtensionId);
// TransmissionTimeOffset extension has a size of 8B.
- // 28B + 12B + 8B = 48B
- EXPECT_CALL(mock_overhead_observer, OnOverheadChanged(48)).Times(1);
+ // 12B + 8B = 20B
+ EXPECT_CALL(mock_overhead_observer, OnOverheadChanged(20)).Times(1);
SendGenericPayload();
}
@@ -1420,16 +1415,11 @@ TEST_F(RtpSenderTest, DoesNotUpdateOverheadOnEqualSize) {
&retransmission_rate_limiter_, &mock_overhead_observer));
EXPECT_CALL(mock_overhead_observer, OnOverheadChanged(_)).Times(1);
- rtp_sender_->SetTransportOverhead(28);
- rtp_sender_->SetTransportOverhead(28);
-
- EXPECT_CALL(mock_overhead_observer, OnOverheadChanged(_)).Times(1);
SendGenericPayload();
SendGenericPayload();
}
TEST_F(RtpSenderTest, AddOverheadToTransportFeedbackObserver) {
- constexpr int kTransportOverheadBytesPerPacket = 28;
constexpr int kRtpOverheadBytesPerPacket = 12 + 8;
test::ScopedFieldTrials override_field_trials(
"WebRTC-SendSideBwe-WithOverhead/Enabled/");
@@ -1438,7 +1428,6 @@ TEST_F(RtpSenderTest, AddOverheadToTransportFeedbackObserver) {
false, &fake_clock_, &transport_, nullptr, nullptr, &seq_num_allocator_,
&feedback_observer_, nullptr, nullptr, nullptr, &mock_rtc_event_log_,
nullptr, &retransmission_rate_limiter_, &mock_overhead_observer));
- rtp_sender_->SetTransportOverhead(kTransportOverheadBytesPerPacket);
EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension(
kRtpExtensionTransportSequenceNumber,
kTransportSequenceNumberExtensionId));
@@ -1447,13 +1436,11 @@ TEST_F(RtpSenderTest, AddOverheadToTransportFeedbackObserver) {
EXPECT_CALL(feedback_observer_,
AddPacket(kTransportSequenceNumber,
sizeof(kPayloadData) + kGenericHeaderLength +
- kRtpOverheadBytesPerPacket +
- kTransportOverheadBytesPerPacket,
+ kRtpOverheadBytesPerPacket,
PacketInfo::kNotAProbe))
.Times(1);
EXPECT_CALL(mock_overhead_observer,
- OnOverheadChanged(kTransportOverheadBytesPerPacket +
- kRtpOverheadBytesPerPacket))
+ OnOverheadChanged(kRtpOverheadBytesPerPacket))
.Times(1);
SendGenericPayload();
}
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698