| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <map> | 5 #include <map> |
| 6 #include <queue> | 6 #include <queue> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 class TestValidatorFactory : public CopyOrMoveFileValidatorFactory { | 40 class TestValidatorFactory : public CopyOrMoveFileValidatorFactory { |
| 41 public: | 41 public: |
| 42 // A factory that creates validators that accept everything or nothing. | 42 // A factory that creates validators that accept everything or nothing. |
| 43 TestValidatorFactory() {} | 43 TestValidatorFactory() {} |
| 44 virtual ~TestValidatorFactory() {} | 44 virtual ~TestValidatorFactory() {} |
| 45 | 45 |
| 46 virtual CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( | 46 virtual CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( |
| 47 const FileSystemURL& /*src_url*/, | 47 const FileSystemURL& /*src_url*/, |
| 48 const base::FilePath& /*platform_path*/) OVERRIDE { | 48 const base::FilePath& /*platform_path*/) OVERRIDE { |
| 49 // Move arg management to TestValidator? |
| 49 return new TestValidator(true, true, std::string("2")); | 50 return new TestValidator(true, true, std::string("2")); |
| 50 } | 51 } |
| 51 | 52 |
| 52 private: | 53 private: |
| 53 class TestValidator : public CopyOrMoveFileValidator { | 54 class TestValidator : public CopyOrMoveFileValidator { |
| 54 public: | 55 public: |
| 55 explicit TestValidator(bool pre_copy_valid, | 56 explicit TestValidator(bool pre_copy_valid, |
| 56 bool post_copy_valid, | 57 bool post_copy_valid, |
| 57 const std::string& reject_string) | 58 const std::string& reject_string) |
| 58 : result_(pre_copy_valid ? base::PLATFORM_FILE_OK | 59 : result_(pre_copy_valid ? base::PLATFORM_FILE_OK |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 {false, FILE_PATH_LITERAL("file 0"), 38}, | 524 {false, FILE_PATH_LITERAL("file 0"), 38}, |
| 524 {false, FILE_PATH_LITERAL("file 3"), 0}, | 525 {false, FILE_PATH_LITERAL("file 3"), 0}, |
| 525 }; | 526 }; |
| 526 | 527 |
| 527 helper.VerifyTestCaseFiles(dest, | 528 helper.VerifyTestCaseFiles(dest, |
| 528 kMoveDirResultCases, | 529 kMoveDirResultCases, |
| 529 arraysize(kMoveDirResultCases)); | 530 arraysize(kMoveDirResultCases)); |
| 530 } | 531 } |
| 531 | 532 |
| 532 } // namespace fileapi | 533 } // namespace fileapi |
| OLD | NEW |