diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-26 01:40:12 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-26 01:40:12 +0000 |
commit | b33f1d943fd420857d9c5988ce1f4598f9a8765a (patch) | |
tree | 8bb2ca934346bb21198ca95c5294d15643181662 /base/file_util_unittest.cc | |
parent | c06f3007c6f5f565501d33343de89c229f356e7a (diff) | |
download | chromium_src-b33f1d943fd420857d9c5988ce1f4598f9a8765a.zip chromium_src-b33f1d943fd420857d9c5988ce1f4598f9a8765a.tar.gz chromium_src-b33f1d943fd420857d9c5988ce1f4598f9a8765a.tar.bz2 |
file_util: Convert the wstring version of IsDirectoryEmpty to FilePath.
BUG=24672
TEST=compiles
Review URL: http://codereview.chromium.org/2153002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48237 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_unittest.cc')
-rw-r--r-- | base/file_util_unittest.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc index efe79c9..682376a 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 |