Index: util/mac/xattr_test.cc |
diff --git a/util/mac/xattr_test.cc b/util/mac/xattr_test.cc |
index e6bbf7b1d4686bb543389f92c57257fca554f6b6..904a81e9c113c3a0d818f8d2f63263f53e122ee5 100644 |
--- a/util/mac/xattr_test.cc |
+++ b/util/mac/xattr_test.cc |
@@ -25,6 +25,7 @@ |
#include "base/strings/stringprintf.h" |
#include "gtest/gtest.h" |
#include "util/test/errors.h" |
+#include "util/test/scoped_temp_dir.h" |
namespace crashpad { |
namespace test { |
@@ -35,10 +36,7 @@ class Xattr : public testing::Test { |
// testing::Test: |
void SetUp() override { |
- path_ = base::FilePath( |
- base::StringPrintf("/tmp/com.googlecode.crashpad.test.xattr.%d.%p", |
- getpid(), this)); |
- // TODO(rsesek): This should use something like ScopedTempDir. |
+ path_ = temp_dir_.path().Append("xattr_file"); |
base::ScopedFD tmp(HANDLE_EINTR( |
open(path_.value().c_str(), O_CREAT | O_TRUNC, 0644))); |
EXPECT_GE(tmp.get(), 0) << ErrnoMessage("open"); |
@@ -51,6 +49,7 @@ class Xattr : public testing::Test { |
base::FilePath path() { return path_; } |
Mark Mentovai
2014/12/31 05:51:09
Missed this on the last one: it can be const, and
Robert Sesek
2015/01/02 17:34:08
Done.
|
private: |
+ ScopedTempDir temp_dir_; |
base::FilePath path_; |
}; |