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

Unified Diff: webrtc/call/call_unittest.cc

Issue 2880323002: Move ownership of RtpTransportControllerSendInterface from Call to PeerConnection.
Patch Set: Delete shadowing member variables in BitrateEstimatorTest. 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.cc ('k') | webrtc/call/fake_rtp_transport_controller_send.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/call_unittest.cc
diff --git a/webrtc/call/call_unittest.cc b/webrtc/call/call_unittest.cc
index 06ee2005b1953dac90b724fe5f1f2e47f64610ca..08bf860c2c6d3597f5f2dcc37b2c0ef4a0c767fb 100644
--- a/webrtc/call/call_unittest.cc
+++ b/webrtc/call/call_unittest.cc
@@ -18,6 +18,7 @@
#include "webrtc/call/audio_state.h"
#include "webrtc/call/call.h"
#include "webrtc/call/fake_rtp_transport_controller_send.h"
+#include "webrtc/call/rtp_transport_controller_send.h"
#include "webrtc/logging/rtc_event_log/rtc_event_log.h"
#include "webrtc/modules/audio_device/include/mock_audio_device.h"
#include "webrtc/modules/audio_mixer/audio_mixer_impl.h"
@@ -40,9 +41,16 @@ struct CallHelper {
EXPECT_CALL(voice_engine_, audio_device_module());
EXPECT_CALL(voice_engine_, audio_processing());
EXPECT_CALL(voice_engine_, audio_transport());
+
+ rtp_transport_send_ = rtc::MakeUnique<webrtc::RtpTransportControllerSend>(
+ webrtc::Clock::GetRealTimeClock(), &event_log_);
+
webrtc::Call::Config config(&event_log_);
config.audio_state = webrtc::AudioState::Create(audio_state_config);
- call_.reset(webrtc::Call::Create(config));
+ config.audio_rtp_transport_send = rtp_transport_send_.get();
+ config.video_rtp_transport_send = rtp_transport_send_.get();
+ config.send_side_cc = rtp_transport_send_->send_side_cc();
+ call_ = rtc::WrapUnique(webrtc::Call::Create(config));
}
webrtc::Call* operator->() { return call_.get(); }
@@ -51,6 +59,7 @@ struct CallHelper {
private:
testing::NiceMock<webrtc::test::MockVoiceEngine> voice_engine_;
webrtc::RtcEventLogNullImpl event_log_;
+ std::unique_ptr<webrtc::RtpTransportControllerSend> rtp_transport_send_;
std::unique_ptr<webrtc::Call> call_;
};
} // namespace
@@ -320,15 +329,15 @@ TEST(CallTest, MultipleFlexfecReceiveStreamsProtectingSingleVideoStream) {
namespace {
struct CallBitrateHelper {
- CallBitrateHelper() : CallBitrateHelper(Call::Config(&event_log_)) {}
-
- explicit CallBitrateHelper(const Call::Config& config)
+ CallBitrateHelper()
: mock_cc_(Clock::GetRealTimeClock(), &event_log_, &packet_router_),
- call_(Call::Create(
- config,
- rtc::MakeUnique<FakeRtpTransportControllerSend>(&packet_router_,
- &mock_cc_))) {}
+ transport_send(&packet_router_, &mock_cc_) {
+ Call::Config config(&event_log_);
+ config.audio_rtp_transport_send = &transport_send;
+ config.video_rtp_transport_send = &transport_send;
+ call_ = rtc::WrapUnique(Call::Create(config));
+ }
webrtc::Call* operator->() { return call_.get(); }
testing::NiceMock<test::MockSendSideCongestionController>& mock_cc() {
return mock_cc_;
@@ -338,6 +347,7 @@ struct CallBitrateHelper {
webrtc::RtcEventLogNullImpl event_log_;
PacketRouter packet_router_;
testing::NiceMock<test::MockSendSideCongestionController> mock_cc_;
+ FakeRtpTransportControllerSend transport_send;
std::unique_ptr<Call> call_;
};
} // namespace
@@ -458,8 +468,13 @@ TEST(CallTest, RecreatingAudioStreamWithSameSsrcReusesRtpState) {
audio_state_config.audio_mixer = mock_mixer;
auto audio_state = AudioState::Create(audio_state_config);
RtcEventLogNullImpl event_log;
+ RtpTransportControllerSend rtp_transport_send(
+ webrtc::Clock::GetRealTimeClock(), &event_log);
Call::Config call_config(&event_log);
call_config.audio_state = audio_state;
+ call_config.audio_rtp_transport_send = &rtp_transport_send;
+ call_config.video_rtp_transport_send = &rtp_transport_send;
+ call_config.send_side_cc = rtp_transport_send.send_side_cc();
std::unique_ptr<Call> call(Call::Create(call_config));
auto create_stream_and_get_rtp_state = [&](uint32_t ssrc) {
« no previous file with comments | « webrtc/call/call.cc ('k') | webrtc/call/fake_rtp_transport_controller_send.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698