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

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

Issue 2181383002: Add NACK rate throttling for audio channels. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase 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
Index: webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc
index 924d009883d9f7fd70c457ab1f6f8a7444541aed..cdb71be003acc0f503f8de3dac4d4825d2c2a4d8 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc
@@ -13,6 +13,7 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/base/rate_limiter.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_observer.h"
#include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h"
@@ -80,25 +81,25 @@ class RtcpReceiverTest : public ::testing::Test {
remote_bitrate_observer_(),
remote_bitrate_estimator_(
new RemoteBitrateEstimatorSingleStream(&remote_bitrate_observer_,
- &system_clock_)) {
- test_transport_ = new TestTransport();
+ &system_clock_)),
+ retransmission_rate_limiter_(&system_clock_, 1000) {
+ test_transport_.reset(new TestTransport());
RtpRtcp::Configuration configuration;
configuration.audio = false;
configuration.clock = &system_clock_;
- configuration.outgoing_transport = test_transport_;
+ configuration.outgoing_transport = test_transport_.get();
configuration.remote_bitrate_estimator = remote_bitrate_estimator_.get();
- rtp_rtcp_impl_ = new ModuleRtpRtcpImpl(configuration);
- rtcp_receiver_ = new RTCPReceiver(&system_clock_, false, nullptr, nullptr,
- nullptr, nullptr, rtp_rtcp_impl_);
- test_transport_->SetRTCPReceiver(rtcp_receiver_);
- }
- ~RtcpReceiverTest() {
- delete rtcp_receiver_;
- delete rtp_rtcp_impl_;
- delete test_transport_;
+ configuration.retransmission_rate_limiter = &retransmission_rate_limiter_;
+ rtp_rtcp_impl_.reset(new ModuleRtpRtcpImpl(configuration));
+ rtcp_receiver_.reset(new RTCPReceiver(&system_clock_, false, nullptr,
+ nullptr, nullptr, nullptr,
+ rtp_rtcp_impl_.get()));
+ test_transport_->SetRTCPReceiver(rtcp_receiver_.get());
}
+ ~RtcpReceiverTest() {}
+
// Injects an RTCP packet into the receiver.
// Returns 0 for OK, non-0 for failure.
int InjectRtcpPacket(const uint8_t* packet,
@@ -142,12 +143,13 @@ class RtcpReceiverTest : public ::testing::Test {
OverUseDetectorOptions over_use_detector_options_;
SimulatedClock system_clock_;
- ModuleRtpRtcpImpl* rtp_rtcp_impl_;
- RTCPReceiver* rtcp_receiver_;
- TestTransport* test_transport_;
+ std::unique_ptr<TestTransport> test_transport_;
+ std::unique_ptr<ModuleRtpRtcpImpl> rtp_rtcp_impl_;
+ std::unique_ptr<RTCPReceiver> rtcp_receiver_;
RTCPHelp::RTCPPacketInformation rtcp_packet_info_;
MockRemoteBitrateObserver remote_bitrate_observer_;
std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
+ RateLimiter retransmission_rate_limiter_;
};
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_format_remb_unittest.cc ('k') | webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698