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 27d40297fe856989479a427db6d44bf8c6e49c57..578526ed97f6f1fbfe3688434b0bac013b4bfd33 100644 |
--- a/webrtc/audio/audio_send_stream_unittest.cc |
+++ b/webrtc/audio/audio_send_stream_unittest.cc |
@@ -13,6 +13,7 @@ |
#include "webrtc/audio/audio_send_stream.h" |
#include "webrtc/audio/audio_state.h" |
#include "webrtc/audio/conversion.h" |
+#include "webrtc/test/mock_voe_channel_proxy.h" |
#include "webrtc/test/mock_voice_engine.h" |
namespace webrtc { |
@@ -39,7 +40,7 @@ const ReportBlock kReportBlock = {456, 780, 123, 567, 890, 132, 143, 13354}; |
struct ConfigHelper { |
ConfigHelper() : stream_config_(nullptr) { |
- using testing::StrEq; |
+ using testing::Invoke; |
EXPECT_CALL(voice_engine_, |
RegisterVoiceEngineObserver(_)).WillOnce(Return(0)); |
@@ -49,12 +50,8 @@ struct ConfigHelper { |
config.voice_engine = &voice_engine_; |
audio_state_ = AudioState::Create(config); |
- EXPECT_CALL(voice_engine_, SetRTCPStatus(kChannelId, true)) |
- .WillOnce(Return(0)); |
- EXPECT_CALL(voice_engine_, SetLocalSSRC(kChannelId, kSsrc)) |
- .WillOnce(Return(0)); |
- EXPECT_CALL(voice_engine_, SetRTCP_CNAME(kChannelId, StrEq(kCName))) |
- .WillOnce(Return(0)); |
+ EXPECT_CALL(voice_engine_, GetChannelProxy(kChannelId)) |
+ .WillOnce(Invoke(this, &ConfigHelper::CreateChannelProxy)); |
kwiberg-webrtc
2015/11/25 10:44:59
See earlier comment about lambda and whether chann
the sun
2015/11/25 12:28:01
channel_proxy_ *will* be needed. Once the methods
|
EXPECT_CALL(voice_engine_, |
SetSendAbsoluteSenderTimeStatus(kChannelId, true, kAbsSendTimeId)) |
.WillOnce(Return(0)); |
@@ -106,9 +103,21 @@ struct ConfigHelper { |
} |
private: |
+ voe::ChannelProxy* CreateChannelProxy(int channel_id) { |
+ using testing::StrEq; |
+ |
+ EXPECT_FALSE(channel_proxy_); |
+ channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>(); |
+ EXPECT_CALL(*channel_proxy_, SetRTCPStatus(true)).Times(1); |
+ EXPECT_CALL(*channel_proxy_, SetLocalSSRC(kSsrc)).Times(1); |
+ EXPECT_CALL(*channel_proxy_, SetRTCP_CNAME(StrEq(kCName))).Times(1); |
+ return channel_proxy_; |
+ } |
+ |
testing::StrictMock<MockVoiceEngine> voice_engine_; |
rtc::scoped_refptr<AudioState> audio_state_; |
AudioSendStream::Config stream_config_; |
+ testing::StrictMock<MockVoEChannelProxy>* channel_proxy_ = nullptr; |
}; |
} // namespace |