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

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: rebase 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
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

Powered by Google App Engine
This is Rietveld 408576698