diff --git a/test/pc/e2e/BUILD.gn b/test/pc/e2e/BUILD.gn index ebf69c8bcd..c9666a257c 100644 --- a/test/pc/e2e/BUILD.gn +++ b/test/pc/e2e/BUILD.gn @@ -212,6 +212,8 @@ if (rtc_include_tests) { "../../../api:libjingle_peerconnection_api", "../../../api:scoped_refptr", "../../../api/units:time_delta", + "../../../logging:rtc_event_log_api", + "../../../logging:rtc_event_log_impl_output", "../../../pc:pc_test_utils", "../../../rtc_base:gunit_helpers", "../../../rtc_base:rtc_base", diff --git a/test/pc/e2e/api/peerconnection_quality_test_fixture.h b/test/pc/e2e/api/peerconnection_quality_test_fixture.h index 4ed1a5bbd8..cfb982f79c 100644 --- a/test/pc/e2e/api/peerconnection_quality_test_fixture.h +++ b/test/pc/e2e/api/peerconnection_quality_test_fixture.h @@ -173,8 +173,11 @@ class PeerConnectionE2EQualityTestFixture { struct Params { // If |video_configs| is empty - no video should be added to the test call. std::vector video_configs; - // If |audio_config| is presented audio stream will be configured + // If |audio_config| is set audio stream will be configured absl::optional audio_config; + // If |rtc_event_log_path| is set, an RTCEventLog will be saved in that + // location and it will be available for further analysis. + absl::optional rtc_event_log_path; PeerConnectionInterface::RTCConfiguration rtc_configuration; }; diff --git a/test/pc/e2e/peer_connection_quality_test.cc b/test/pc/e2e/peer_connection_quality_test.cc index c7bd0a657d..eb0da5ea85 100644 --- a/test/pc/e2e/peer_connection_quality_test.cc +++ b/test/pc/e2e/peer_connection_quality_test.cc @@ -18,6 +18,8 @@ #include "api/peer_connection_interface.h" #include "api/scoped_refptr.h" #include "api/units/time_delta.h" +#include "logging/rtc_event_log/output/rtc_event_log_output_file.h" +#include "logging/rtc_event_log/rtc_event_log.h" #include "pc/test/mock_peer_connection_observers.h" #include "rtc_base/bind.h" #include "rtc_base/gunit.h" @@ -184,6 +186,21 @@ void PeerConnectionE2EQualityTest::Run( RTC_LOG(INFO) << "video_analyzer_threads=" << video_analyzer_threads; video_quality_analyzer_injection_helper_->Start(video_analyzer_threads); + + // Start RTCEventLog recording if requested. + if (alice_->params()->rtc_event_log_path) { + auto alice_rtc_event_log = absl::make_unique( + alice_->params()->rtc_event_log_path.value()); + alice_->pc()->StartRtcEventLog(std::move(alice_rtc_event_log), + webrtc::RtcEventLog::kImmediateOutput); + } + if (bob_->params()->rtc_event_log_path) { + auto bob_rtc_event_log = absl::make_unique( + bob_->params()->rtc_event_log_path.value()); + bob_->pc()->StartRtcEventLog(std::move(bob_rtc_event_log), + webrtc::RtcEventLog::kImmediateOutput); + } + signaling_thread->Invoke( RTC_FROM_HERE, rtc::Bind(&PeerConnectionE2EQualityTest::SetupCallOnSignalingThread,