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

Unified Diff: base/file_util_unittest.cc

Issue 2153002: file_util: Convert the wstring version of IsDirectoryEmpty to FilePath. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: fix nit Created 10 years, 7 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.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 efe79c9d68f7248cb4a6f99aeb0c87a49e8b90c9..682376a975e9c8998d940085a9adb465f2720b8b 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -1622,4 +1622,20 @@ TEST_F(FileUtilTest, LastModified) {
ASSERT_TRUE(file_info.last_modified == modification_time);
}
+TEST_F(FileUtilTest, IsDirectoryEmpty) {
+ FilePath empty_dir = test_dir_.Append(FILE_PATH_LITERAL("EmptyDir"));
+
+ ASSERT_FALSE(file_util::PathExists(empty_dir));
+
+ ASSERT_TRUE(file_util::CreateDirectory(empty_dir));
+
+ EXPECT_TRUE(file_util::IsDirectoryEmpty(empty_dir));
+
+ FilePath foo(empty_dir.Append(FILE_PATH_LITERAL("foo.txt")));
+ std::string bar("baz");
+ ASSERT_TRUE(file_util::WriteFile(foo, bar.c_str(), bar.length()));
+
+ EXPECT_FALSE(file_util::IsDirectoryEmpty(empty_dir));
+}
+
} // namespace
« no previous file with comments | « base/file_util.cc ('k') | base/file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698