From 76bc981b2d602020729815d4e26bee232f9394b0 Mon Sep 17 00:00:00 2001 From: "pbos@webrtc.org" Date: Mon, 5 Jan 2015 17:56:33 +0000 Subject: [PATCH] Use a temp file in FileLockTest. Permits running FileLockTests in parallel as the lock files don't conflict with concurrent runs. BUG=4137 R=pthatcher@webrtc.org Review URL: https://webrtc-codereview.appspot.com/37519004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7996 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/base/filelock_unittest.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webrtc/base/filelock_unittest.cc b/webrtc/base/filelock_unittest.cc index af81c0fc8a..cf2d3fef9b 100644 --- a/webrtc/base/filelock_unittest.cc +++ b/webrtc/base/filelock_unittest.cc @@ -40,8 +40,9 @@ class FileLockTest : public testing::Test, public Runnable { protected: virtual void SetUp() { thread_lock_failed_ = false; - Filesystem::GetAppTempFolder(&temp_dir_); - temp_file_ = Pathname(temp_dir_.pathname(), kLockFile); + Pathname temp_dir; + Filesystem::GetAppTempFolder(&temp_dir); + temp_file_.SetPathname(rtc::Filesystem::TempFilename(temp_dir, kLockFile)); } void LockOnThread() { @@ -52,7 +53,6 @@ class FileLockTest : public testing::Test, public Runnable { Event done_; Thread locker_; bool thread_lock_failed_; - Pathname temp_dir_; Pathname temp_file_; };