| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/public/test/test_file_system_context.h" | 5 #include "content/public/test/test_file_system_context.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
| 8 #include "content/public/test/test_file_system_backend.h" | 8 #include "content/public/test/test_file_system_backend.h" |
| 9 #include "content/public/test/test_file_system_options.h" | 9 #include "content/public/test/test_file_system_options.h" |
| 10 #include "webkit/browser/fileapi/external_mount_points.h" | 10 #include "webkit/browser/fileapi/external_mount_points.h" |
| 11 #include "webkit/browser/fileapi/file_system_backend.h" | 11 #include "webkit/browser/fileapi/file_system_backend.h" |
| 12 #include "webkit/browser/fileapi/file_system_context.h" | 12 #include "webkit/browser/fileapi/file_system_context.h" |
| 13 #include "webkit/browser/quota/mock_special_storage_policy.h" | 13 #include "webkit/browser/quota/mock_special_storage_policy.h" |
| 14 | 14 |
| 15 namespace fileapi { | 15 namespace content { |
| 16 | 16 |
| 17 FileSystemContext* CreateFileSystemContextForTesting( | 17 fileapi::FileSystemContext* CreateFileSystemContextForTesting( |
| 18 quota::QuotaManagerProxy* quota_manager_proxy, | 18 quota::QuotaManagerProxy* quota_manager_proxy, |
| 19 const base::FilePath& base_path) { | 19 const base::FilePath& base_path) { |
| 20 ScopedVector<FileSystemBackend> additional_providers; | 20 ScopedVector<fileapi::FileSystemBackend> additional_providers; |
| 21 additional_providers.push_back(new TestFileSystemBackend( | 21 additional_providers.push_back(new TestFileSystemBackend( |
| 22 base::MessageLoopProxy::current().get(), base_path)); | 22 base::MessageLoopProxy::current().get(), base_path)); |
| 23 return CreateFileSystemContextWithAdditionalProvidersForTesting( | 23 return CreateFileSystemContextWithAdditionalProvidersForTesting( |
| 24 quota_manager_proxy, additional_providers.Pass(), base_path); | 24 quota_manager_proxy, additional_providers.Pass(), base_path); |
| 25 } | 25 } |
| 26 | 26 |
| 27 FileSystemContext* CreateFileSystemContextWithAdditionalProvidersForTesting( | 27 fileapi::FileSystemContext* |
| 28 CreateFileSystemContextWithAdditionalProvidersForTesting( |
| 28 quota::QuotaManagerProxy* quota_manager_proxy, | 29 quota::QuotaManagerProxy* quota_manager_proxy, |
| 29 ScopedVector<FileSystemBackend> additional_providers, | 30 ScopedVector<fileapi::FileSystemBackend> additional_providers, |
| 30 const base::FilePath& base_path) { | 31 const base::FilePath& base_path) { |
| 31 return new FileSystemContext( | 32 return new fileapi::FileSystemContext( |
| 32 base::MessageLoopProxy::current().get(), | 33 base::MessageLoopProxy::current().get(), |
| 33 base::MessageLoopProxy::current().get(), | 34 base::MessageLoopProxy::current().get(), |
| 34 ExternalMountPoints::CreateRefCounted().get(), | 35 fileapi::ExternalMountPoints::CreateRefCounted().get(), |
| 35 make_scoped_refptr(new quota::MockSpecialStoragePolicy()).get(), | 36 make_scoped_refptr(new quota::MockSpecialStoragePolicy()).get(), |
| 36 quota_manager_proxy, | 37 quota_manager_proxy, |
| 37 additional_providers.Pass(), | 38 additional_providers.Pass(), |
| 38 base_path, | 39 base_path, |
| 39 CreateAllowFileAccessOptions()); | 40 CreateAllowFileAccessOptions()); |
| 40 } | 41 } |
| 41 | 42 |
| 42 FileSystemContext* CreateIncognitoFileSystemContextForTesting( | 43 fileapi::FileSystemContext* CreateIncognitoFileSystemContextForTesting( |
| 43 quota::QuotaManagerProxy* quota_manager_proxy, | 44 quota::QuotaManagerProxy* quota_manager_proxy, |
| 44 const base::FilePath& base_path) { | 45 const base::FilePath& base_path) { |
| 45 ScopedVector<FileSystemBackend> additional_providers; | 46 ScopedVector<fileapi::FileSystemBackend> additional_providers; |
| 46 return new FileSystemContext( | 47 return new fileapi::FileSystemContext( |
| 47 base::MessageLoopProxy::current().get(), | 48 base::MessageLoopProxy::current().get(), |
| 48 base::MessageLoopProxy::current().get(), | 49 base::MessageLoopProxy::current().get(), |
| 49 ExternalMountPoints::CreateRefCounted().get(), | 50 fileapi::ExternalMountPoints::CreateRefCounted().get(), |
| 50 make_scoped_refptr(new quota::MockSpecialStoragePolicy()).get(), | 51 make_scoped_refptr(new quota::MockSpecialStoragePolicy()).get(), |
| 51 quota_manager_proxy, | 52 quota_manager_proxy, |
| 52 additional_providers.Pass(), | 53 additional_providers.Pass(), |
| 53 base_path, | 54 base_path, |
| 54 CreateIncognitoFileSystemOptions()); | 55 CreateIncognitoFileSystemOptions()); |
| 55 } | 56 } |
| 56 | 57 |
| 57 } // namespace fileapi | 58 } // namespace content |
| OLD | NEW |