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

Unified Diff: webrtc/test/mock_voice_engine.h

Issue 2887733002: Store/restore RTP state for audio streams with same SSRC within a call (Closed)
Patch Set: Rebasement Jaxx Created 3 years, 7 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
« no previous file with comments | « webrtc/call/call_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/mock_voice_engine.h
diff --git a/webrtc/test/mock_voice_engine.h b/webrtc/test/mock_voice_engine.h
index 6b1f9cf31fabfa8976ffe922e774c4dbab336736..7655d3b8443f6253fb0d6b14d53dc671c9f4d68c 100644
--- a/webrtc/test/mock_voice_engine.h
+++ b/webrtc/test/mock_voice_engine.h
@@ -16,6 +16,7 @@
#include "webrtc/modules/audio_device/include/mock_audio_device.h"
#include "webrtc/modules/audio_device/include/mock_audio_transport.h"
#include "webrtc/modules/audio_processing/include/mock_audio_processing.h"
+#include "webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
#include "webrtc/test/gmock.h"
#include "webrtc/test/mock_voe_channel_proxy.h"
#include "webrtc/voice_engine/voice_engine_impl.h"
@@ -57,6 +58,9 @@ class MockVoiceEngine : public VoiceEngineImpl {
[](const std::map<int, SdpAudioFormat>& codecs) {
EXPECT_THAT(codecs, testing::IsEmpty());
}));
+ EXPECT_CALL(*proxy, GetRtpRtcp(testing::_, testing::_))
+ .WillRepeatedly(
+ testing::SetArgPointee<0>(GetMockRtpRtcp(channel_id)));
return proxy;
}));
@@ -74,6 +78,15 @@ class MockVoiceEngine : public VoiceEngineImpl {
// trigger an assertion.
--_ref_count;
}
+
+ // These need to be the same each call to channel_id and must not leak.
+ MockRtpRtcp* GetMockRtpRtcp(int channel_id) {
+ if (mock_rtp_rtcps_.find(channel_id) == mock_rtp_rtcps_.end()) {
+ mock_rtp_rtcps_[channel_id].reset(new ::testing::NiceMock<MockRtpRtcp>);
+ }
+ return mock_rtp_rtcps_[channel_id].get();
+ }
+
// Allows injecting a ChannelProxy factory.
MOCK_METHOD1(ChannelProxyFactory, voe::ChannelProxy*(int channel_id));
@@ -241,6 +254,8 @@ class MockVoiceEngine : public VoiceEngineImpl {
// voe::Channel does.
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_;
+ std::map<int, std::unique_ptr<MockRtpRtcp>> mock_rtp_rtcps_;
+
MockAudioDeviceModule mock_audio_device_;
MockAudioProcessing mock_audio_processing_;
MockAudioTransport mock_audio_transport_;
« no previous file with comments | « webrtc/call/call_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698