| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
| 12 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
| 17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 18 #include "base/strings/string_piece.h" | 18 #include "base/strings/string_piece.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 20 #include "base/threading/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "content/public/test/mock_special_storage_policy.h" | 22 #include "content/public/test/mock_special_storage_policy.h" |
| 23 #include "content/public/test/test_file_system_backend.h" | 23 #include "content/public/test/test_file_system_backend.h" |
| 24 #include "content/public/test/test_file_system_context.h" | 24 #include "content/public/test/test_file_system_context.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 void TearDown() override { | 148 void TearDown() override { |
| 149 // NOTE: order matters, request must die before delegate | 149 // NOTE: order matters, request must die before delegate |
| 150 request_.reset(NULL); | 150 request_.reset(NULL); |
| 151 delegate_.reset(NULL); | 151 delegate_.reset(NULL); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void SetUpAutoMountContext(base::FilePath* mnt_point) { | 154 void SetUpAutoMountContext(base::FilePath* mnt_point) { |
| 155 *mnt_point = temp_dir_.GetPath().AppendASCII("auto_mount_dir"); | 155 *mnt_point = temp_dir_.GetPath().AppendASCII("auto_mount_dir"); |
| 156 ASSERT_TRUE(base::CreateDirectory(*mnt_point)); | 156 ASSERT_TRUE(base::CreateDirectory(*mnt_point)); |
| 157 | 157 |
| 158 ScopedVector<storage::FileSystemBackend> additional_providers; | 158 std::vector<std::unique_ptr<storage::FileSystemBackend>> |
| 159 additional_providers.push_back(new TestFileSystemBackend( | 159 additional_providers; |
| 160 additional_providers.push_back(base::MakeUnique<TestFileSystemBackend>( |
| 160 base::ThreadTaskRunnerHandle::Get().get(), *mnt_point)); | 161 base::ThreadTaskRunnerHandle::Get().get(), *mnt_point)); |
| 161 | 162 |
| 162 std::vector<storage::URLRequestAutoMountHandler> handlers; | 163 std::vector<storage::URLRequestAutoMountHandler> handlers; |
| 163 handlers.push_back(base::Bind(&TestAutoMountForURLRequest)); | 164 handlers.push_back(base::Bind(&TestAutoMountForURLRequest)); |
| 164 | 165 |
| 165 file_system_context_ = CreateFileSystemContextWithAutoMountersForTesting( | 166 file_system_context_ = CreateFileSystemContextWithAutoMountersForTesting( |
| 166 NULL, std::move(additional_providers), handlers, temp_dir_.GetPath()); | 167 NULL, std::move(additional_providers), handlers, temp_dir_.GetPath()); |
| 167 } | 168 } |
| 168 | 169 |
| 169 void OnOpenFileSystem(const GURL& root_url, | 170 void OnOpenFileSystem(const GURL& root_url, |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 ASSERT_FALSE(request_->is_pending()); | 449 ASSERT_FALSE(request_->is_pending()); |
| 449 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, delegate_->request_status()); | 450 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, delegate_->request_status()); |
| 450 | 451 |
| 451 ASSERT_FALSE( | 452 ASSERT_FALSE( |
| 452 storage::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( | 453 storage::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( |
| 453 kValidExternalMountPoint)); | 454 kValidExternalMountPoint)); |
| 454 } | 455 } |
| 455 | 456 |
| 456 } // namespace | 457 } // namespace |
| 457 } // namespace content | 458 } // namespace content |
| OLD | NEW |