| 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/scoped_vector.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 ScopedVector<storage::FileSystemBackend> additional_providers; | |
| 24 additional_providers.push_back(new 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 ScopedVector<storage::FileSystemBackend> additional_providers, | |
| 34 const base::FilePath& base_path) { | |
| 35 return new storage::FileSystemContext( | |
| 36 base::ThreadTaskRunnerHandle::Get().get(), | |
| 37 base::ThreadTaskRunnerHandle::Get().get(), | |
| 38 storage::ExternalMountPoints::CreateRefCounted().get(), | |
| 39 make_scoped_refptr(new MockSpecialStoragePolicy()).get(), | |
| 40 quota_manager_proxy, std::move(additional_providers), | |
| 41 std::vector<storage::URLRequestAutoMountHandler>(), base_path, | |
| 42 CreateAllowFileAccessOptions()); | |
| 43 } | |
| 44 | |
| 45 storage::FileSystemContext* CreateFileSystemContextWithAutoMountersForTesting( | |
| 46 storage::QuotaManagerProxy* quota_manager_proxy, | |
| 47 ScopedVector<storage::FileSystemBackend> additional_providers, | |
| 48 const std::vector<storage::URLRequestAutoMountHandler>& auto_mounters, | |
| 49 const base::FilePath& base_path) { | |
| 50 return new storage::FileSystemContext( | |
| 51 base::ThreadTaskRunnerHandle::Get().get(), | |
| 52 base::ThreadTaskRunnerHandle::Get().get(), | |
| 53 storage::ExternalMountPoints::CreateRefCounted().get(), | |
| 54 make_scoped_refptr(new MockSpecialStoragePolicy()).get(), | |
| 55 quota_manager_proxy, std::move(additional_providers), auto_mounters, | |
| 56 base_path, CreateAllowFileAccessOptions()); | |
| 57 } | |
| 58 | |
| 59 storage::FileSystemContext* CreateIncognitoFileSystemContextForTesting( | |
| 60 storage::QuotaManagerProxy* quota_manager_proxy, | |
| 61 const base::FilePath& base_path) { | |
| 62 ScopedVector<storage::FileSystemBackend> additional_providers; | |
| 63 return new storage::FileSystemContext( | |
| 64 base::ThreadTaskRunnerHandle::Get().get(), | |
| 65 base::ThreadTaskRunnerHandle::Get().get(), | |
| 66 storage::ExternalMountPoints::CreateRefCounted().get(), | |
| 67 make_scoped_refptr(new MockSpecialStoragePolicy()).get(), | |
| 68 quota_manager_proxy, std::move(additional_providers), | |
| 69 std::vector<storage::URLRequestAutoMountHandler>(), base_path, | |
| 70 CreateIncognitoFileSystemOptions()); | |
| 71 } | |
| 72 | |
| 73 } // namespace content | |
| OLD | NEW |