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

Unified Diff: webkit/fileapi/sandbox_mount_point_provider_unittest.cc

Issue 10855039: Cleanup: Remove FileSystemFileUtil::{Directory,Path}Exists (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fix Created 8 years, 4 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/obfuscated_file_util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/sandbox_mount_point_provider_unittest.cc
diff --git a/webkit/fileapi/sandbox_mount_point_provider_unittest.cc b/webkit/fileapi/sandbox_mount_point_provider_unittest.cc
index 6d6b4dff2a8fdcc2439dbf8605b66f6d50f8a889..d66a379550a77068d85dbd2936c1ead3ef3cd0df 100644
--- a/webkit/fileapi/sandbox_mount_point_provider_unittest.cc
+++ b/webkit/fileapi/sandbox_mount_point_provider_unittest.cc
@@ -24,6 +24,7 @@
#include "webkit/fileapi/file_system_operation_context.h"
#include "webkit/fileapi/file_system_task_runners.h"
#include "webkit/fileapi/file_system_util.h"
+#include "webkit/fileapi/file_util_helper.h"
#include "webkit/fileapi/mock_file_system_options.h"
#include "webkit/quota/mock_special_storage_policy.h"
@@ -201,6 +202,16 @@ class SandboxMountPointProviderMigrationTest : public testing::Test {
return new FileSystemOperationContext(file_system_context_);
}
+ bool PathExists(const FileSystemURL& url) {
+ scoped_ptr<FileSystemOperationContext> context(NewContext());
+ return FileUtilHelper::PathExists(context.get(), file_util(), url);
+ }
+
+ bool DirectoryExists(const FileSystemURL& url) {
+ scoped_ptr<FileSystemOperationContext> context(NewContext());
+ return FileUtilHelper::DirectoryExists(context.get(), file_util(), url);
+ }
+
std::string URLAndTypeToSeedString(const GURL& origin_url,
fileapi::FileSystemType type) {
return GetOriginIdentifierFromURL(origin_url) +
@@ -216,39 +227,24 @@ class SandboxMountPointProviderMigrationTest : public testing::Test {
FileSystemURL root(origin_url, type, FilePath());
FileSystemURL seed = root.WithPath(root.path().Append(seed_file_path));
- context.reset(NewContext());
- EXPECT_TRUE(file_util()->DirectoryExists(
- context.get(), seed));
- context.reset(NewContext());
- EXPECT_TRUE(file_util()->DirectoryExists(
- context.get(), seed.WithPath(seed.path().Append(seed_file_path))));
- context.reset(NewContext());
- EXPECT_TRUE(file_util()->DirectoryExists(
- context.get(), seed.WithPath(seed.path().AppendASCII("d 0"))));
- context.reset(NewContext());
- EXPECT_TRUE(file_util()->DirectoryExists(
- context.get(), seed.WithPath(seed.path().AppendASCII("d 1"))));
- context.reset(NewContext());
- EXPECT_TRUE(file_util()->PathExists(
- context.get(), root.WithPath(root.path().AppendASCII("file 0"))));
- context.reset(NewContext());
- EXPECT_FALSE(file_util()->DirectoryExists(
- context.get(), seed.WithPath(seed.path().AppendASCII("file 0"))));
- context.reset(NewContext());
- EXPECT_TRUE(file_util()->PathExists(
- context.get(),
+ EXPECT_TRUE(DirectoryExists(seed));
+ EXPECT_TRUE(DirectoryExists(
+ seed.WithPath(seed.path().Append(seed_file_path))));
+ EXPECT_TRUE(DirectoryExists(
+ seed.WithPath(seed.path().AppendASCII("d 0"))));
+ EXPECT_TRUE(DirectoryExists(
+ seed.WithPath(seed.path().AppendASCII("d 1"))));
+ EXPECT_TRUE(PathExists(
+ root.WithPath(root.path().AppendASCII("file 0"))));
+ EXPECT_FALSE(DirectoryExists(
+ seed.WithPath(seed.path().AppendASCII("file 0"))));
+ EXPECT_TRUE(PathExists(
seed.WithPath(seed.path().AppendASCII("d 0").AppendASCII("file 1"))));
- context.reset(NewContext());
- EXPECT_FALSE(file_util()->DirectoryExists(
- context.get(),
+ EXPECT_FALSE(DirectoryExists(
seed.WithPath(seed.path().AppendASCII("d 0").AppendASCII("file 1"))));
- context.reset(NewContext());
- EXPECT_TRUE(file_util()->PathExists(
- context.get(),
+ EXPECT_TRUE(PathExists(
seed.WithPath(seed.path().AppendASCII("d 0").AppendASCII("file 2"))));
- context.reset(NewContext());
- EXPECT_FALSE(file_util()->DirectoryExists(
- context.get(),
+ EXPECT_FALSE(DirectoryExists(
seed.WithPath(seed.path().AppendASCII("d 0").AppendASCII("file 2"))));
}
« no previous file with comments | « webkit/fileapi/obfuscated_file_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698