| 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 <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" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 storage::FileSystemType dest_type) | 54 storage::FileSystemType dest_type) |
| 55 : origin_(origin), src_type_(src_type), dest_type_(dest_type) {} | 55 : origin_(origin), src_type_(src_type), dest_type_(dest_type) {} |
| 56 | 56 |
| 57 ~CopyOrMoveFileValidatorTestHelper() { | 57 ~CopyOrMoveFileValidatorTestHelper() { |
| 58 file_system_context_ = NULL; | 58 file_system_context_ = NULL; |
| 59 base::RunLoop().RunUntilIdle(); | 59 base::RunLoop().RunUntilIdle(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void SetUp() { | 62 void SetUp() { |
| 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 | 65 |
| 66 file_system_context_ = CreateFileSystemContextForTesting(NULL, base_dir); | 66 file_system_context_ = CreateFileSystemContextForTesting(NULL, base_dir); |
| 67 | 67 |
| 68 // Set up TestFileSystemBackend to require CopyOrMoveFileValidator. | 68 // Set up TestFileSystemBackend to require CopyOrMoveFileValidator. |
| 69 storage::FileSystemBackend* test_file_system_backend = | 69 storage::FileSystemBackend* test_file_system_backend = |
| 70 file_system_context_->GetFileSystemBackend(kWithValidatorType); | 70 file_system_context_->GetFileSystemBackend(kWithValidatorType); |
| 71 static_cast<TestFileSystemBackend*>(test_file_system_backend)-> | 71 static_cast<TestFileSystemBackend*>(test_file_system_backend)-> |
| 72 set_require_copy_or_move_validator(true); | 72 set_require_copy_or_move_validator(true); |
| 73 | 73 |
| 74 // Sets up source. | 74 // Sets up source. |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 helper.SetUp(); | 327 helper.SetUp(); |
| 328 std::unique_ptr<CopyOrMoveFileValidatorFactory> factory( | 328 std::unique_ptr<CopyOrMoveFileValidatorFactory> factory( |
| 329 new TestCopyOrMoveFileValidatorFactory(POST_WRITE_INVALID)); | 329 new TestCopyOrMoveFileValidatorFactory(POST_WRITE_INVALID)); |
| 330 helper.SetMediaCopyOrMoveFileValidatorFactory(std::move(factory)); | 330 helper.SetMediaCopyOrMoveFileValidatorFactory(std::move(factory)); |
| 331 | 331 |
| 332 helper.CopyTest(base::File::FILE_ERROR_SECURITY); | 332 helper.CopyTest(base::File::FILE_ERROR_SECURITY); |
| 333 helper.MoveTest(base::File::FILE_ERROR_SECURITY); | 333 helper.MoveTest(base::File::FILE_ERROR_SECURITY); |
| 334 } | 334 } |
| 335 | 335 |
| 336 } // namespace content | 336 } // namespace content |
| OLD | NEW |