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

Unified Diff: chrome/installer/util/self_cleaning_temp_dir_unittest.cc

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « chrome/installer/util/self_cleaning_temp_dir.cc ('k') | chrome/installer/util/shell_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/self_cleaning_temp_dir_unittest.cc
diff --git a/chrome/installer/util/self_cleaning_temp_dir_unittest.cc b/chrome/installer/util/self_cleaning_temp_dir_unittest.cc
index c9416191c29227a4898b6b95bcaddd5e6928947c..a752f177d7556da24ca339c845a63b4d0bad85d6 100644
--- a/chrome/installer/util/self_cleaning_temp_dir_unittest.cc
+++ b/chrome/installer/util/self_cleaning_temp_dir_unittest.cc
@@ -74,14 +74,14 @@ TEST_F(SelfCleaningTempDirTest, RemoveUnusedOnDelete) {
SelfCleaningTempDir temp_dir;
EXPECT_TRUE(temp_dir.Initialize(parent_temp_dir, L"Three"));
EXPECT_EQ(parent_temp_dir.Append(L"Three"), temp_dir.path());
- EXPECT_TRUE(file_util::DirectoryExists(temp_dir.path()));
+ EXPECT_TRUE(base::DirectoryExists(temp_dir.path()));
EXPECT_TRUE(temp_dir.Delete());
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.Append(L"Three")));
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir));
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.DirName()));
- EXPECT_TRUE(file_util::DirectoryExists(parent_temp_dir.DirName().DirName()));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.Append(L"Three")));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.DirName()));
+ EXPECT_TRUE(base::DirectoryExists(parent_temp_dir.DirName().DirName()));
EXPECT_TRUE(work_dir.Delete());
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.DirName().DirName()));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.DirName().DirName()));
}
// Test that two clients can work in the same area.
@@ -101,23 +101,23 @@ TEST_F(SelfCleaningTempDirTest, TwoClients) {
// Both clients are where they are expected.
EXPECT_EQ(parent_temp_dir.Append(L"Three"), temp_dir1.path());
EXPECT_EQ(parent_temp_dir.Append(L"Three"), temp_dir2.path());
- EXPECT_TRUE(file_util::DirectoryExists(temp_dir1.path()));
- EXPECT_TRUE(file_util::DirectoryExists(temp_dir2.path()));
+ EXPECT_TRUE(base::DirectoryExists(temp_dir1.path()));
+ EXPECT_TRUE(base::DirectoryExists(temp_dir2.path()));
// Second client goes away.
EXPECT_TRUE(temp_dir2.Delete());
// The first is now useless.
- EXPECT_FALSE(file_util::DirectoryExists(temp_dir1.path()));
+ EXPECT_FALSE(base::DirectoryExists(temp_dir1.path()));
// But the intermediate dirs are still present
- EXPECT_TRUE(file_util::DirectoryExists(parent_temp_dir));
+ EXPECT_TRUE(base::DirectoryExists(parent_temp_dir));
// Now the first goes away.
EXPECT_TRUE(temp_dir1.Delete());
// And cleans up after itself.
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.Append(L"Three")));
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir));
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.DirName()));
- EXPECT_TRUE(file_util::DirectoryExists(parent_temp_dir.DirName().DirName()));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.Append(L"Three")));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.DirName()));
+ EXPECT_TRUE(base::DirectoryExists(parent_temp_dir.DirName().DirName()));
EXPECT_TRUE(work_dir.Delete());
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.DirName().DirName()));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.DirName().DirName()));
}
// Test that all intermediate dirs are cleaned up if they're empty when the
@@ -133,14 +133,14 @@ TEST_F(SelfCleaningTempDirTest, RemoveUnusedOnDestroy) {
SelfCleaningTempDir temp_dir;
EXPECT_TRUE(temp_dir.Initialize(parent_temp_dir, L"Three"));
EXPECT_EQ(parent_temp_dir.Append(L"Three"), temp_dir.path());
- EXPECT_TRUE(file_util::DirectoryExists(temp_dir.path()));
+ EXPECT_TRUE(base::DirectoryExists(temp_dir.path()));
}
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.Append(L"Three")));
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir));
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.DirName()));
- EXPECT_TRUE(file_util::DirectoryExists(parent_temp_dir.DirName().DirName()));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.Append(L"Three")));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.DirName()));
+ EXPECT_TRUE(base::DirectoryExists(parent_temp_dir.DirName().DirName()));
EXPECT_TRUE(work_dir.Delete());
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.DirName().DirName()));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.DirName().DirName()));
}
// Test that intermediate dirs are left behind if they're not empty when the
@@ -158,16 +158,16 @@ TEST_F(SelfCleaningTempDirTest, LeaveUsedOnDestroy) {
SelfCleaningTempDir temp_dir;
EXPECT_TRUE(temp_dir.Initialize(parent_temp_dir, L"Three"));
EXPECT_EQ(parent_temp_dir.Append(L"Three"), temp_dir.path());
- EXPECT_TRUE(file_util::DirectoryExists(temp_dir.path()));
+ EXPECT_TRUE(base::DirectoryExists(temp_dir.path()));
// Drop a file somewhere.
EXPECT_EQ(arraysize(kHiHon) - 1,
file_util::WriteFile(parent_temp_dir.Append(GetRandomFilename()),
kHiHon, arraysize(kHiHon) - 1));
}
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.Append(L"Three")));
- EXPECT_TRUE(file_util::DirectoryExists(parent_temp_dir));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.Append(L"Three")));
+ EXPECT_TRUE(base::DirectoryExists(parent_temp_dir));
EXPECT_TRUE(work_dir.Delete());
- EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.DirName().DirName()));
+ EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.DirName().DirName()));
}
} // namespace installer
« no previous file with comments | « chrome/installer/util/self_cleaning_temp_dir.cc ('k') | chrome/installer/util/shell_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698