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

Unified Diff: base/file_util_unittest.cc

Issue 191673003: 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
Index: base/file_util_unittest.cc
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index 96b585826ed4533388b95f13bd6637188c134fca..8ee55ff4a7aed70857e44b3ce86a6fb610d962cf 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -26,6 +26,7 @@
#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"
@@ -2473,9 +2474,9 @@ TEST(ScopedFD, ScopedFDDoesClose) {
char c = 0;
ASSERT_EQ(0, pipe(fds));
const int write_end = fds[1];
- file_util::ScopedFDCloser read_end_closer(fds);
+ base::ScopedFD read_end_closer(fds[0]);
{
- file_util::ScopedFDCloser write_end_closer(fds + 1);
+ base::ScopedFD write_end_closer(fds[1]);
}
// This is the only thread. This file descriptor should no longer be valid.
int ret = close(write_end);
@@ -2489,14 +2490,14 @@ TEST(ScopedFD, ScopedFDDoesClose) {
#if defined(GTEST_HAS_DEATH_TEST)
void CloseWithScopedFD(int fd) {
- file_util::ScopedFDCloser fd_closer(&fd);
+ base::ScopedFD fd_closer(fd);
}
#endif
TEST(ScopedFD, ScopedFDCrashesOnCloseFailure) {
int fds[2];
ASSERT_EQ(0, pipe(fds));
- file_util::ScopedFDCloser read_end_closer(fds);
+ base::ScopedFD read_end_closer(fds[0]);
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.

Powered by Google App Engine
This is Rietveld 408576698