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

Unified Diff: webrtc/audio/audio_receive_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_receive_stream.cc ('k') | webrtc/audio/audio_send_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/audio/audio_receive_stream_unittest.cc
diff --git a/webrtc/audio/audio_receive_stream_unittest.cc b/webrtc/audio/audio_receive_stream_unittest.cc
index 5efd5b0e1c8b3acd86401a16563cdb92220610d8..aac7c0f1c1a7c9f87d611024111af8f0435cca3c 100644
--- a/webrtc/audio/audio_receive_stream_unittest.cc
+++ b/webrtc/audio/audio_receive_stream_unittest.cc
@@ -14,6 +14,7 @@
#include "webrtc/audio/conversion.h"
#include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h"
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
+#include "webrtc/test/mock_voe_channel_proxy.h"
#include "webrtc/test/mock_voice_engine.h"
namespace webrtc {
@@ -53,6 +54,8 @@ const AudioDecodingCallStats kAudioDecodeStats = MakeAudioDecodeStatsForTest();
struct ConfigHelper {
ConfigHelper() {
+ using testing::Invoke;
+
EXPECT_CALL(voice_engine_,
RegisterVoiceEngineObserver(_)).WillOnce(Return(0));
EXPECT_CALL(voice_engine_,
@@ -61,8 +64,13 @@ struct ConfigHelper {
config.voice_engine = &voice_engine_;
audio_state_ = AudioState::Create(config);
- EXPECT_CALL(voice_engine_, SetLocalSSRC(kChannelId, kLocalSsrc))
- .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_, SetLocalSSRC(kLocalSsrc)).Times(1);
+ return channel_proxy_;
+ }));
EXPECT_CALL(voice_engine_,
SetReceiveAbsoluteSenderTimeStatus(kChannelId, true, kAbsSendTimeId))
.WillOnce(Return(0));
@@ -76,7 +84,7 @@ struct ConfigHelper {
RtpExtension(RtpExtension::kAbsSendTime, kAbsSendTimeId));
stream_config_.rtp.extensions.push_back(
RtpExtension(RtpExtension::kAudioLevel, kAudioLevelId));
-}
+ }
MockRemoteBitrateEstimator* remote_bitrate_estimator() {
return &remote_bitrate_estimator_;
@@ -89,6 +97,7 @@ struct ConfigHelper {
using testing::DoAll;
using testing::SetArgPointee;
using testing::SetArgReferee;
+
EXPECT_CALL(voice_engine_, GetRTCPStatistics(kChannelId, _))
.WillOnce(DoAll(SetArgReferee<1>(kCallStats), Return(0)));
EXPECT_CALL(voice_engine_, GetRecCodec(kChannelId, _))
@@ -110,6 +119,7 @@ struct ConfigHelper {
testing::StrictMock<MockVoiceEngine> voice_engine_;
rtc::scoped_refptr<AudioState> audio_state_;
AudioReceiveStream::Config stream_config_;
+ testing::StrictMock<MockVoEChannelProxy>* channel_proxy_ = nullptr;
};
void BuildAbsoluteSendTimeExtension(uint8_t* buffer,
« no previous file with comments | « webrtc/audio/audio_receive_stream.cc ('k') | webrtc/audio/audio_send_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698