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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
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/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // Set up TestFileSystemBackend to require CopyOrMoveFileValidator. | 57 // Set up TestFileSystemBackend to require CopyOrMoveFileValidator. |
58 FileSystemBackend* test_file_system_backend = | 58 FileSystemBackend* test_file_system_backend = |
59 file_system_context_->GetFileSystemBackend(kWithValidatorType); | 59 file_system_context_->GetFileSystemBackend(kWithValidatorType); |
60 static_cast<TestFileSystemBackend*>(test_file_system_backend)-> | 60 static_cast<TestFileSystemBackend*>(test_file_system_backend)-> |
61 set_require_copy_or_move_validator(true); | 61 set_require_copy_or_move_validator(true); |
62 | 62 |
63 // Sets up source. | 63 // Sets up source. |
64 FileSystemBackend* src_file_system_backend = | 64 FileSystemBackend* src_file_system_backend = |
65 file_system_context_->GetFileSystemBackend(src_type_); | 65 file_system_context_->GetFileSystemBackend(src_type_); |
66 src_file_system_backend->OpenFileSystem( | 66 src_file_system_backend->InitializeFileSystem( |
67 origin_, src_type_, | 67 origin_, src_type_, |
68 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, | 68 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, |
| 69 NULL /* context */, |
69 base::Bind(&ExpectOk)); | 70 base::Bind(&ExpectOk)); |
70 base::MessageLoop::current()->RunUntilIdle(); | 71 base::MessageLoop::current()->RunUntilIdle(); |
71 ASSERT_EQ(base::PLATFORM_FILE_OK, CreateDirectory(SourceURL(""))); | 72 ASSERT_EQ(base::PLATFORM_FILE_OK, CreateDirectory(SourceURL(""))); |
72 | 73 |
73 // Sets up dest. | 74 // Sets up dest. |
74 DCHECK_EQ(kWithValidatorType, dest_type_); | 75 DCHECK_EQ(kWithValidatorType, dest_type_); |
75 ASSERT_EQ(base::PLATFORM_FILE_OK, CreateDirectory(DestURL(""))); | 76 ASSERT_EQ(base::PLATFORM_FILE_OK, CreateDirectory(DestURL(""))); |
76 | 77 |
77 copy_src_ = SourceURL("copy_src.jpg"); | 78 copy_src_ = SourceURL("copy_src.jpg"); |
78 move_src_ = SourceURL("move_src.jpg"); | 79 move_src_ = SourceURL("move_src.jpg"); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 283 |
283 scoped_ptr<CopyOrMoveFileValidatorFactory> accept_factory( | 284 scoped_ptr<CopyOrMoveFileValidatorFactory> accept_factory( |
284 new TestCopyOrMoveFileValidatorFactory(true /*accept_all*/)); | 285 new TestCopyOrMoveFileValidatorFactory(true /*accept_all*/)); |
285 helper.SetMediaCopyOrMoveFileValidatorFactory(accept_factory.Pass()); | 286 helper.SetMediaCopyOrMoveFileValidatorFactory(accept_factory.Pass()); |
286 | 287 |
287 helper.CopyTest(base::PLATFORM_FILE_ERROR_SECURITY); | 288 helper.CopyTest(base::PLATFORM_FILE_ERROR_SECURITY); |
288 helper.MoveTest(base::PLATFORM_FILE_ERROR_SECURITY); | 289 helper.MoveTest(base::PLATFORM_FILE_ERROR_SECURITY); |
289 } | 290 } |
290 | 291 |
291 } // namespace fileapi | 292 } // namespace fileapi |
OLD | NEW |