Removed dependencies from audio send stream unit test

The audio send stream unit tests did not use the mocks injected to the
fake rtp transport controller send. This CL prepares for removing the
fake controller which makes it harder to refactor the rtp transport
controller interface.

Bug: webrt:8415
Change-Id: I73f7d105e66f9beb80aeaa92f3490cd61c80c5b8
Reviewed-on: https://webrtc-review.googlesource.com/54302
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22102}
This commit is contained in:
Sebastian Jansson 2018-02-20 09:06:11 +01:00 committed by Commit Bot
parent 6bd3cddcef
commit 1896cece01
2 changed files with 8 additions and 23 deletions

View File

@ -125,9 +125,9 @@ if (rtc_include_tests) {
":audio_end_to_end_test",
"../api:mock_audio_mixer",
"../call:mock_call_interfaces",
"../call:mock_rtp_interfaces",
"../call:rtp_interfaces",
"../call:rtp_receiver",
"../call:rtp_sender",
"../common_audio",
"../logging:mocks",
"../modules:module_api",
@ -136,9 +136,6 @@ if (rtc_include_tests) {
"../modules/audio_processing:audio_processing_statistics",
"../modules/audio_processing:mocks",
"../modules/bitrate_controller:mocks",
"../modules/congestion_controller:congestion_controller",
"../modules/congestion_controller:mock_congestion_controller",
"../modules/pacing:mock_paced_sender",
"../modules/pacing:pacing",
"../modules/rtp_rtcp:mock_rtp_rtcp",
"../modules/rtp_rtcp:rtp_rtcp_format",

View File

@ -16,16 +16,12 @@
#include "audio/audio_state.h"
#include "audio/conversion.h"
#include "audio/mock_voe_channel_proxy.h"
#include "call/fake_rtp_transport_controller_send.h"
#include "call/rtp_transport_controller_send_interface.h"
#include "call/rtp_transport_controller_send.h"
#include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
#include "modules/audio_device/include/mock_audio_device.h"
#include "modules/audio_mixer/audio_mixer_impl.h"
#include "modules/audio_processing/include/audio_processing_statistics.h"
#include "modules/audio_processing/include/mock_audio_processing.h"
#include "modules/congestion_controller/include/mock/mock_congestion_observer.h"
#include "modules/congestion_controller/include/send_side_congestion_controller.h"
#include "modules/pacing/mock/mock_paced_sender.h"
#include "modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h"
#include "modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
#include "rtc_base/fakeclock.h"
@ -130,12 +126,7 @@ struct ConfigHelper {
: stream_config_(nullptr),
audio_processing_(new rtc::RefCountedObject<MockAudioProcessing>()),
simulated_clock_(123456),
send_side_cc_(rtc::MakeUnique<SendSideCongestionController>(
&simulated_clock_,
nullptr /* observer */,
&event_log_,
&pacer_)),
fake_transport_(&packet_router_, &pacer_, send_side_cc_.get()),
rtp_transport_(&simulated_clock_, &event_log_),
bitrate_allocator_(&limit_observer_),
worker_queue_("ConfigHelper_worker_queue"),
audio_encoder_(nullptr) {
@ -171,7 +162,7 @@ struct ConfigHelper {
std::unique_ptr<internal::AudioSendStream> CreateAudioSendStream() {
return std::unique_ptr<internal::AudioSendStream>(
new internal::AudioSendStream(
stream_config_, audio_state_, &worker_queue_, &fake_transport_,
stream_config_, audio_state_, &worker_queue_, &rtp_transport_,
&bitrate_allocator_, &event_log_, &rtcp_rtt_stats_, rtc::nullopt,
&active_lifetime_,
std::unique_ptr<voe::ChannelProxy>(channel_proxy_)));
@ -183,7 +174,7 @@ struct ConfigHelper {
stream_config_.encoder_factory.get());
}
MockVoEChannelProxy* channel_proxy() { return channel_proxy_; }
RtpTransportControllerSendInterface* transport() { return &fake_transport_; }
RtpTransportControllerSendInterface* transport() { return &rtp_transport_; }
TimeInterval* active_lifetime() { return &active_lifetime_; }
static void AddBweToConfig(AudioSendStream::Config* config) {
@ -213,11 +204,11 @@ struct ConfigHelper {
EnableSendTransportSequenceNumber(kTransportSequenceNumberId))
.Times(1);
EXPECT_CALL(*channel_proxy_, RegisterSenderCongestionControlObjects(
&fake_transport_, Ne(nullptr)))
&rtp_transport_, Ne(nullptr)))
.Times(1);
} else {
EXPECT_CALL(*channel_proxy_, RegisterSenderCongestionControlObjects(
&fake_transport_, Eq(nullptr)))
&rtp_transport_, Eq(nullptr)))
.Times(1);
}
EXPECT_CALL(*channel_proxy_, ResetSenderCongestionControlObjects())
@ -312,11 +303,8 @@ struct ConfigHelper {
AudioProcessingStats audio_processing_stats_;
SimulatedClock simulated_clock_;
TimeInterval active_lifetime_;
PacketRouter packet_router_;
testing::NiceMock<MockPacedSender> pacer_;
std::unique_ptr<SendSideCongestionController> send_side_cc_;
FakeRtpTransportControllerSend fake_transport_;
MockRtcEventLog event_log_;
RtpTransportControllerSend rtp_transport_;
MockRtpRtcp rtp_rtcp_;
MockRtcpRttStats rtcp_rtt_stats_;
testing::NiceMock<MockLimitObserver> limit_observer_;