Allows injection of network controller factory in test fixture.

Bug: webrtc:9155
Change-Id: I929c4cde66ad6743b4a8df2df3abfa7593992977
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134645
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27843}
This commit is contained in:
Sebastian Jansson 2019-04-30 14:23:51 +02:00 committed by Commit Bot
parent 6cb6f08b13
commit 1391ed242a
5 changed files with 9 additions and 0 deletions

View file

@ -196,6 +196,7 @@ rtc_source_set("video_quality_test_fixture_api") {
"../call:rtp_interfaces",
"../test:test_common",
"../test:video_test_common",
"transport:network_control",
"video_codecs:video_codecs_api",
]
}

View file

@ -21,6 +21,7 @@
#include "api/media_types.h"
#include "api/network_state_predictor.h"
#include "api/test/simulated_network.h"
#include "api/transport/network_control.h"
#include "api/video_codecs/video_encoder_config.h"
namespace webrtc {
@ -123,6 +124,8 @@ class VideoQualityTestFixtureInterface {
std::unique_ptr<FecControllerFactoryInterface> fec_controller_factory;
std::unique_ptr<NetworkStatePredictorFactoryInterface>
network_state_predictor_factory;
std::unique_ptr<NetworkControllerFactoryInterface>
network_controller_factory;
};
virtual ~VideoQualityTestFixtureInterface() = default;

View file

@ -220,6 +220,7 @@ void CallTest::CreateSenderCall(const Call::Config& config) {
auto sender_config = config;
sender_config.network_state_predictor_factory =
network_state_predictor_factory_.get();
sender_config.network_controller_factory = network_controller_factory_.get();
sender_call_.reset(Call::Create(sender_config));
}

View file

@ -204,6 +204,8 @@ class CallTest : public ::testing::Test {
std::unique_ptr<FecControllerFactoryInterface> fec_controller_factory_;
std::unique_ptr<NetworkStatePredictorFactoryInterface>
network_state_predictor_factory_;
std::unique_ptr<NetworkControllerFactoryInterface>
network_controller_factory_;
test::FunctionVideoEncoderFactory fake_encoder_factory_;
int fake_encoder_max_bitrate_ = -1;

View file

@ -363,6 +363,8 @@ VideoQualityTest::VideoQualityTest(
std::move(injection_components_->fec_controller_factory);
network_state_predictor_factory_ =
std::move(injection_components_->network_state_predictor_factory);
network_controller_factory_ =
std::move(injection_components_->network_controller_factory);
}
VideoQualityTest::Params::Params()