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

Unified Diff: webrtc/audio/audio_send_stream_unittest.cc

Issue 1459083007: Open backdoor in VoiceEngineImpl to get at the actual voe::Channel objects from an ID. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: presubmit complaints Created 5 years, 1 month 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/audio/audio_send_stream.cc ('k') | webrtc/test/mock_voe_channel_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bea8a82852bddccfff39b0369fb5da1871c9c5d2 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,6 +40,7 @@ const ReportBlock kReportBlock = {456, 780, 123, 567, 890, 132, 143, 13354};
struct ConfigHelper {
ConfigHelper() : stream_config_(nullptr) {
+ using testing::Invoke;
using testing::StrEq;
EXPECT_CALL(voice_engine_,
@@ -49,12 +51,15 @@ 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_, ChannelProxyFactory(kChannelId))
+ .WillOnce(Invoke([this](int channel_id) {
+ 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_;
+ }));
EXPECT_CALL(voice_engine_,
SetSendAbsoluteSenderTimeStatus(kChannelId, true, kAbsSendTimeId))
.WillOnce(Return(0));
@@ -109,6 +114,7 @@ struct ConfigHelper {
testing::StrictMock<MockVoiceEngine> voice_engine_;
rtc::scoped_refptr<AudioState> audio_state_;
AudioSendStream::Config stream_config_;
+ testing::StrictMock<MockVoEChannelProxy>* channel_proxy_ = nullptr;
};
} // namespace
« no previous file with comments | « webrtc/audio/audio_send_stream.cc ('k') | webrtc/test/mock_voe_channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698