Chromium Code Reviews| Index: webkit/fileapi/file_system_operation_unittest.cc |
| =================================================================== |
| --- webkit/fileapi/file_system_operation_unittest.cc (revision 69859) |
| +++ webkit/fileapi/file_system_operation_unittest.cc (working copy) |
| @@ -428,6 +428,44 @@ |
| 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(FilePath::kExtendedPathPrefix + dir.path().value()); |
|
kinuko
2010/12/22 23:20:49
Can we simply call GetLongPathHack() here?
Kavita Kanetkar
2010/12/23 03:14:28
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. |
| + const char kLongPathChar160[] = |
| + "012345678901234567890123456789012345678901234567890123456789" |
| + "012345678901234567890123456789012345678901234567890123456789" |
| + "0123456789012345678901234567890123456789"; |
| + |
| + FilePath dir1 = dir_path.AppendASCII(kLongPathChar160); |
| + |
| + FilePath dir2 = dir1.AppendASCII(kLongPathChar160); |
| + |
| + FilePath file = dir2.AppendASCII(kLongPathChar160); |
| + |
| + 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. |
| + // TODO(kkanetkat) Fix ScopedTempDir to work with extended paths. |
| + EXPECT_TRUE(file_util::Delete(dir1, true)); |
| +} |
| + |
| TEST_F(FileSystemOperationTest, TestCreateFileSuccessFileExists) { |
| // Already existing file and exclusive false. |
| ScopedTempDir dir; |