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

Unified Diff: base/file_util_unittest.cc

Issue 600104: Actually delete databases in CookiesTreeModel. (Closed)
Patch Set: fixed comments Created 10 years, 10 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_posix.cc ('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
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index 35233bac79a516802346d3350a9f7d63a437bfac..31bb46fe42a208209e02f9024ef7b2d93cb11c7c 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -1389,4 +1389,28 @@ TEST_F(FileUtilTest, Contains) {
#endif
}
+TEST_F(FileUtilTest, LastModified) {
+ FilePath data_dir = test_dir_.Append(FILE_PATH_LITERAL("FilePathTest"));
+
+ // Create a fresh, empty copy of this directory.
+ if (file_util::PathExists(data_dir)) {
+ ASSERT_TRUE(file_util::Delete(data_dir, true));
+ }
+ ASSERT_TRUE(file_util::CreateDirectory(data_dir));
+
+ FilePath foobar(data_dir.Append(FILE_PATH_LITERAL("foobar.txt")));
+ std::string data("hello");
+ ASSERT_TRUE(file_util::WriteFile(foobar, data.c_str(), data.length()));
+
+ 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::SetLastModifiedTime(foobar, modification_time));
+ file_util::FileInfo file_info;
+ ASSERT_TRUE(file_util::GetFileInfo(foobar, &file_info));
+ ASSERT_TRUE(file_info.last_modified == modification_time);
+}
+
} // namespace
« no previous file with comments | « base/file_util_posix.cc ('k') | base/file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698