| 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 <utility> |
| 6 |
| 5 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 6 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 7 #include "base/macros.h" | 9 #include "base/macros.h" |
| 8 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 9 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 10 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
| 11 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
| 12 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/test/mock_special_storage_policy.h" | 15 #include "content/public/test/mock_special_storage_policy.h" |
| 14 #include "content/public/test/test_browser_thread_bundle.h" | 16 #include "content/public/test/test_browser_thread_bundle.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 189 |
| 188 void SetUp() override { | 190 void SetUp() override { |
| 189 ASSERT_TRUE(base_.CreateUniqueTempDir()); | 191 ASSERT_TRUE(base_.CreateUniqueTempDir()); |
| 190 | 192 |
| 191 base::FilePath base_dir = base_.path(); | 193 base::FilePath base_dir = base_.path(); |
| 192 ScopedVector<storage::FileSystemBackend> additional_providers; | 194 ScopedVector<storage::FileSystemBackend> additional_providers; |
| 193 file_system_context_ = new FileSystemContext( | 195 file_system_context_ = new FileSystemContext( |
| 194 base::ThreadTaskRunnerHandle::Get().get(), | 196 base::ThreadTaskRunnerHandle::Get().get(), |
| 195 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get(), | 197 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get(), |
| 196 storage::ExternalMountPoints::CreateRefCounted().get(), | 198 storage::ExternalMountPoints::CreateRefCounted().get(), |
| 197 make_scoped_refptr(new MockSpecialStoragePolicy()).get(), | 199 make_scoped_refptr(new MockSpecialStoragePolicy()).get(), nullptr, |
| 198 nullptr, | 200 std::move(additional_providers), |
| 199 additional_providers.Pass(), | 201 std::vector<storage::URLRequestAutoMountHandler>(), base_dir, |
| 200 std::vector<storage::URLRequestAutoMountHandler>(), | |
| 201 base_dir, | |
| 202 CreateAllowFileAccessOptions()); | 202 CreateAllowFileAccessOptions()); |
| 203 | 203 |
| 204 // Disallow IO on the main loop. | 204 // Disallow IO on the main loop. |
| 205 base::ThreadRestrictions::SetIOAllowed(false); | 205 base::ThreadRestrictions::SetIOAllowed(false); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void TearDown() override { | 208 void TearDown() override { |
| 209 base::ThreadRestrictions::SetIOAllowed(true); | 209 base::ThreadRestrictions::SetIOAllowed(true); |
| 210 file_system_context_ = nullptr; | 210 file_system_context_ = nullptr; |
| 211 } | 211 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 241 base::RunLoop run_loop; | 241 base::RunLoop run_loop; |
| 242 BrowserThread::PostTaskAndReply( | 242 BrowserThread::PostTaskAndReply( |
| 243 BrowserThread::FILE, FROM_HERE, | 243 BrowserThread::FILE, FROM_HERE, |
| 244 base::Bind(&base::DoNothing), | 244 base::Bind(&base::DoNothing), |
| 245 run_loop.QuitClosure()); | 245 run_loop.QuitClosure()); |
| 246 run_loop.Run(); | 246 run_loop.Run(); |
| 247 // This should finish without thread assertion failure on debug build. | 247 // This should finish without thread assertion failure on debug build. |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace content | 250 } // namespace content |
| OLD | NEW |