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

Unified Diff: base/file_util_unittest.cc

Issue 197873014: Revert of Implement ScopedFD in terms of ScopedGeneric. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/file_util_posix.cc ('k') | base/files/scoped_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_unittest.cc
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index 8ee55ff4a7aed70857e44b3ce86a6fb610d962cf..96b585826ed4533388b95f13bd6637188c134fca 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -26,7 +26,6 @@
#include "base/file_util.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
-#include "base/files/scoped_file.h"
#include "base/files/scoped_temp_dir.h"
#include "base/path_service.h"
#include "base/strings/utf_string_conversions.h"
@@ -2474,9 +2473,9 @@
char c = 0;
ASSERT_EQ(0, pipe(fds));
const int write_end = fds[1];
- base::ScopedFD read_end_closer(fds[0]);
+ file_util::ScopedFDCloser read_end_closer(fds);
{
- base::ScopedFD write_end_closer(fds[1]);
+ file_util::ScopedFDCloser write_end_closer(fds + 1);
}
// This is the only thread. This file descriptor should no longer be valid.
int ret = close(write_end);
@@ -2490,14 +2489,14 @@
#if defined(GTEST_HAS_DEATH_TEST)
void CloseWithScopedFD(int fd) {
- base::ScopedFD fd_closer(fd);
+ file_util::ScopedFDCloser fd_closer(&fd);
}
#endif
TEST(ScopedFD, ScopedFDCrashesOnCloseFailure) {
int fds[2];
ASSERT_EQ(0, pipe(fds));
- base::ScopedFD read_end_closer(fds[0]);
+ file_util::ScopedFDCloser read_end_closer(fds);
EXPECT_EQ(0, IGNORE_EINTR(close(fds[1])));
#if defined(GTEST_HAS_DEATH_TEST)
// This is the only thread. This file descriptor should no longer be valid.
« no previous file with comments | « base/file_util_posix.cc ('k') | base/files/scoped_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698