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

Unified Diff: base/file_util_unittest.cc

Issue 319543004: Move and rename FdopenPlatformFile to file_util (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/file_util_win.cc » ('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 83f211f5e95218e3acf184d4b5a0d4766bacdfff..239563d304e15f0ee2b78b1aa357d16cb89bbd09 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -1685,6 +1685,21 @@ TEST_F(FileUtilTest, CreateAndOpenTemporaryFileTest) {
}
}
+TEST_F(FileUtilTest, FileToFILE) {
+ File file;
+ FILE* stream = FileToFILE(file.Pass(), "w");
+ EXPECT_FALSE(stream);
+
+ FilePath file_name = temp_dir_.path().Append(FPL("The file.txt"));
+ file = File(file_name, File::FLAG_CREATE | File::FLAG_WRITE);
+ EXPECT_TRUE(file.IsValid());
+
+ stream = FileToFILE(file.Pass(), "w");
+ EXPECT_TRUE(stream);
+ EXPECT_FALSE(file.IsValid());
+ EXPECT_TRUE(CloseFile(stream));
+}
+
TEST_F(FileUtilTest, CreateNewTempDirectoryTest) {
FilePath temp_dir;
ASSERT_TRUE(CreateNewTempDirectory(FilePath::StringType(), &temp_dir));
« no previous file with comments | « base/file_util_posix.cc ('k') | base/file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698