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

Unified Diff: test/scoped_temp_dir_test.cc

Issue 1390023002: Add FileWriteMode::kCreateOrFail (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Test that kReuseOrCreate can create Created 5 years, 2 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 | « test/file.cc ('k') | test/test.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/scoped_temp_dir_test.cc
diff --git a/test/scoped_temp_dir_test.cc b/test/scoped_temp_dir_test.cc
index 6f3ce3a382b6d34a17b14566764935798149c7c7..ea8b067b4851e946061e01ec7a10f5cd4e89ca32 100644
--- a/test/scoped_temp_dir_test.cc
+++ b/test/scoped_temp_dir_test.cc
@@ -14,15 +14,14 @@
#include "test/scoped_temp_dir.h"
-#include <errno.h>
#include <fcntl.h>
#include <string.h>
-#include <sys/stat.h>
#include "base/posix/eintr_wrapper.h"
#include "build/build_config.h"
#include "gtest/gtest.h"
#include "test/errors.h"
+#include "test/file.h"
#if defined(OS_POSIX)
#include <unistd.h>
@@ -35,26 +34,6 @@ namespace crashpad {
namespace test {
namespace {
-bool FileExists(const base::FilePath& path) {
-#if defined(OS_POSIX)
- struct stat st;
- int rv = lstat(path.value().c_str(), &st);
- const char stat_function[] = "lstat";
-#elif defined(OS_WIN)
- struct _stat st;
- int rv = _wstat(path.value().c_str(), &st);
- const char stat_function[] = "_wstat";
-#else
-#error "Not implemented"
-#endif
- if (rv < 0) {
- EXPECT_EQ(ENOENT, errno) << ErrnoMessage(stat_function) << " "
- << path.value();
- return false;
- }
- return true;
-}
-
void CreateFile(const base::FilePath& path) {
#if defined(OS_POSIX)
int fd = HANDLE_EINTR(creat(path.value().c_str(), 0644));
« no previous file with comments | « test/file.cc ('k') | test/test.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698