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

Unified Diff: webrtc/api/rtpsenderreceiver_unittest.cc

Issue 1788583004: Enable setting the maximum bitrate limit in RtpSender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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/api/rtpsenderreceiver_unittest.cc
diff --git a/webrtc/api/rtpsenderreceiver_unittest.cc b/webrtc/api/rtpsenderreceiver_unittest.cc
index 60960fb5f043addb2ef32df4388e412fb6580460..139e23f72ecd245ac5a69e488b4eb91e519d6b97 100644
--- a/webrtc/api/rtpsenderreceiver_unittest.cc
+++ b/webrtc/api/rtpsenderreceiver_unittest.cc
@@ -27,6 +27,7 @@
using ::testing::_;
using ::testing::Exactly;
+using ::testing::Return;
static const char kStreamLabel1[] = "local_stream_1";
static const char kVideoTrackId[] = "video_1";
@@ -52,6 +53,9 @@ class MockAudioProvider : public AudioProviderInterface {
const cricket::AudioOptions& options,
cricket::AudioRenderer* renderer));
MOCK_METHOD2(SetAudioPlayoutVolume, void(uint32_t ssrc, double volume));
+ MOCK_METHOD1(GetAudioRtpParameters, RTCRtpParameters(uint32_t ssrc));
+ MOCK_METHOD2(SetAudioRtpParameters,
+ bool(uint32_t ssrc, const RTCRtpParameters&));
void SetRawAudioSink(uint32_t,
rtc::scoped_ptr<AudioSinkInterface> sink) override {
@@ -76,6 +80,10 @@ class MockVideoProvider : public VideoProviderInterface {
void(uint32_t ssrc,
bool enable,
const cricket::VideoOptions* options));
+
+ MOCK_METHOD1(GetVideoRtpParameters, RTCRtpParameters(uint32_t ssrc));
+ MOCK_METHOD2(SetVideoRtpParameters,
+ bool(uint32_t ssrc, const RTCRtpParameters&));
};
class FakeVideoSource : public Notifier<VideoSourceInterface> {
@@ -495,4 +503,30 @@ TEST_F(RtpSenderReceiverTest, VideoSenderSsrcChanged) {
EXPECT_CALL(video_provider_, SetVideoSend(kVideoSsrc2, false, _)).Times(1);
}
+TEST_F(RtpSenderReceiverTest, AudioSenderCanSetParameters) {
+ CreateAudioRtpSender();
+
+ EXPECT_CALL(audio_provider_, GetAudioRtpParameters(kAudioSsrc))
+ .WillOnce(Return(RTCRtpParameters()));
+ EXPECT_CALL(audio_provider_, SetAudioRtpParameters(kAudioSsrc, _))
+ .WillOnce(Return(true));
+ RTCRtpParameters params = audio_rtp_sender_->GetParameters();
+ EXPECT_TRUE(audio_rtp_sender_->SetParameters(params));
+
+ DestroyAudioRtpSender();
+}
+
+TEST_F(RtpSenderReceiverTest, VideoSenderCanSetParameters) {
+ CreateVideoRtpSender();
+
+ EXPECT_CALL(video_provider_, GetVideoRtpParameters(kVideoSsrc))
+ .WillOnce(Return(RTCRtpParameters()));
+ EXPECT_CALL(video_provider_, SetVideoRtpParameters(kVideoSsrc, _))
+ .WillOnce(Return(true));
+ RTCRtpParameters params = video_rtp_sender_->GetParameters();
+ EXPECT_TRUE(video_rtp_sender_->SetParameters(params));
+
+ DestroyVideoRtpSender();
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698