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

Unified Diff: webkit/fileapi/obfuscated_file_util_unittest.cc

Issue 8728029: Update mtime of directory when containee changed. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: '' Created 9 years, 1 month 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
Index: webkit/fileapi/obfuscated_file_util_unittest.cc
diff --git a/webkit/fileapi/obfuscated_file_util_unittest.cc b/webkit/fileapi/obfuscated_file_util_unittest.cc
index 75ba9568e8cf9d60c1d78cb705ef5c8005497f34..b4d8a642b0684ce47073763628451cc99548091b 100644
--- a/webkit/fileapi/obfuscated_file_util_unittest.cc
+++ b/webkit/fileapi/obfuscated_file_util_unittest.cc
@@ -1440,3 +1440,34 @@ TEST_F(ObfuscatedFileUtilTest, TestIncompleteDirectoryReading) {
ofu()->ReadDirectory(context.get(), FilePath(), &entries));
EXPECT_EQ(ARRAYSIZE_UNSAFE(kPath) - 1, entries.size());
}
+
+TEST_F(ObfuscatedFileUtilTest, TestDirectoryTimestamp) {
+ scoped_ptr<FileSystemOperationContext> context(NewContext(NULL));
+ const FilePath dir_path(FILE_PATH_LITERAL("foo_dir"));
+
+ // Create working directory.
+ EXPECT_EQ(base::PLATFORM_FILE_OK,
+ ofu()->CreateDirectory(context.get(), dir_path, false, false));
+
+ // Reset modification time.
+ context.reset(NewContext(NULL));
+ EXPECT_EQ(base::PLATFORM_FILE_OK,
+ ofu()->Touch(context.get(), dir_path, base::Time(), base::Time()));
ericu 2011/11/30 19:16:04 I'm not sure the round-trip from base::Time to wha
tzik 2011/12/01 16:28:46 Done.
+
+ // Create a file in the working directory.
+ bool created = false;
+ context.reset(NewContext(NULL));
+ EXPECT_EQ(base::PLATFORM_FILE_OK,
+ ofu()->EnsureFileExists(context.get(),
+ dir_path.AppendASCII("bar file"),
+ &created));
+ EXPECT_TRUE(created);
+
+ // Ensure modification time of the parent directory changed.
+ base::PlatformFileInfo file_info;
+ FilePath path;
+ context.reset(NewContext(NULL));
+ EXPECT_EQ(base::PLATFORM_FILE_OK,
+ ofu()->GetFileInfo(context.get(), dir_path, &file_info, &path));
+ EXPECT_NE(base::Time(), file_info.last_modified);
ericu 2011/11/30 19:16:04 Please also add tests for move, mkdir, copy, etc.,
tzik 2011/12/01 16:28:46 Done.
+}
« webkit/fileapi/obfuscated_file_util.cc ('K') | « webkit/fileapi/obfuscated_file_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698