Index: base/files/dir_reader_posix_unittest.cc |
diff --git a/base/files/dir_reader_posix_unittest.cc b/base/files/dir_reader_posix_unittest.cc |
index 0685031a982c22772c8e187c5fc301578b9d0ea0..2e181b3d8517d9309f1e24e090fef2719901cf08 100644 |
--- a/base/files/dir_reader_posix_unittest.cc |
+++ b/base/files/dir_reader_posix_unittest.cc |
@@ -10,6 +10,7 @@ |
#include <string.h> |
#include <unistd.h> |
+#include "base/files/scoped_temp_dir.h" |
#include "base/logging.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -25,8 +26,9 @@ TEST(DirReaderPosixUnittest, Read) { |
if (DirReaderPosix::IsFallback()) |
return; |
- char kDirTemplate[] = "/tmp/org.chromium.dir-reader-posix-XXXXXX"; |
- const char* dir = mkdtemp(kDirTemplate); |
+ base::ScopedTempDir temp_dir; |
+ ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
+ const char* dir = temp_dir.path().value().c_str(); |
ASSERT_TRUE(dir); |
const int prev_wd = open(".", O_RDONLY | O_DIRECTORY); |