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.
|
+} |