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

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

Issue 2800893002: Use ScopedTaskEnvironment instead of MessageLoop in content unit tests. (Closed)
Patch Set: Created 3 years, 8 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/files/scoped_temp_dir.h" 11 #include "base/files/scoped_temp_dir.h"
12 #include "base/location.h" 12 #include "base/location.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/run_loop.h" 14 #include "base/run_loop.h"
15 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
16 #include "base/test/scoped_task_environment.h"
16 #include "base/threading/thread_task_runner_handle.h" 17 #include "base/threading/thread_task_runner_handle.h"
17 #include "content/public/test/async_file_test_helper.h" 18 #include "content/public/test/async_file_test_helper.h"
18 #include "content/public/test/mock_special_storage_policy.h" 19 #include "content/public/test/mock_special_storage_policy.h"
19 #include "content/public/test/test_file_system_backend.h" 20 #include "content/public/test/test_file_system_backend.h"
20 #include "content/public/test/test_file_system_context.h" 21 #include "content/public/test/test_file_system_context.h"
21 #include "storage/browser/blob/shareable_file_reference.h" 22 #include "storage/browser/blob/shareable_file_reference.h"
22 #include "storage/browser/fileapi/copy_or_move_file_validator.h" 23 #include "storage/browser/fileapi/copy_or_move_file_validator.h"
23 #include "storage/browser/fileapi/external_mount_points.h" 24 #include "storage/browser/fileapi/external_mount_points.h"
24 #include "storage/browser/fileapi/file_system_backend.h" 25 #include "storage/browser/fileapi/file_system_backend.h"
25 #include "storage/browser/fileapi/file_system_context.h" 26 #include "storage/browser/fileapi/file_system_context.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 173
173 base::ScopedTempDir base_; 174 base::ScopedTempDir base_;
174 175
175 const GURL origin_; 176 const GURL origin_;
176 177
177 const storage::FileSystemType src_type_; 178 const storage::FileSystemType src_type_;
178 const storage::FileSystemType dest_type_; 179 const storage::FileSystemType dest_type_;
179 std::string src_fsid_; 180 std::string src_fsid_;
180 std::string dest_fsid_; 181 std::string dest_fsid_;
181 182
182 base::MessageLoop message_loop_; 183 base::test::ScopedTaskEnvironment scoped_task_environment_;
183 scoped_refptr<storage::FileSystemContext> file_system_context_; 184 scoped_refptr<storage::FileSystemContext> file_system_context_;
184 185
185 FileSystemURL copy_src_; 186 FileSystemURL copy_src_;
186 FileSystemURL copy_dest_; 187 FileSystemURL copy_dest_;
187 FileSystemURL move_src_; 188 FileSystemURL move_src_;
188 FileSystemURL move_dest_; 189 FileSystemURL move_dest_;
189 190
190 DISALLOW_COPY_AND_ASSIGN(CopyOrMoveFileValidatorTestHelper); 191 DISALLOW_COPY_AND_ASSIGN(CopyOrMoveFileValidatorTestHelper);
191 }; 192 };
192 193
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 helper.SetUp(); 328 helper.SetUp();
328 std::unique_ptr<CopyOrMoveFileValidatorFactory> factory( 329 std::unique_ptr<CopyOrMoveFileValidatorFactory> factory(
329 new TestCopyOrMoveFileValidatorFactory(POST_WRITE_INVALID)); 330 new TestCopyOrMoveFileValidatorFactory(POST_WRITE_INVALID));
330 helper.SetMediaCopyOrMoveFileValidatorFactory(std::move(factory)); 331 helper.SetMediaCopyOrMoveFileValidatorFactory(std::move(factory));
331 332
332 helper.CopyTest(base::File::FILE_ERROR_SECURITY); 333 helper.CopyTest(base::File::FILE_ERROR_SECURITY);
333 helper.MoveTest(base::File::FILE_ERROR_SECURITY); 334 helper.MoveTest(base::File::FILE_ERROR_SECURITY);
334 } 335 }
335 336
336 } // namespace content 337 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/appcache/mock_appcache_storage_unittest.cc ('k') | content/browser/fileapi/file_system_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698