diff options
author | pbos@webrtc.org <pbos@webrtc.org> | 2015-01-02 09:01:20 +0000 |
---|---|---|
committer | pbos@webrtc.org <pbos@webrtc.org> | 2015-01-02 09:01:20 +0000 |
commit | c62749fb471a9bf30b05a270c532c49ebea2f03d (patch) | |
tree | 2a84e416417c0d7b4beb917e902bc9ede74b0d4e /talk/session | |
parent | 3a70625caf816c6506b09f5a574fae4f8cb37386 (diff) | |
download | webrtc-c62749fb471a9bf30b05a270c532c49ebea2f03d.tar.gz |
Parallelize MediaRecorder unittests.
Exchanging static filenames for temporary ones, permitting tests to be
run in parallel without conflicting parallel uses of the same filenames.
TBR=juberti@webrtc.org
BUG=2597
TEST=third_party/gtest-parallel/gtest-parallel -w 64 -r 100 out/Debug/libjingle_p2p_unittest
Review URL: https://webrtc-codereview.appspot.com/34589004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7987 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'talk/session')
-rw-r--r-- | talk/session/media/mediarecorder_unittest.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/talk/session/media/mediarecorder_unittest.cc b/talk/session/media/mediarecorder_unittest.cc index b71a9845d2..1e2d822a03 100644 --- a/talk/session/media/mediarecorder_unittest.cc +++ b/talk/session/media/mediarecorder_unittest.cc @@ -51,7 +51,7 @@ class RtpDumpSinkTest : public testing::Test { public: virtual void SetUp() { EXPECT_TRUE(rtc::Filesystem::GetTemporaryFolder(path_, true, NULL)); - path_.SetFilename("sink-test.rtpdump"); + path_.SetPathname(rtc::Filesystem::TempFilename(path_, "sink-test")); sink_.reset(new RtpDumpSink(Open(path_.pathname()))); for (int i = 0; i < ARRAY_SIZE(rtp_buf_); ++i) { @@ -185,10 +185,10 @@ void TestMediaRecorder(BaseChannel* channel, // Add the channel to the recorder. rtc::Pathname path; EXPECT_TRUE(rtc::Filesystem::GetTemporaryFolder(path, true, NULL)); - path.SetFilename("send.rtpdump"); - std::string send_file = path.pathname(); - path.SetFilename("recv.rtpdump"); - std::string recv_file = path.pathname(); + std::string send_file = + rtc::Filesystem::TempFilename(path, "send"); + std::string recv_file = + rtc::Filesystem::TempFilename(path, "recv"); if (video_media_channel) { EXPECT_TRUE(recorder->AddChannel(static_cast<VideoChannel*>(channel), Open(send_file), Open(recv_file), filter)); @@ -260,10 +260,10 @@ void TestRecordHeaderAndMedia(BaseChannel* channel, rtc::Pathname path; EXPECT_TRUE(rtc::Filesystem::GetTemporaryFolder(path, true, NULL)); - path.SetFilename("send-header.rtpdump"); - std::string send_header_file = path.pathname(); - path.SetFilename("recv-header.rtpdump"); - std::string recv_header_file = path.pathname(); + std::string send_header_file = + rtc::Filesystem::TempFilename(path, "send-header"); + std::string recv_header_file = + rtc::Filesystem::TempFilename(path, "recv-header"); if (video_media_channel) { EXPECT_TRUE(header_recorder->AddChannel( static_cast<VideoChannel*>(channel), @@ -292,10 +292,10 @@ void TestRecordHeaderAndMedia(BaseChannel* channel, // Create RTP header recorder. rtc::scoped_ptr<MediaRecorder> recorder(new MediaRecorder); - path.SetFilename("send.rtpdump"); - std::string send_file = path.pathname(); - path.SetFilename("recv.rtpdump"); - std::string recv_file = path.pathname(); + std::string send_file = + rtc::Filesystem::TempFilename(path, "send"); + std::string recv_file = + rtc::Filesystem::TempFilename(path, "recv"); if (video_media_channel) { EXPECT_TRUE(recorder->AddChannel( static_cast<VideoChannel*>(channel), |