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

Unified Diff: webkit/fileapi/isolated_file_util_unittest.cc

Issue 11960003: Cleanup: Move more recursive operation logic from FileUtilHelper to FileUtil (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 11 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') | webkit/fileapi/local_file_util.h » ('j') | 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 b5e77c558cd09c10e07c5cd4eadef17529b9f129..57ef51aa99b4a0a0c64434e7f138c027f8d27c2b 100644
--- a/webkit/fileapi/isolated_file_util_unittest.cc
+++ b/webkit/fileapi/isolated_file_util_unittest.cc
@@ -50,6 +50,14 @@ FilePath GetTopLevelPath(const FilePath& path) {
return FilePath(components[0]);
}
+bool IsDirectoryEmpty(FileSystemOperationContext* context,
+ FileSystemFileUtil* file_util,
+ const FileSystemURL& url) {
+ scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> file_enum =
+ file_util->CreateFileEnumerator(context, url, false /* recursive */);
+ return file_enum->Next().empty();
+}
+
} // namespace
// TODO(kinuko): we should have separate tests for DraggedFileUtil and
@@ -196,8 +204,8 @@ class IsolatedFileUtilTest : public testing::Test {
if (file_enum2->IsDirectory()) {
FileSystemOperationContext context1(file_system_context());
FileSystemOperationContext context2(file_system_context());
- EXPECT_EQ(file_util1->IsDirectoryEmpty(&context1, url1),
- file_util2->IsDirectoryEmpty(&context2, url2));
+ EXPECT_EQ(IsDirectoryEmpty(&context1, file_util1, url1),
+ IsDirectoryEmpty(&context2, file_util2, url2));
continue;
}
EXPECT_TRUE(file_set1.find(relative) != file_set1.end());
« no previous file with comments | « webkit/fileapi/isolated_file_util.cc ('k') | webkit/fileapi/local_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698