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

Unified Diff: webrtc/audio/audio_receive_stream_unittest.cc

Issue 1748403002: Move RtcEventLog object from inside VoiceEngine to Call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Another rebase and accompanying changes. Created 4 years, 6 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/audio/audio_receive_stream.cc ('k') | webrtc/audio/audio_send_stream_unittest.cc » ('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 aed1d1ad20b61fc5d566ef9fb321203e6200f454..dd66cc67d89cb39964c1a0e9290bf3a51a3f3487 100644
--- a/webrtc/audio/audio_receive_stream_unittest.cc
+++ b/webrtc/audio/audio_receive_stream_unittest.cc
@@ -15,6 +15,7 @@
#include "webrtc/audio/audio_receive_stream.h"
#include "webrtc/audio/conversion.h"
+#include "webrtc/call/mock/mock_rtc_event_log.h"
#include "webrtc/modules/audio_coding/codecs/mock/mock_audio_decoder_factory.h"
#include "webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h"
#include "webrtc/modules/congestion_controller/include/mock/mock_congestion_controller.h"
@@ -70,7 +71,8 @@ struct ConfigHelper {
decoder_factory_(new rtc::RefCountedObject<MockAudioDecoderFactory>),
congestion_controller_(&simulated_clock_,
&bitrate_observer_,
- &remote_bitrate_observer_) {
+ &remote_bitrate_observer_,
+ &event_log_) {
using testing::Invoke;
EXPECT_CALL(voice_engine_,
@@ -109,6 +111,12 @@ struct ConfigHelper {
.Times(1);
EXPECT_CALL(*channel_proxy_, GetAudioDecoderFactory())
.WillOnce(ReturnRef(decoder_factory_));
+ testing::Expectation expect_set =
+ EXPECT_CALL(*channel_proxy_, SetRtcEventLog(&event_log_))
+ .Times(1);
+ EXPECT_CALL(*channel_proxy_, SetRtcEventLog(testing::IsNull()))
+ .Times(1)
+ .After(expect_set);
return channel_proxy_;
}));
stream_config_.voe_channel_id = kChannelId;
@@ -130,6 +138,7 @@ struct ConfigHelper {
MockRemoteBitrateEstimator* remote_bitrate_estimator() {
return &remote_bitrate_estimator_;
}
+ MockRtcEventLog* event_log() { return &event_log_; }
AudioReceiveStream::Config& config() { return stream_config_; }
rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; }
MockVoiceEngine& voice_engine() { return voice_engine_; }
@@ -171,6 +180,7 @@ struct ConfigHelper {
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_;
MockCongestionController congestion_controller_;
MockRemoteBitrateEstimator remote_bitrate_estimator_;
+ MockRtcEventLog event_log_;
testing::StrictMock<MockVoiceEngine> voice_engine_;
rtc::scoped_refptr<AudioState> audio_state_;
AudioReceiveStream::Config stream_config_;
@@ -248,7 +258,8 @@ TEST(AudioReceiveStreamTest, ConfigToString) {
TEST(AudioReceiveStreamTest, ConstructDestruct) {
ConfigHelper helper;
internal::AudioReceiveStream recv_stream(
- helper.congestion_controller(), helper.config(), helper.audio_state());
+ helper.congestion_controller(), helper.config(), helper.audio_state(),
+ helper.event_log());
}
MATCHER_P(VerifyHeaderExtension, expected_extension, "") {
@@ -267,7 +278,8 @@ TEST(AudioReceiveStreamTest, ReceiveRtpPacket) {
helper.config().rtp.transport_cc = true;
helper.SetupMockForBweFeedback(true);
internal::AudioReceiveStream recv_stream(
- helper.congestion_controller(), helper.config(), helper.audio_state());
+ helper.congestion_controller(), helper.config(), helper.audio_state(),
+ helper.event_log());
const int kTransportSequenceNumberValue = 1234;
std::vector<uint8_t> rtp_packet = CreateRtpHeaderWithOneByteExtension(
kTransportSequenceNumberId, kTransportSequenceNumberValue, 2);
@@ -295,7 +307,8 @@ TEST(AudioReceiveStreamTest, ReceiveRtcpPacket) {
helper.config().rtp.transport_cc = true;
helper.SetupMockForBweFeedback(true);
internal::AudioReceiveStream recv_stream(
- helper.congestion_controller(), helper.config(), helper.audio_state());
+ helper.congestion_controller(), helper.config(), helper.audio_state(),
+ helper.event_log());
std::vector<uint8_t> rtcp_packet = CreateRtcpSenderReport();
EXPECT_CALL(*helper.channel_proxy(),
@@ -307,7 +320,8 @@ TEST(AudioReceiveStreamTest, ReceiveRtcpPacket) {
TEST(AudioReceiveStreamTest, GetStats) {
ConfigHelper helper;
internal::AudioReceiveStream recv_stream(
- helper.congestion_controller(), helper.config(), helper.audio_state());
+ helper.congestion_controller(), helper.config(), helper.audio_state(),
+ helper.event_log());
helper.SetupMockForGetStats();
AudioReceiveStream::Stats stats = recv_stream.GetStats();
EXPECT_EQ(kRemoteSsrc, stats.remote_ssrc);
@@ -349,7 +363,8 @@ TEST(AudioReceiveStreamTest, GetStats) {
TEST(AudioReceiveStreamTest, SetGain) {
ConfigHelper helper;
internal::AudioReceiveStream recv_stream(
- helper.congestion_controller(), helper.config(), helper.audio_state());
+ helper.congestion_controller(), helper.config(), helper.audio_state(),
+ helper.event_log());
EXPECT_CALL(*helper.channel_proxy(),
SetChannelOutputVolumeScaling(FloatEq(0.765f)));
recv_stream.SetGain(0.765f);
« no previous file with comments | « webrtc/audio/audio_receive_stream.cc ('k') | webrtc/audio/audio_send_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698