summaryrefslogtreecommitdiffstats
path: root/base/file_util_unittest.cc
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-15 16:58:27 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-15 16:58:27 +0000
commit807b930a4890f8e86dfd770a571b49eca0c1b4a6 (patch)
tree572323f1e64a884fe4befb334cfec11e85aad2eb /base/file_util_unittest.cc
parent55bb2b11a6c372f70445fd11e211f53944214fa7 (diff)
downloadchromium_src-807b930a4890f8e86dfd770a571b49eca0c1b4a6.zip
chromium_src-807b930a4890f8e86dfd770a571b49eca0c1b4a6.tar.gz
chromium_src-807b930a4890f8e86dfd770a571b49eca0c1b4a6.tar.bz2
Reverting 13748.
Review URL: http://codereview.chromium.org/73084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_unittest.cc')
-rw-r--r--base/file_util_unittest.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index df30817..7f24fc5 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -20,7 +20,6 @@
#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"
@@ -317,26 +316,30 @@ TEST_F(FileUtilTest, GetDirectoryFromPath) {
#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"));
+ FilePath old_file_name = test_dir_.Append(L"Old File.txt");
CreateTextFile(old_file_name, L"Just call me Mr. Creakybits");
// Age to perfection
Sleep(100);
// Establish our cutoff time
- base::Time now(base::Time::Now());
- EXPECT_EQ(0, file_util::CountFilesCreatedAfter(test_dir_, now));
+ FILETIME test_start_time;
+ GetSystemTimeAsFileTime(&test_start_time);
+ EXPECT_EQ(0, file_util::CountFilesCreatedAfter(test_dir_.value(),
+ test_start_time));
// Create a new file (that we do want to count)
- FilePath new_file_name = test_dir_.Append(FILE_PATH_LITERAL("New File.txt"));
+ FilePath new_file_name = test_dir_.Append(L"New File.txt");
CreateTextFile(new_file_name, L"Waaaaaaaaaaaaaah.");
// We should see only the new file.
- EXPECT_EQ(1, file_util::CountFilesCreatedAfter(test_dir_, now));
+ EXPECT_EQ(1, file_util::CountFilesCreatedAfter(test_dir_.value(),
+ test_start_time));
// 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_, now));
+ EXPECT_EQ(0, file_util::CountFilesCreatedAfter(test_dir_.value(),
+ test_start_time));
}
#endif