| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/public/test/test_file_system_context.h" | |
| 6 | |
| 7 #include <utility> | |
| 8 | |
| 9 #include "base/memory/ptr_util.h" | |
| 10 #include "base/threading/thread_task_runner_handle.h" | |
| 11 #include "content/public/test/mock_special_storage_policy.h" | |
| 12 #include "content/public/test/test_file_system_backend.h" | |
| 13 #include "content/public/test/test_file_system_options.h" | |
| 14 #include "storage/browser/fileapi/external_mount_points.h" | |
| 15 #include "storage/browser/fileapi/file_system_backend.h" | |
| 16 #include "storage/browser/fileapi/file_system_context.h" | |
| 17 | |
| 18 namespace content { | |
| 19 | |
| 20 storage::FileSystemContext* CreateFileSystemContextForTesting( | |
| 21 storage::QuotaManagerProxy* quota_manager_proxy, | |
| 22 const base::FilePath& base_path) { | |
| 23 std::vector<std::unique_ptr<storage::FileSystemBackend>> additional_providers; | |
| 24 additional_providers.push_back(base::MakeUnique<TestFileSystemBackend>( | |
| 25 base::ThreadTaskRunnerHandle::Get().get(), base_path)); | |
| 26 return CreateFileSystemContextWithAdditionalProvidersForTesting( | |
| 27 quota_manager_proxy, std::move(additional_providers), base_path); | |
| 28 } | |
| 29 | |
| 30 storage::FileSystemContext* | |
| 31 CreateFileSystemContextWithAdditionalProvidersForTesting( | |
| 32 storage::QuotaManagerProxy* quota_manager_proxy, | |
| 33 std::vector<std::unique_ptr<storage::FileSystemBackend>> | |
| 34 additional_providers, | |
| 35 const base::FilePath& base_path) { | |
| 36 return new storage::FileSystemContext( | |
| 37 base::ThreadTaskRunnerHandle::Get().get(), | |
| 38 base::ThreadTaskRunnerHandle::Get().get(), | |
| 39 storage::ExternalMountPoints::CreateRefCounted().get(), | |
| 40 make_scoped_refptr(new MockSpecialStoragePolicy()).get(), | |
| 41 quota_manager_proxy, std::move(additional_providers), | |
| 42 std::vector<storage::URLRequestAutoMountHandler>(), base_path, | |
| 43 CreateAllowFileAccessOptions()); | |
| 44 } | |
| 45 | |
| 46 storage::FileSystemContext* CreateFileSystemContextWithAutoMountersForTesting( | |
| 47 storage::QuotaManagerProxy* quota_manager_proxy, | |
| 48 std::vector<std::unique_ptr<storage::FileSystemBackend>> | |
| 49 additional_providers, | |
| 50 const std::vector<storage::URLRequestAutoMountHandler>& auto_mounters, | |
| 51 const base::FilePath& base_path) { | |
| 52 return new storage::FileSystemContext( | |
| 53 base::ThreadTaskRunnerHandle::Get().get(), | |
| 54 base::ThreadTaskRunnerHandle::Get().get(), | |
| 55 storage::ExternalMountPoints::CreateRefCounted().get(), | |
| 56 make_scoped_refptr(new MockSpecialStoragePolicy()).get(), | |
| 57 quota_manager_proxy, std::move(additional_providers), auto_mounters, | |
| 58 base_path, CreateAllowFileAccessOptions()); | |
| 59 } | |
| 60 | |
| 61 storage::FileSystemContext* CreateIncognitoFileSystemContextForTesting( | |
| 62 storage::QuotaManagerProxy* quota_manager_proxy, | |
| 63 const base::FilePath& base_path) { | |
| 64 return new storage::FileSystemContext( | |
| 65 base::ThreadTaskRunnerHandle::Get().get(), | |
| 66 base::ThreadTaskRunnerHandle::Get().get(), | |
| 67 storage::ExternalMountPoints::CreateRefCounted().get(), | |
| 68 make_scoped_refptr(new MockSpecialStoragePolicy()).get(), | |
| 69 quota_manager_proxy, | |
| 70 std::vector<std::unique_ptr<storage::FileSystemBackend>>(), | |
| 71 std::vector<storage::URLRequestAutoMountHandler>(), base_path, | |
| 72 CreateIncognitoFileSystemOptions()); | |
| 73 } | |
| 74 | |
| 75 } // namespace content | |
| OLD | NEW |