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
This commit is contained in:
pbos@webrtc.org 2015-01-05 17:56:33 +00:00
parent 433006a6c2
commit 76bc981b2d

View File

@ -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_;
};