| 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 60ad07eb9cd28570dfa90e2cd8f4bb3a40138d0d..3830392b09f2e62c5ea480b15576393ad8df11df 100644
|
| --- a/webkit/fileapi/sandbox_mount_point_provider_unittest.cc
|
| +++ b/webkit/fileapi/sandbox_mount_point_provider_unittest.cc
|
| @@ -20,42 +20,40 @@
|
| #include "googleurl/src/gurl.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "webkit/fileapi/file_system_context.h"
|
| +#include "webkit/fileapi/file_system_mount_point_provider.h"
|
| #include "webkit/fileapi/file_system_operation_context.h"
|
| -#include "webkit/fileapi/file_system_path_manager.h"
|
| #include "webkit/fileapi/file_system_util.h"
|
| +#include "webkit/fileapi/mock_file_system_options.h"
|
| #include "webkit/quota/mock_special_storage_policy.h"
|
|
|
| namespace fileapi {
|
|
|
| -class MockFileSystemPathManager : public FileSystemPathManager {
|
| - public:
|
| - explicit MockFileSystemPathManager(const FilePath& profile_path)
|
| - : FileSystemPathManager(base::MessageLoopProxy::current(),
|
| - profile_path, NULL, false, true) {}
|
| -};
|
| -
|
| class SandboxMountPointProviderOriginEnumeratorTest : public testing::Test {
|
| public:
|
| void SetUp() {
|
| ASSERT_TRUE(data_dir_.CreateUniqueTempDir());
|
| - path_manager_.reset(new MockFileSystemPathManager(data_dir_.path()));
|
| + sandbox_provider_.reset(
|
| + new SandboxMountPointProvider(
|
| + base::MessageLoopProxy::current(),
|
| + data_dir_.path(),
|
| + new MockFileSystemOptions()));
|
| }
|
|
|
| SandboxMountPointProvider::OriginEnumerator* CreateEnumerator() const {
|
| - return path_manager_->sandbox_provider()->CreateOriginEnumerator();
|
| + return sandbox_provider_->CreateOriginEnumerator();
|
| }
|
|
|
| protected:
|
| void CreateOriginTypeDirectory(const GURL& origin,
|
| fileapi::FileSystemType type) {
|
| - FilePath target = path_manager_->sandbox_provider()->
|
| + FilePath target = sandbox_provider_->
|
| GetBaseDirectoryForOriginAndType(origin, type, true);
|
| ASSERT_TRUE(!target.empty());
|
| ASSERT_TRUE(file_util::DirectoryExists(target));
|
| }
|
|
|
| ScopedTempDir data_dir_;
|
| - scoped_ptr<FileSystemPathManager> path_manager_;
|
| + scoped_ptr<SandboxMountPointProvider> sandbox_provider_;
|
| };
|
|
|
| TEST_F(SandboxMountPointProviderOriginEnumeratorTest, Empty) {
|
| @@ -139,8 +137,6 @@ class SandboxMountPointProviderMigrationTest : public testing::Test {
|
|
|
| void SetUp() {
|
| ASSERT_TRUE(data_dir_.CreateUniqueTempDir());
|
| - path_manager_ = new MockFileSystemPathManager(data_dir_.path());
|
| -
|
| scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy =
|
| new quota::MockSpecialStoragePolicy;
|
| special_storage_policy->SetAllUnlimited(true);
|
| @@ -150,17 +146,11 @@ class SandboxMountPointProviderMigrationTest : public testing::Test {
|
| special_storage_policy,
|
| NULL,
|
| data_dir_.path(),
|
| - false, // incognito
|
| - true, // allow_file_access_from_files
|
| - path_manager_);
|
| - }
|
| -
|
| - FileSystemPathManager* path_manager() {
|
| - return path_manager_;
|
| + new MockFileSystemOptions());
|
| }
|
|
|
| SandboxMountPointProvider* sandbox_provider() {
|
| - return path_manager()->sandbox_provider();
|
| + return file_system_context_->sandbox_provider();
|
| }
|
|
|
| FileSystemFileUtil* file_util() {
|
| @@ -172,7 +162,7 @@ class SandboxMountPointProviderMigrationTest : public testing::Test {
|
| EXPECT_FALSE(success); // We told it not to create.
|
| }
|
|
|
| - FileSystemPathManager::GetRootPathCallback GetRootPathCallback() {
|
| + FileSystemMountPointProvider::GetRootPathCallback GetRootPathCallback() {
|
| return base::Bind(&SandboxMountPointProviderMigrationTest::OnGetRootPath,
|
| weak_factory_.GetWeakPtr());
|
| }
|
| @@ -218,7 +208,7 @@ class SandboxMountPointProviderMigrationTest : public testing::Test {
|
| std::string URLAndTypeToSeedString(const GURL& origin_url,
|
| fileapi::FileSystemType type) {
|
| return GetOriginIdentifierFromURL(origin_url) +
|
| - FileSystemPathManager::GetFileSystemTypeString(type);
|
| + GetFileSystemTypeString(type);
|
| }
|
|
|
| void ValidateDataInNewFileSystem(
|
| @@ -357,7 +347,6 @@ class SandboxMountPointProviderMigrationTest : public testing::Test {
|
|
|
| protected:
|
| ScopedTempDir data_dir_;
|
| - FileSystemPathManager* path_manager_;
|
| scoped_refptr<FileSystemContext> file_system_context_;
|
| base::WeakPtrFactory<SandboxMountPointProviderMigrationTest> weak_factory_;
|
| };
|
|
|