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

Unified Diff: base/file_util_unittest.cc

Issue 73075: First step to port file_util::CountFilesCreatedAfter().... (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
« no previous file with comments | « base/file_util.h ('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
===================================================================
--- base/file_util_unittest.cc (revision 13738)
+++ base/file_util_unittest.cc (working copy)
@@ -20,6 +20,7 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "base/string_util.h"
+#include "base/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -316,30 +317,26 @@
#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(L"Old File.txt");
+ 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
Sleep(100);
// Establish our cutoff time
- FILETIME test_start_time;
- GetSystemTimeAsFileTime(&test_start_time);
- EXPECT_EQ(0, file_util::CountFilesCreatedAfter(test_dir_.value(),
- test_start_time));
+ base::Time now(base::Time::Now());
+ EXPECT_EQ(0, file_util::CountFilesCreatedAfter(test_dir_, now));
// Create a new file (that we do want to count)
- FilePath new_file_name = test_dir_.Append(L"New File.txt");
+ FilePath new_file_name = test_dir_.Append(FILE_PATH_LITERAL("New File.txt"));
CreateTextFile(new_file_name, L"Waaaaaaaaaaaaaah.");
// We should see only the new file.
- EXPECT_EQ(1, file_util::CountFilesCreatedAfter(test_dir_.value(),
- test_start_time));
+ EXPECT_EQ(1, file_util::CountFilesCreatedAfter(test_dir_, now));
// Delete new file, we should see no files after cutoff now
EXPECT_TRUE(file_util::Delete(new_file_name, false));
- EXPECT_EQ(0, file_util::CountFilesCreatedAfter(test_dir_.value(),
- test_start_time));
+ EXPECT_EQ(0, file_util::CountFilesCreatedAfter(test_dir_, now));
}
#endif
« no previous file with comments | « base/file_util.h ('k') | base/file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698