summaryrefslogtreecommitdiffstats
path: root/base/file_util_unittest.cc
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-23 19:39:10 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-23 19:39:10 +0000
commit8d60757991fd8e74e2d6d8a25912d24c47e9a421 (patch)
treedc406e291ef6aade6c98402b91bc1946c9952b2d /base/file_util_unittest.cc
parenta5d1e1e2cf6deb70a8476fd1f970c697274cbca7 (diff)
downloadchromium_src-8d60757991fd8e74e2d6d8a25912d24c47e9a421.zip
chromium_src-8d60757991fd8e74e2d6d8a25912d24c47e9a421.tar.gz
chromium_src-8d60757991fd8e74e2d6d8a25912d24c47e9a421.tar.bz2
Revert "Add a TouchFile function that operates on FilePaths + fixing a bug"
This reverts commit 60322. TBR=dumi TEST=none BUG=none Review URL: http://codereview.chromium.org/3439019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60327 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_unittest.cc')
-rw-r--r--base/file_util_unittest.cc16
1 files changed, 3 insertions, 13 deletions
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index ca36b6a..068e5e50 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -1753,7 +1753,7 @@ TEST_F(FileUtilTest, Contains) {
#endif
}
-TEST_F(FileUtilTest, TouchFile) {
+TEST_F(FileUtilTest, LastModified) {
FilePath data_dir =
temp_dir_.path().Append(FILE_PATH_LITERAL("FilePathTest"));
@@ -1767,25 +1767,15 @@ TEST_F(FileUtilTest, TouchFile) {
std::string data("hello");
ASSERT_TRUE(file_util::WriteFile(foobar, data.c_str(), data.length()));
- base::Time access_time;
- // This timestamp is divisible by one day (in local timezone),
- // to make it work on FAT too.
- ASSERT_TRUE(base::Time::FromString(L"Wed, 16 Nov 1994, 00:00:00",
- &access_time));
-
base::Time modification_time;
// Note that this timestamp is divisible by two (seconds) - FAT stores
// modification times with 2s resolution.
ASSERT_TRUE(base::Time::FromString(L"Tue, 15 Nov 1994, 12:45:26 GMT",
&modification_time));
-
- ASSERT_TRUE(file_util::TouchFile(foobar, access_time, modification_time));
+ ASSERT_TRUE(file_util::SetLastModifiedTime(foobar, modification_time));
base::PlatformFileInfo file_info;
ASSERT_TRUE(file_util::GetFileInfo(foobar, &file_info));
- EXPECT_EQ(file_info.last_accessed.ToInternalValue(),
- access_time.ToInternalValue());
- EXPECT_EQ(file_info.last_modified.ToInternalValue(),
- modification_time.ToInternalValue());
+ ASSERT_TRUE(file_info.last_modified == modification_time);
}
TEST_F(FileUtilTest, IsDirectoryEmpty) {