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

Unified Diff: webrtc/audio/audio_send_stream_unittest.cc

Issue 2405183002: Moving WebRtcVoiceMediaChannel::SendSetCodec to AudioSendStream. (Closed)
Patch Set: adding logs and addressing some earlier comments. Created 4 years, 2 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/audio/audio_send_stream_unittest.cc
diff --git a/webrtc/audio/audio_send_stream_unittest.cc b/webrtc/audio/audio_send_stream_unittest.cc
index a05c00ba49b4c3d9dfcedfbec3c53e8e6c734932..68b46d4ee6e6a0de8d289e3ee163c1f76d3220d7 100644
--- a/webrtc/audio/audio_send_stream_unittest.cc
+++ b/webrtc/audio/audio_send_stream_unittest.cc
@@ -111,6 +111,7 @@ struct ConfigHelper {
.Times(1); // Destructor resets the event log
return channel_proxy_;
}));
+ SetupMockForSetSendCodecs();
stream_config_.voe_channel_id = kChannelId;
stream_config_.rtp.ssrc = kSsrc;
stream_config_.rtp.nack.rtp_history_ms = 200;
@@ -133,6 +134,14 @@ struct ConfigHelper {
rtc::TaskQueue* worker_queue() { return &worker_queue_; }
RtcEventLog* event_log() { return &event_log_; }
+ void SetupMockForSetSendCodecs() {
+ EXPECT_CALL(voice_engine_, SetVADStatus(_, _, _, _))
+ .WillRepeatedly(Return(0));
+ EXPECT_CALL(voice_engine_, SetFECStatus(_, _)).WillRepeatedly(Return(0));
+ EXPECT_CALL(voice_engine_, SetSendCodec(_, _)).WillRepeatedly(Return(0));
+ EXPECT_CALL(voice_engine_, GetSendCodec(_, _)).WillOnce(Return(-1));
the sun 2016/10/17 14:58:22 Doesn't this mean we'll get an error log line?
minyue-webrtc 2016/10/18 09:39:00 This is only for the first time when GetSendCodec
+ }
+
void SetupMockForSendTelephoneEvent() {
EXPECT_TRUE(channel_proxy_);
EXPECT_CALL(*channel_proxy_,
@@ -287,5 +296,8 @@ TEST(AudioSendStreamTest, GetStatsTypingNoiseDetected) {
voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING);
EXPECT_FALSE(send_stream.GetStats().typing_noise_detected);
}
+
+// TODO(minyue): Add tests on logics involved in SetSendCodecs.
+
} // namespace test
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698