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

Unified Diff: webkit/fileapi/isolated_file_util_unittest.cc

Issue 13850004: Ignore symlinks in Drag-and-drop'ed folder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: indent fix Created 7 years, 8 months 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
« no previous file with comments | « webkit/fileapi/isolated_file_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/isolated_file_util_unittest.cc
diff --git a/webkit/fileapi/isolated_file_util_unittest.cc b/webkit/fileapi/isolated_file_util_unittest.cc
index 1c67fb4264fefe7992fc2c073a668f09311d74e9..8c86fa5f08000ba8972bc53f6b0657c16126a34c 100644
--- a/webkit/fileapi/isolated_file_util_unittest.cc
+++ b/webkit/fileapi/isolated_file_util_unittest.cc
@@ -370,8 +370,9 @@ TEST_F(IsolatedFileUtilTest, ReadDirectoryTest) {
base::FileUtilProxy::Entry> EntryMap;
EntryMap expected_entry_map;
+ base::FilePath dir_path = GetTestCasePlatformPath(test_case.path);
FileEnumerator file_enum(
- GetTestCasePlatformPath(test_case.path), false /* not recursive */,
+ dir_path, false /* not recursive */,
FileEnumerator::FILES | FileEnumerator::DIRECTORIES);
base::FilePath current;
while (!(current = file_enum.Next()).empty()) {
@@ -383,6 +384,16 @@ TEST_F(IsolatedFileUtilTest, ReadDirectoryTest) {
entry.size = FileEnumerator::GetFilesize(file_info);
entry.last_modified_time = FileEnumerator::GetLastModifiedTime(file_info);
expected_entry_map[entry.name] = entry;
+
+#if defined(OS_POSIX)
+ // Creates a symlink for each file/directory.
+ // They should be ignored by ReadDirectory, so we don't add them
+ // to expected_entry_map.
+ file_util::CreateSymbolicLink(
+ current,
+ dir_path.Append(current.BaseName().AddExtension(
+ FILE_PATH_LITERAL("link"))));
+#endif
}
// Perform ReadDirectory in the isolated filesystem.
« no previous file with comments | « webkit/fileapi/isolated_file_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698