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

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

Issue 11417038: IsFileInUse should return false when the file doesn't exist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync past r168281 Created 8 years, 1 month 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/installer_state.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/installer_state_unittest.cc
diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc
index f62ea1bf216a8613d62017cce0e897ceb7a4a6f4..de1fcfccafc860fdb852afd80ad146bfa2577ecc 100644
--- a/chrome/installer/util/installer_state_unittest.cc
+++ b/chrome/installer/util/installer_state_unittest.cc
@@ -495,6 +495,17 @@ TEST_F(InstallerStateTest, IsFileInUse) {
EXPECT_FALSE(MockInstallerState::IsFileInUse(temp_file));
}
+TEST_F(InstallerStateTest, IsNonExistantFileInUse) {
+ base::ScopedTempDir temp_dir;
+ ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
+
+ FilePath temp_file;
+ ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir.path(), &temp_file));
+ ASSERT_TRUE(file_util::Delete(temp_file, false));
+
+ // There's no file, so it had better not be in use.
+ EXPECT_FALSE(MockInstallerState::IsFileInUse(temp_file));
+}
TEST_F(InstallerStateTest, RemoveOldVersionDirs) {
MockInstallerState installer_state;
« no previous file with comments | « chrome/installer/util/installer_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698