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

Unified Diff: webkit/fileapi/file_system_operation_unittest.cc

Issue 5754002: Moving away from shell api to support long path names on windows for filesystem. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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/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) {
Erik does not do reviews 2010/12/23 17:57:27 again, we may want to test a much longer path here
+ ScopedTempDir dir;
+ ASSERT_TRUE(dir.CreateUniqueTempDir());
+#if defined(OS_WIN)
+ FilePath dir_path(dir.path().GetLongPathHack());
Erik does not do reviews 2010/12/23 17:57:27 This wasn't really what I had in mind. We don't w
+#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;

Powered by Google App Engine
This is Rietveld 408576698