Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: content/browser/fileapi/file_system_operation_runner_unittest.cc

Issue 2316043002: //content: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Just rebased Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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> 5 #include <utility>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 } // namespace 55 } // namespace
56 56
57 class FileSystemOperationRunnerTest : public testing::Test { 57 class FileSystemOperationRunnerTest : public testing::Test {
58 protected: 58 protected:
59 FileSystemOperationRunnerTest() {} 59 FileSystemOperationRunnerTest() {}
60 ~FileSystemOperationRunnerTest() override {} 60 ~FileSystemOperationRunnerTest() override {}
61 61
62 void SetUp() override { 62 void SetUp() override {
63 ASSERT_TRUE(base_.CreateUniqueTempDir()); 63 ASSERT_TRUE(base_.CreateUniqueTempDir());
64 base::FilePath base_dir = base_.path(); 64 base::FilePath base_dir = base_.GetPath();
65 file_system_context_ = CreateFileSystemContextForTesting(nullptr, base_dir); 65 file_system_context_ = CreateFileSystemContextForTesting(nullptr, base_dir);
66 } 66 }
67 67
68 void TearDown() override { 68 void TearDown() override {
69 file_system_context_ = nullptr; 69 file_system_context_ = nullptr;
70 base::RunLoop().RunUntilIdle(); 70 base::RunLoop().RunUntilIdle();
71 } 71 }
72 72
73 FileSystemURL URL(const std::string& path) { 73 FileSystemURL URL(const std::string& path) {
74 return file_system_context_->CreateCrackedFileSystemURL( 74 return file_system_context_->CreateCrackedFileSystemURL(
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 class MultiThreadFileSystemOperationRunnerTest : public testing::Test { 183 class MultiThreadFileSystemOperationRunnerTest : public testing::Test {
184 public: 184 public:
185 MultiThreadFileSystemOperationRunnerTest() 185 MultiThreadFileSystemOperationRunnerTest()
186 : thread_bundle_( 186 : thread_bundle_(
187 content::TestBrowserThreadBundle::REAL_FILE_THREAD | 187 content::TestBrowserThreadBundle::REAL_FILE_THREAD |
188 content::TestBrowserThreadBundle::IO_MAINLOOP) {} 188 content::TestBrowserThreadBundle::IO_MAINLOOP) {}
189 189
190 void SetUp() override { 190 void SetUp() override {
191 ASSERT_TRUE(base_.CreateUniqueTempDir()); 191 ASSERT_TRUE(base_.CreateUniqueTempDir());
192 192
193 base::FilePath base_dir = base_.path(); 193 base::FilePath base_dir = base_.GetPath();
194 ScopedVector<storage::FileSystemBackend> additional_providers; 194 ScopedVector<storage::FileSystemBackend> additional_providers;
195 file_system_context_ = new FileSystemContext( 195 file_system_context_ = new FileSystemContext(
196 base::ThreadTaskRunnerHandle::Get().get(), 196 base::ThreadTaskRunnerHandle::Get().get(),
197 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get(), 197 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get(),
198 storage::ExternalMountPoints::CreateRefCounted().get(), 198 storage::ExternalMountPoints::CreateRefCounted().get(),
199 make_scoped_refptr(new MockSpecialStoragePolicy()).get(), nullptr, 199 make_scoped_refptr(new MockSpecialStoragePolicy()).get(), nullptr,
200 std::move(additional_providers), 200 std::move(additional_providers),
201 std::vector<storage::URLRequestAutoMountHandler>(), base_dir, 201 std::vector<storage::URLRequestAutoMountHandler>(), base_dir,
202 CreateAllowFileAccessOptions()); 202 CreateAllowFileAccessOptions());
203 203
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698