OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "webkit/browser/fileapi/mock_file_system_context.h" | 5 #include "webkit/browser/fileapi/mock_file_system_context.h" |
6 | 6 |
7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
8 #include "webkit/browser/fileapi/external_mount_points.h" | 8 #include "webkit/browser/fileapi/external_mount_points.h" |
9 #include "webkit/browser/fileapi/file_system_context.h" | 9 #include "webkit/browser/fileapi/file_system_context.h" |
10 #include "webkit/browser/fileapi/file_system_mount_point_provider.h" | 10 #include "webkit/browser/fileapi/file_system_mount_point_provider.h" |
11 #include "webkit/browser/fileapi/file_system_task_runners.h" | 11 #include "webkit/browser/fileapi/file_system_task_runners.h" |
12 #include "webkit/browser/fileapi/mock_file_system_options.h" | 12 #include "webkit/browser/fileapi/mock_file_system_options.h" |
13 #include "webkit/browser/fileapi/test_mount_point_provider.h" | 13 #include "webkit/browser/fileapi/test_mount_point_provider.h" |
14 #include "webkit/browser/quota/mock_special_storage_policy.h" | 14 #include "webkit/browser/quota/mock_special_storage_policy.h" |
15 | 15 |
16 namespace fileapi { | 16 namespace fileapi { |
17 | 17 |
18 FileSystemContext* CreateFileSystemContextForTesting( | 18 FileSystemContext* CreateFileSystemContextForTesting( |
19 quota::QuotaManagerProxy* quota_manager_proxy, | 19 quota::QuotaManagerProxy* quota_manager_proxy, |
20 const base::FilePath& base_path) { | 20 const base::FilePath& base_path) { |
21 ScopedVector<FileSystemMountPointProvider> additional_providers; | 21 ScopedVector<FileSystemMountPointProvider> additional_providers; |
22 additional_providers.push_back( | 22 additional_providers.push_back(new TestMountPointProvider( |
23 new TestMountPointProvider( | 23 base::MessageLoopProxy::current().get(), base_path)); |
24 base::MessageLoopProxy::current(), base_path)); | |
25 return CreateFileSystemContextWithAdditionalProvidersForTesting( | 24 return CreateFileSystemContextWithAdditionalProvidersForTesting( |
26 quota_manager_proxy, additional_providers.Pass(), base_path); | 25 quota_manager_proxy, additional_providers.Pass(), base_path); |
27 } | 26 } |
28 | 27 |
29 FileSystemContext* CreateFileSystemContextWithAdditionalProvidersForTesting( | 28 FileSystemContext* CreateFileSystemContextWithAdditionalProvidersForTesting( |
30 quota::QuotaManagerProxy* quota_manager_proxy, | 29 quota::QuotaManagerProxy* quota_manager_proxy, |
31 ScopedVector<FileSystemMountPointProvider> additional_providers, | 30 ScopedVector<FileSystemMountPointProvider> additional_providers, |
32 const base::FilePath& base_path) { | 31 const base::FilePath& base_path) { |
33 return new FileSystemContext( | 32 return new FileSystemContext( |
34 FileSystemTaskRunners::CreateMockTaskRunners(), | 33 FileSystemTaskRunners::CreateMockTaskRunners(), |
35 ExternalMountPoints::CreateRefCounted().get(), | 34 ExternalMountPoints::CreateRefCounted().get(), |
36 make_scoped_refptr(new quota::MockSpecialStoragePolicy()), | 35 make_scoped_refptr(new quota::MockSpecialStoragePolicy()).get(), |
37 quota_manager_proxy, | 36 quota_manager_proxy, |
38 additional_providers.Pass(), | 37 additional_providers.Pass(), |
39 base_path, | 38 base_path, |
40 CreateAllowFileAccessOptions()); | 39 CreateAllowFileAccessOptions()); |
41 } | 40 } |
42 | 41 |
43 } // namespace fileapi | 42 } // namespace fileapi |
OLD | NEW |