diff --git a/pc/peerconnectioninterface_unittest.cc b/pc/peerconnectioninterface_unittest.cc index cc063b4f74..fb38d6541c 100644 --- a/pc/peerconnectioninterface_unittest.cc +++ b/pc/peerconnectioninterface_unittest.cc @@ -43,6 +43,7 @@ #include "rtc_base/stringutils.h" #include "rtc_base/virtualsocketserver.h" #include "test/gmock.h" +#include "test/testsupport/fileutils.h" #ifdef WEBRTC_ANDROID #include "pc/test/androidtestinitializer.h" @@ -3207,10 +3208,19 @@ TEST_F(PeerConnectionInterfaceTest, // The RtcEventLog will be reset when the PeerConnection is closed. pc_->Close(); - rtc::PlatformFile file = 0; - int64_t max_size_bytes = 1024; + auto test_info = ::testing::UnitTest::GetInstance()->current_test_info(); + std::string filename = webrtc::test::OutputPath() + + test_info->test_case_name() + test_info->name(); + rtc::PlatformFile file = rtc::CreatePlatformFile(filename); + + constexpr int64_t max_size_bytes = 1024; + EXPECT_FALSE(pc_->StartRtcEventLog(file, max_size_bytes)); pc_->StopRtcEventLog(); + + // Cleanup. + rtc::ClosePlatformFile(file); + rtc::RemoveFile(filename); } // Test that generated offers/answers include "ice-option:trickle".