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

Unified Diff: base/file_util_unittest.cc

Issue 87003: Implement file_util::CountFilesCreatedAfter() for posix environments.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 8 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
« base/file_util_posix.cc ('K') | « base/file_util_posix.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_unittest.cc
===================================================================
--- base/file_util_unittest.cc (revision 14056)
+++ base/file_util_unittest.cc (working copy)
@@ -313,15 +313,19 @@
}
}
-// TODO(erikkay): implement
-#if defined OS_WIN
TEST_F(FileUtilTest, CountFilesCreatedAfter) {
// Create old file (that we don't want to count)
FilePath old_file_name = test_dir_.Append(FILE_PATH_LITERAL("Old File.txt"));
CreateTextFile(old_file_name, L"Just call me Mr. Creakybits");
// Age to perfection
+#if defined(OS_WIN)
Sleep(100);
+#elif defined(OS_POSIX)
+ // We need to wait at least one second here because the precision of
+ // file creation time is one second.
+ sleep(1);
Erik does not do reviews 2009/04/21 16:10:21 nit: for new code, it's probably better to use Pla
+#endif
// Establish our cutoff time
base::Time now(base::Time::NowFromSystemTime());
@@ -338,7 +342,6 @@
EXPECT_TRUE(file_util::Delete(new_file_name, false));
EXPECT_EQ(0, file_util::CountFilesCreatedAfter(test_dir_, now));
}
-#endif
// Tests that the Delete function works as expected, especially
// the recursion flag. Also coincidentally tests PathExists.
« base/file_util_posix.cc ('K') | « base/file_util_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698