| 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/file_system_context.h" | 5 #include "webkit/browser/fileapi/file_system_context.h" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "webkit/browser/fileapi/external_mount_points.h" | 11 #include "webkit/browser/fileapi/external_mount_points.h" |
| 12 #include "webkit/browser/fileapi/file_system_mount_point_provider.h" | 12 #include "webkit/browser/fileapi/file_system_backend.h" |
| 13 #include "webkit/browser/fileapi/file_system_task_runners.h" | 13 #include "webkit/browser/fileapi/file_system_task_runners.h" |
| 14 #include "webkit/browser/fileapi/isolated_context.h" | 14 #include "webkit/browser/fileapi/isolated_context.h" |
| 15 #include "webkit/browser/fileapi/mock_file_system_options.h" | 15 #include "webkit/browser/fileapi/mock_file_system_options.h" |
| 16 #include "webkit/browser/quota/mock_quota_manager.h" | 16 #include "webkit/browser/quota/mock_quota_manager.h" |
| 17 #include "webkit/browser/quota/mock_special_storage_policy.h" | 17 #include "webkit/browser/quota/mock_special_storage_policy.h" |
| 18 | 18 |
| 19 #define FPL(x) FILE_PATH_LITERAL(x) | 19 #define FPL(x) FILE_PATH_LITERAL(x) |
| 20 | 20 |
| 21 #if defined(FILE_PATH_USES_DRIVE_LETTERS) | 21 #if defined(FILE_PATH_USES_DRIVE_LETTERS) |
| 22 #define DRIVE FPL("C:") | 22 #define DRIVE FPL("C:") |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 storage_policy_.get()); | 57 storage_policy_.get()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 FileSystemContext* CreateFileSystemContextForTest( | 61 FileSystemContext* CreateFileSystemContextForTest( |
| 62 ExternalMountPoints* external_mount_points) { | 62 ExternalMountPoints* external_mount_points) { |
| 63 return new FileSystemContext(FileSystemTaskRunners::CreateMockTaskRunners(), | 63 return new FileSystemContext(FileSystemTaskRunners::CreateMockTaskRunners(), |
| 64 external_mount_points, | 64 external_mount_points, |
| 65 storage_policy_.get(), | 65 storage_policy_.get(), |
| 66 mock_quota_manager_->proxy(), | 66 mock_quota_manager_->proxy(), |
| 67 ScopedVector<FileSystemMountPointProvider>(), | 67 ScopedVector<FileSystemBackend>(), |
| 68 data_dir_.path(), | 68 data_dir_.path(), |
| 69 CreateAllowFileAccessOptions()); | 69 CreateAllowFileAccessOptions()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Verifies a *valid* filesystem url has expected values. | 72 // Verifies a *valid* filesystem url has expected values. |
| 73 void ExpectFileSystemURLMatches(const FileSystemURL& url, | 73 void ExpectFileSystemURLMatches(const FileSystemURL& url, |
| 74 const GURL& expect_origin, | 74 const GURL& expect_origin, |
| 75 FileSystemType expect_mount_type, | 75 FileSystemType expect_mount_type, |
| 76 FileSystemType expect_type, | 76 FileSystemType expect_type, |
| 77 const base::FilePath& expect_path, | 77 const base::FilePath& expect_path, |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 base::FilePath(DRIVE FPL("/test/isolated/root"))); | 319 base::FilePath(DRIVE FPL("/test/isolated/root"))); |
| 320 ExternalMountPoints::GetSystemInstance()->RevokeFileSystem("system"); | 320 ExternalMountPoints::GetSystemInstance()->RevokeFileSystem("system"); |
| 321 ExternalMountPoints::GetSystemInstance()->RevokeFileSystem("ext"); | 321 ExternalMountPoints::GetSystemInstance()->RevokeFileSystem("ext"); |
| 322 ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( | 322 ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( |
| 323 kIsolatedFileSystemID); | 323 kIsolatedFileSystemID); |
| 324 } | 324 } |
| 325 | 325 |
| 326 } // namespace | 326 } // namespace |
| 327 | 327 |
| 328 } // namespace fileapi | 328 } // namespace fileapi |
| OLD | NEW |