Index: webkit/fileapi/file_system_operation_unittest.cc |
=================================================================== |
--- webkit/fileapi/file_system_operation_unittest.cc (revision 68690) |
+++ webkit/fileapi/file_system_operation_unittest.cc (working copy) |
@@ -428,6 +428,48 @@ |
EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, status()); |
} |
+TEST_F(FileSystemOperationTest, TestCreateVeryLongName) { |
+ ScopedTempDir dir; |
+ ASSERT_TRUE(dir.CreateUniqueTempDir()); |
+ |
+#if defined(OS_WIN) |
+ FilePath dir_path(FILE_PATH_LITERAL("\\\\?\\") + dir.path().value()); |
kinuko
2010/12/15 00:09:30
Can we use FilePath::kExtendedPathPrefix?
Kavita Kanetkar
2010/12/16 00:48:55
Done.
|
+#else |
+ FilePath dir_path = dir.path(); |
+#endif |
+ |
+ // TODO(kkanetkar): Once each platform's limitations have been enforced |
+ // consider that in this test. Currently this test is for |
+ // windows primarily. |
+ FilePath dir1 = dir_path.AppendASCII( |
+ "012345678901234567890123456789012345678901234567890123456789" |
+ "012345678901234567890123456789012345678901234567890123456789" |
+ "0123456789012345678901234567890123456789012345"); |
+ |
+ FilePath dir2 = dir1.AppendASCII( |
+ "012345678901234567890123456789012345678901234567890123456789" |
+ "012345678901234567890123456789012345678901234567890123456789" |
+ "0123456789012345678901234567890123456789"); |
+ |
+ FilePath file = dir2.AppendASCII( |
+ "012345678901234567890123456789012345678901234567890123456789" |
+ "012345678901234567890123456789012345678901234567890123456789" |
+ "0123456789012345678901234567890123456789"); |
kinuko
2010/12/15 00:09:30
It might be better to define FilePath::String long
Kavita Kanetkar
2010/12/16 00:48:55
Done.
|
+ |
+ operation()->CreateDirectory(dir1, false, true); |
+ MessageLoop::current()->RunAllPending(); |
+ |
+ operation()->CreateDirectory(dir2, false, true); |
+ MessageLoop::current()->RunAllPending(); |
+ |
+ operation()->CreateFile(file, true); |
+ MessageLoop::current()->RunAllPending(); |
+ EXPECT_TRUE(file_util::PathExists(file)); |
+ // ScopedTempDir does not delete dir with long name since it does |
+ // not prefix \\?\. So Delete the long file here. |
+ EXPECT_TRUE(file_util::Delete(dir1, true)); |
+} |
+ |
TEST_F(FileSystemOperationTest, TestCreateFileSuccessFileExists) { |
// Already existing file and exclusive false. |
ScopedTempDir dir; |