| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 // Set up TestMountPointProvider to require CopyOrMoveFileValidator. | 55 // Set up TestMountPointProvider to require CopyOrMoveFileValidator. |
| 56 FileSystemMountPointProvider* test_mount_point_provider = | 56 FileSystemMountPointProvider* test_mount_point_provider = |
| 57 file_system_context_->GetMountPointProvider(kWithValidatorType); | 57 file_system_context_->GetMountPointProvider(kWithValidatorType); |
| 58 static_cast<TestMountPointProvider*>(test_mount_point_provider)-> | 58 static_cast<TestMountPointProvider*>(test_mount_point_provider)-> |
| 59 set_require_copy_or_move_validator(true); | 59 set_require_copy_or_move_validator(true); |
| 60 | 60 |
| 61 // Sets up source. | 61 // Sets up source. |
| 62 FileSystemMountPointProvider* src_mount_point_provider = | 62 FileSystemMountPointProvider* src_mount_point_provider = |
| 63 file_system_context_->GetMountPointProvider(src_type_); | 63 file_system_context_->GetMountPointProvider(src_type_); |
| 64 src_mount_point_provider->ValidateFileSystemRoot( | 64 src_mount_point_provider->OpenFileSystem( |
| 65 origin_, src_type_, true /* create */, base::Bind(&ExpectOk)); | 65 origin_, src_type_, |
| 66 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, |
| 67 base::Bind(&ExpectOk)); |
| 66 base::MessageLoop::current()->RunUntilIdle(); | 68 base::MessageLoop::current()->RunUntilIdle(); |
| 67 ASSERT_EQ(base::PLATFORM_FILE_OK, CreateDirectory(SourceURL(""))); | 69 ASSERT_EQ(base::PLATFORM_FILE_OK, CreateDirectory(SourceURL(""))); |
| 68 | 70 |
| 69 // Sets up dest. | 71 // Sets up dest. |
| 70 DCHECK_EQ(kWithValidatorType, dest_type_); | 72 DCHECK_EQ(kWithValidatorType, dest_type_); |
| 71 ASSERT_EQ(base::PLATFORM_FILE_OK, CreateDirectory(DestURL(""))); | 73 ASSERT_EQ(base::PLATFORM_FILE_OK, CreateDirectory(DestURL(""))); |
| 72 | 74 |
| 73 copy_src_ = SourceURL("copy_src.jpg"); | 75 copy_src_ = SourceURL("copy_src.jpg"); |
| 74 move_src_ = SourceURL("move_src.jpg"); | 76 move_src_ = SourceURL("move_src.jpg"); |
| 75 copy_dest_ = DestURL("copy_dest.jpg"); | 77 copy_dest_ = DestURL("copy_dest.jpg"); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 278 |
| 277 scoped_ptr<CopyOrMoveFileValidatorFactory> accept_factory( | 279 scoped_ptr<CopyOrMoveFileValidatorFactory> accept_factory( |
| 278 new TestCopyOrMoveFileValidatorFactory(true /*accept_all*/)); | 280 new TestCopyOrMoveFileValidatorFactory(true /*accept_all*/)); |
| 279 helper.SetMediaCopyOrMoveFileValidatorFactory(accept_factory.Pass()); | 281 helper.SetMediaCopyOrMoveFileValidatorFactory(accept_factory.Pass()); |
| 280 | 282 |
| 281 helper.CopyTest(base::PLATFORM_FILE_ERROR_SECURITY); | 283 helper.CopyTest(base::PLATFORM_FILE_ERROR_SECURITY); |
| 282 helper.MoveTest(base::PLATFORM_FILE_ERROR_SECURITY); | 284 helper.MoveTest(base::PLATFORM_FILE_ERROR_SECURITY); |
| 283 } | 285 } |
| 284 | 286 |
| 285 } // namespace fileapi | 287 } // namespace fileapi |
| OLD | NEW |