Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3215)

Unified Diff: base/files/dir_reader_posix_unittest.cc

Issue 1273243002: Updates to base unittests so they run correctly in libchrome on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Existing tests using ScopedLocale are wrapped by OS_LINUX, trying that Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/command_line_unittest.cc ('k') | base/files/file_path_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « base/command_line_unittest.cc ('k') | base/files/file_path_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698