Ensure TestPeers are destroyed at the end of Run.

In order to correctly close audio dump files, TestPeers have to be
destroyed after the call is finished.

Bug: webrtc:10138
Change-Id: I948e4e1844dfbffd1eef7926a4dd4d7631dbe632
Reviewed-on: https://webrtc-review.googlesource.com/c/122301
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26661}
This commit is contained in:
Mirko Bonadei
2019-02-13 09:07:55 +01:00
committed by Commit Bot
parent 6aca0b743e
commit 2bd54a1bd9
6 changed files with 83 additions and 75 deletions

View File

@ -38,16 +38,15 @@ class PeerConnectionE2EQualityTest
using RunParams = PeerConnectionE2EQualityTestFixture::RunParams;
using VideoConfig = PeerConnectionE2EQualityTestFixture::VideoConfig;
PeerConnectionE2EQualityTest(
std::unique_ptr<InjectableComponents> alice_components,
std::unique_ptr<Params> alice_params,
std::unique_ptr<InjectableComponents> bob_components,
std::unique_ptr<Params> bob_params,
std::unique_ptr<Analyzers> analyzers);
PeerConnectionE2EQualityTest(std::unique_ptr<Analyzers> analyzers);
~PeerConnectionE2EQualityTest() override = default;
void Run(RunParams run_params) override;
void Run(std::unique_ptr<InjectableComponents> alice_components,
std::unique_ptr<Params> alice_params,
std::unique_ptr<InjectableComponents> bob_components,
std::unique_ptr<Params> bob_params,
RunParams run_params) override;
private:
// Sets video stream labels that are not specified in VideoConfigs to unique
@ -63,7 +62,7 @@ class PeerConnectionE2EQualityTest
std::unique_ptr<FrameGenerator> CreateFrameGenerator(
const VideoConfig& video_config);
void AddAudio(TestPeer* peer);
void SetupCall(TestPeer* alice, TestPeer* bob);
void SetupCall();
void WaitForTransceiversSetup(Params* params, TestPeer* remote_peer);
void SetupVideoSink(Params* params, TestPeer* remote_peer);
void StartVideo();
@ -77,7 +76,6 @@ class PeerConnectionE2EQualityTest
video_quality_analyzer_injection_helper_;
std::unique_ptr<SingleProcessEncodedImageIdInjector>
encoded_image_id_controller_;
const std::unique_ptr<rtc::Thread> signaling_thread_;
std::unique_ptr<TestPeer> alice_;
std::unique_ptr<TestPeer> bob_;