| 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 "storage/browser/fileapi/file_system_context.h" | 5 #include "storage/browser/fileapi/file_system_context.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "base/test/scoped_task_environment.h" |
| 12 #include "base/threading/thread_task_runner_handle.h" | 13 #include "base/threading/thread_task_runner_handle.h" |
| 13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 14 #include "content/browser/quota/mock_quota_manager.h" | 15 #include "content/browser/quota/mock_quota_manager.h" |
| 15 #include "content/public/test/mock_special_storage_policy.h" | 16 #include "content/public/test/mock_special_storage_policy.h" |
| 16 #include "content/public/test/test_file_system_options.h" | 17 #include "content/public/test/test_file_system_options.h" |
| 17 #include "storage/browser/fileapi/external_mount_points.h" | 18 #include "storage/browser/fileapi/external_mount_points.h" |
| 18 #include "storage/browser/fileapi/file_system_backend.h" | 19 #include "storage/browser/fileapi/file_system_backend.h" |
| 19 #include "storage/browser/fileapi/isolated_context.h" | 20 #include "storage/browser/fileapi/isolated_context.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 22 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 EXPECT_EQ(expect_origin, url.origin()); | 90 EXPECT_EQ(expect_origin, url.origin()); |
| 90 EXPECT_EQ(expect_mount_type, url.mount_type()); | 91 EXPECT_EQ(expect_mount_type, url.mount_type()); |
| 91 EXPECT_EQ(expect_type, url.type()); | 92 EXPECT_EQ(expect_type, url.type()); |
| 92 EXPECT_EQ(expect_path, url.path()); | 93 EXPECT_EQ(expect_path, url.path()); |
| 93 EXPECT_EQ(expect_virtual_path, url.virtual_path()); | 94 EXPECT_EQ(expect_virtual_path, url.virtual_path()); |
| 94 EXPECT_EQ(expect_filesystem_id, url.filesystem_id()); | 95 EXPECT_EQ(expect_filesystem_id, url.filesystem_id()); |
| 95 } | 96 } |
| 96 | 97 |
| 97 private: | 98 private: |
| 98 base::ScopedTempDir data_dir_; | 99 base::ScopedTempDir data_dir_; |
| 99 base::MessageLoop message_loop_; | 100 base::test::ScopedTaskEnvironment scoped_task_environment_; |
| 100 scoped_refptr<storage::SpecialStoragePolicy> storage_policy_; | 101 scoped_refptr<storage::SpecialStoragePolicy> storage_policy_; |
| 101 scoped_refptr<MockQuotaManager> mock_quota_manager_; | 102 scoped_refptr<MockQuotaManager> mock_quota_manager_; |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 // It is not valid to pass NULL ExternalMountPoints to FileSystemContext on | 105 // It is not valid to pass NULL ExternalMountPoints to FileSystemContext on |
| 105 // ChromeOS. | 106 // ChromeOS. |
| 106 #if !defined(OS_CHROMEOS) | 107 #if !defined(OS_CHROMEOS) |
| 107 TEST_F(FileSystemContextTest, NullExternalMountPoints) { | 108 TEST_F(FileSystemContextTest, NullExternalMountPoints) { |
| 108 scoped_refptr<FileSystemContext> file_system_context( | 109 scoped_refptr<FileSystemContext> file_system_context( |
| 109 CreateFileSystemContextForTest(NULL)); | 110 CreateFileSystemContextForTest(NULL)); |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 storage::kFileSystemTypeForTransientFile)); | 383 storage::kFileSystemTypeForTransientFile)); |
| 383 EXPECT_TRUE(file_system_context->GetFileSystemBackend( | 384 EXPECT_TRUE(file_system_context->GetFileSystemBackend( |
| 384 storage::kFileSystemTypeNativeLocal)); | 385 storage::kFileSystemTypeNativeLocal)); |
| 385 EXPECT_TRUE(file_system_context->GetFileSystemBackend( | 386 EXPECT_TRUE(file_system_context->GetFileSystemBackend( |
| 386 storage::kFileSystemTypeNativeForPlatformApp)); | 387 storage::kFileSystemTypeNativeForPlatformApp)); |
| 387 } | 388 } |
| 388 | 389 |
| 389 } // namespace | 390 } // namespace |
| 390 | 391 |
| 391 } // namespace content | 392 } // namespace content |
| OLD | NEW |