Event log cleanup in tests.
TBR=stefan@webrtc.org BUG=none Review-Url: https://codereview.webrtc.org/2806723002 Cr-Commit-Position: refs/heads/master@{#17614}
This commit is contained in:
parent
fca900aa37
commit
4fb651dd22
@ -102,7 +102,7 @@ class BitrateEstimatorTest : public test::CallTest {
|
||||
virtual ~BitrateEstimatorTest() { EXPECT_TRUE(streams_.empty()); }
|
||||
|
||||
virtual void SetUp() {
|
||||
Call::Config config(&event_log_);
|
||||
Call::Config config(event_log_.get());
|
||||
receiver_call_.reset(Call::Create(config));
|
||||
sender_call_.reset(Call::Create(config));
|
||||
|
||||
|
||||
@ -158,9 +158,9 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec,
|
||||
AudioState::Config send_audio_state_config;
|
||||
send_audio_state_config.voice_engine = voice_engine;
|
||||
send_audio_state_config.audio_mixer = AudioMixerImpl::Create();
|
||||
Call::Config sender_config(&event_log_);
|
||||
Call::Config sender_config(event_log_.get());
|
||||
sender_config.audio_state = AudioState::Create(send_audio_state_config);
|
||||
Call::Config receiver_config(&event_log_);
|
||||
Call::Config receiver_config(event_log_.get());
|
||||
receiver_config.audio_state = sender_config.audio_state;
|
||||
CreateCalls(sender_config, receiver_config);
|
||||
|
||||
@ -719,7 +719,7 @@ TEST_F(CallPerfTest, KeepsHighBitrateWhenReconfiguringSender) {
|
||||
|
||||
Call::Config GetSenderCallConfig() override {
|
||||
Call::Config config = EndToEndTest::GetSenderCallConfig();
|
||||
config.event_log = &event_log_;
|
||||
config.event_log = event_log_.get();
|
||||
config.bitrate_config.start_bitrate_bps = kInitialBitrateKbps * 1000;
|
||||
return config;
|
||||
}
|
||||
|
||||
@ -51,6 +51,7 @@ PacketReceiver::DeliveryStatus CallTest::PayloadDemuxer::DeliverPacket(
|
||||
|
||||
CallTest::CallTest()
|
||||
: clock_(Clock::GetRealTimeClock()),
|
||||
event_log_(RtcEventLog::CreateNull()),
|
||||
video_send_config_(nullptr),
|
||||
video_send_stream_(nullptr),
|
||||
audio_send_config_(nullptr),
|
||||
@ -461,10 +462,10 @@ const uint32_t CallTest::kReceiverLocalVideoSsrc = 0x123456;
|
||||
const uint32_t CallTest::kReceiverLocalAudioSsrc = 0x1234567;
|
||||
const int CallTest::kNackRtpHistoryMs = 1000;
|
||||
|
||||
BaseTest::BaseTest() {}
|
||||
BaseTest::BaseTest() : event_log_(RtcEventLog::CreateNull()) {}
|
||||
|
||||
BaseTest::BaseTest(unsigned int timeout_ms) : RtpRtcpObserver(timeout_ms) {
|
||||
}
|
||||
BaseTest::BaseTest(unsigned int timeout_ms)
|
||||
: RtpRtcpObserver(timeout_ms), event_log_(RtcEventLog::CreateNull()) {}
|
||||
|
||||
BaseTest::~BaseTest() {
|
||||
}
|
||||
@ -482,11 +483,11 @@ void BaseTest::OnFakeAudioDevicesCreated(FakeAudioDevice* send_audio_device,
|
||||
}
|
||||
|
||||
Call::Config BaseTest::GetSenderCallConfig() {
|
||||
return Call::Config(&event_log_);
|
||||
return Call::Config(event_log_.get());
|
||||
}
|
||||
|
||||
Call::Config BaseTest::GetReceiverCallConfig() {
|
||||
return Call::Config(&event_log_);
|
||||
return Call::Config(event_log_.get());
|
||||
}
|
||||
|
||||
void BaseTest::OnCallsCreated(Call* sender_call, Call* receiver_call) {
|
||||
|
||||
@ -114,7 +114,7 @@ class CallTest : public ::testing::Test {
|
||||
|
||||
Clock* const clock_;
|
||||
|
||||
webrtc::RtcEventLogNullImpl event_log_;
|
||||
std::unique_ptr<webrtc::RtcEventLog> event_log_;
|
||||
std::unique_ptr<Call> sender_call_;
|
||||
std::unique_ptr<PacketTransport> send_transport_;
|
||||
VideoSendStream::Config video_send_config_;
|
||||
@ -227,7 +227,7 @@ class BaseTest : public RtpRtcpObserver {
|
||||
|
||||
virtual void OnTestFinished();
|
||||
|
||||
webrtc::RtcEventLogNullImpl event_log_;
|
||||
std::unique_ptr<webrtc::RtcEventLog> event_log_;
|
||||
};
|
||||
|
||||
class SendTest : public BaseTest {
|
||||
|
||||
@ -141,7 +141,7 @@ class EndToEndTest : public test::CallTest {
|
||||
};
|
||||
|
||||
TEST_F(EndToEndTest, ReceiverCanBeStartedTwice) {
|
||||
CreateCalls(Call::Config(&event_log_), Call::Config(&event_log_));
|
||||
CreateCalls(Call::Config(event_log_.get()), Call::Config(event_log_.get()));
|
||||
|
||||
test::NullTransport transport;
|
||||
CreateSendConfig(1, 0, 0, &transport);
|
||||
@ -156,7 +156,7 @@ TEST_F(EndToEndTest, ReceiverCanBeStartedTwice) {
|
||||
}
|
||||
|
||||
TEST_F(EndToEndTest, ReceiverCanBeStoppedTwice) {
|
||||
CreateCalls(Call::Config(&event_log_), Call::Config(&event_log_));
|
||||
CreateCalls(Call::Config(event_log_.get()), Call::Config(event_log_.get()));
|
||||
|
||||
test::NullTransport transport;
|
||||
CreateSendConfig(1, 0, 0, &transport);
|
||||
@ -171,7 +171,7 @@ TEST_F(EndToEndTest, ReceiverCanBeStoppedTwice) {
|
||||
}
|
||||
|
||||
TEST_F(EndToEndTest, ReceiverCanBeStoppedAndRestarted) {
|
||||
CreateCalls(Call::Config(&event_log_), Call::Config(&event_log_));
|
||||
CreateCalls(Call::Config(event_log_.get()), Call::Config(event_log_.get()));
|
||||
|
||||
test::NullTransport transport;
|
||||
CreateSendConfig(1, 0, 0, &transport);
|
||||
@ -208,7 +208,7 @@ TEST_F(EndToEndTest, RendersSingleDelayedFrame) {
|
||||
rtc::Event event_;
|
||||
} renderer;
|
||||
|
||||
CreateCalls(Call::Config(&event_log_), Call::Config(&event_log_));
|
||||
CreateCalls(Call::Config(event_log_.get()), Call::Config(event_log_.get()));
|
||||
|
||||
test::DirectTransport sender_transport(
|
||||
sender_call_.get(), MediaType::VIDEO);
|
||||
@ -258,7 +258,7 @@ TEST_F(EndToEndTest, TransmitsFirstFrame) {
|
||||
rtc::Event event_;
|
||||
} renderer;
|
||||
|
||||
CreateCalls(Call::Config(&event_log_), Call::Config(&event_log_));
|
||||
CreateCalls(Call::Config(event_log_.get()), Call::Config(event_log_.get()));
|
||||
|
||||
test::DirectTransport sender_transport(
|
||||
sender_call_.get(), MediaType::VIDEO);
|
||||
@ -984,7 +984,7 @@ TEST_F(EndToEndTest, ReceivedUlpfecPacketsNotNacked) {
|
||||
// TODO(holmer): Investigate why we don't send FEC packets when the bitrate
|
||||
// is 10 kbps.
|
||||
Call::Config GetSenderCallConfig() override {
|
||||
Call::Config config(&event_log_);
|
||||
Call::Config config(event_log_.get());
|
||||
const int kMinBitrateBps = 30000;
|
||||
config.bitrate_config.min_bitrate_bps = kMinBitrateBps;
|
||||
return config;
|
||||
@ -1318,7 +1318,7 @@ TEST_F(EndToEndTest, UnknownRtpPacketGivesUnknownSsrcReturnCode) {
|
||||
rtc::Event delivered_packet_;
|
||||
};
|
||||
|
||||
CreateCalls(Call::Config(&event_log_), Call::Config(&event_log_));
|
||||
CreateCalls(Call::Config(event_log_.get()), Call::Config(event_log_.get()));
|
||||
|
||||
test::DirectTransport send_transport(
|
||||
sender_call_.get(), MediaType::VIDEO);
|
||||
@ -1946,7 +1946,7 @@ TEST_F(EndToEndTest, ObserversEncodedFrames) {
|
||||
EncodedFrameTestObserver post_encode_observer;
|
||||
EncodedFrameTestObserver pre_decode_observer;
|
||||
|
||||
CreateCalls(Call::Config(&event_log_), Call::Config(&event_log_));
|
||||
CreateCalls(Call::Config(event_log_.get()), Call::Config(event_log_.get()));
|
||||
|
||||
test::DirectTransport sender_transport(
|
||||
sender_call_.get(), MediaType::VIDEO);
|
||||
@ -2121,7 +2121,7 @@ TEST_F(EndToEndTest, RembWithSendSideBwe) {
|
||||
}
|
||||
|
||||
Call::Config GetSenderCallConfig() override {
|
||||
Call::Config config(&event_log_);
|
||||
Call::Config config(event_log_.get());
|
||||
// Set a high start bitrate to reduce the test completion time.
|
||||
config.bitrate_config.start_bitrate_bps = remb_bitrate_bps_;
|
||||
return config;
|
||||
@ -2231,7 +2231,7 @@ class ProbingTest : public test::EndToEndTest {
|
||||
~ProbingTest() {}
|
||||
|
||||
Call::Config GetSenderCallConfig() override {
|
||||
Call::Config config(&event_log_);
|
||||
Call::Config config(event_log_.get());
|
||||
config.bitrate_config.start_bitrate_bps = start_bitrate_bps_;
|
||||
return config;
|
||||
}
|
||||
@ -3658,7 +3658,7 @@ void EndToEndTest::TestRtpStatePreservation(bool use_rtx,
|
||||
std::map<uint32_t, bool> ssrc_observed_ GUARDED_BY(crit_);
|
||||
} observer(use_rtx);
|
||||
|
||||
Call::Config config(&event_log_);
|
||||
Call::Config config(event_log_.get());
|
||||
CreateCalls(config, config);
|
||||
|
||||
test::PacketTransport send_transport(sender_call_.get(), &observer,
|
||||
@ -3956,7 +3956,7 @@ TEST_F(EndToEndTest, RespectsNetworkState) {
|
||||
TEST_F(EndToEndTest, CallReportsRttForSender) {
|
||||
static const int kSendDelayMs = 30;
|
||||
static const int kReceiveDelayMs = 70;
|
||||
CreateCalls(Call::Config(&event_log_), Call::Config(&event_log_));
|
||||
CreateCalls(Call::Config(event_log_.get()), Call::Config(event_log_.get()));
|
||||
|
||||
FakeNetworkPipe::Config config;
|
||||
config.queue_delay_ms = kSendDelayMs;
|
||||
@ -4003,7 +4003,7 @@ void EndToEndTest::VerifyNewVideoSendStreamsRespectNetworkState(
|
||||
MediaType network_to_bring_up,
|
||||
VideoEncoder* encoder,
|
||||
Transport* transport) {
|
||||
CreateSenderCall(Call::Config(&event_log_));
|
||||
CreateSenderCall(Call::Config(event_log_.get()));
|
||||
sender_call_->SignalChannelNetworkState(network_to_bring_up, kNetworkUp);
|
||||
|
||||
CreateSendConfig(1, 0, 0, transport);
|
||||
@ -4022,7 +4022,7 @@ void EndToEndTest::VerifyNewVideoSendStreamsRespectNetworkState(
|
||||
void EndToEndTest::VerifyNewVideoReceiveStreamsRespectNetworkState(
|
||||
MediaType network_to_bring_up,
|
||||
Transport* transport) {
|
||||
Call::Config config(&event_log_);
|
||||
Call::Config config(event_log_.get());
|
||||
CreateCalls(config, config);
|
||||
receiver_call_->SignalChannelNetworkState(network_to_bring_up, kNetworkUp);
|
||||
|
||||
|
||||
@ -1584,8 +1584,7 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) {
|
||||
<< "!";
|
||||
}
|
||||
|
||||
webrtc::RtcEventLogNullImpl event_log;
|
||||
Call::Config call_config(&event_log_);
|
||||
Call::Config call_config(event_log_.get());
|
||||
call_config.bitrate_config = params.call.call_bitrate_config;
|
||||
CreateCalls(call_config, call_config);
|
||||
|
||||
@ -1736,8 +1735,7 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
|
||||
|
||||
// TODO(ivica): Remove bitrate_config and use the default Call::Config(), to
|
||||
// match the full stack tests.
|
||||
webrtc::RtcEventLogNullImpl event_log;
|
||||
Call::Config call_config(&event_log_);
|
||||
Call::Config call_config(event_log_.get());
|
||||
call_config.bitrate_config = params_.call.call_bitrate_config;
|
||||
|
||||
::VoiceEngineState voe;
|
||||
|
||||
@ -64,7 +64,7 @@ class VideoSendStreamTest : public test::CallTest {
|
||||
};
|
||||
|
||||
TEST_F(VideoSendStreamTest, CanStartStartedStream) {
|
||||
CreateSenderCall(Call::Config(&event_log_));
|
||||
CreateSenderCall(Call::Config(event_log_.get()));
|
||||
|
||||
test::NullTransport transport;
|
||||
CreateSendConfig(1, 0, 0, &transport);
|
||||
@ -75,7 +75,7 @@ TEST_F(VideoSendStreamTest, CanStartStartedStream) {
|
||||
}
|
||||
|
||||
TEST_F(VideoSendStreamTest, CanStopStoppedStream) {
|
||||
CreateSenderCall(Call::Config(&event_log_));
|
||||
CreateSenderCall(Call::Config(event_log_.get()));
|
||||
|
||||
test::NullTransport transport;
|
||||
CreateSendConfig(1, 0, 0, &transport);
|
||||
@ -921,7 +921,7 @@ void VideoSendStreamTest::TestPacketFragmentationSize(VideoFormat format,
|
||||
}
|
||||
|
||||
Call::Config GetSenderCallConfig() override {
|
||||
Call::Config config(&event_log_);
|
||||
Call::Config config(event_log_.get());
|
||||
const int kMinBitrateBps = 30000;
|
||||
config.bitrate_config.min_bitrate_bps = kMinBitrateBps;
|
||||
return config;
|
||||
@ -1712,7 +1712,7 @@ TEST_F(VideoSendStreamTest,
|
||||
int last_initialized_frame_height_ GUARDED_BY(&crit_);
|
||||
};
|
||||
|
||||
CreateSenderCall(Call::Config(&event_log_));
|
||||
CreateSenderCall(Call::Config(event_log_.get()));
|
||||
test::NullTransport transport;
|
||||
CreateSendConfig(1, 0, 0, &transport);
|
||||
EncoderObserver encoder;
|
||||
@ -1768,7 +1768,7 @@ TEST_F(VideoSendStreamTest, CanReconfigureToUseStartBitrateAbovePreviousMax) {
|
||||
int start_bitrate_kbps_ GUARDED_BY(crit_);
|
||||
};
|
||||
|
||||
CreateSenderCall(Call::Config(&event_log_));
|
||||
CreateSenderCall(Call::Config(event_log_.get()));
|
||||
|
||||
test::NullTransport transport;
|
||||
CreateSendConfig(1, 0, 0, &transport);
|
||||
@ -1858,7 +1858,7 @@ TEST_F(VideoSendStreamTest, VideoSendStreamStopSetEncoderRateToZero) {
|
||||
rtc::Optional<int> bitrate_kbps_ GUARDED_BY(crit_);
|
||||
};
|
||||
|
||||
CreateSenderCall(Call::Config(&event_log_));
|
||||
CreateSenderCall(Call::Config(event_log_.get()));
|
||||
|
||||
test::NullTransport transport;
|
||||
CreateSendConfig(1, 0, 0, &transport);
|
||||
@ -1914,7 +1914,7 @@ TEST_F(VideoSendStreamTest, CapturesTextureAndVideoFrames) {
|
||||
};
|
||||
|
||||
// Initialize send stream.
|
||||
CreateSenderCall(Call::Config(&event_log_));
|
||||
CreateSenderCall(Call::Config(event_log_.get()));
|
||||
|
||||
test::NullTransport transport;
|
||||
CreateSendConfig(1, 0, 0, &transport);
|
||||
@ -2546,7 +2546,7 @@ TEST_F(VideoSendStreamTest, ReconfigureBitratesSetsEncoderBitratesCorrectly) {
|
||||
}
|
||||
|
||||
Call::Config GetSenderCallConfig() override {
|
||||
Call::Config config(&event_log_);
|
||||
Call::Config config(event_log_.get());
|
||||
config.bitrate_config.min_bitrate_bps = kMinBitrateKbps * 1000;
|
||||
config.bitrate_config.start_bitrate_bps = kStartBitrateKbps * 1000;
|
||||
config.bitrate_config.max_bitrate_bps = kMaxBitrateKbps * 1000;
|
||||
@ -3188,7 +3188,7 @@ TEST_F(VideoSendStreamTest, MAYBE_Vp9FlexModeRefCount) {
|
||||
|
||||
void VideoSendStreamTest::TestRequestSourceRotateVideo(
|
||||
bool support_orientation_ext) {
|
||||
CreateSenderCall(Call::Config(&event_log_));
|
||||
CreateSenderCall(Call::Config(event_log_.get()));
|
||||
|
||||
test::NullTransport transport;
|
||||
CreateSendConfig(1, 0, 0, &transport);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user