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 <map> | 7 #include <map> |
8 #include <queue> | 8 #include <queue> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 kRegularFileSystemTestCases, | 612 kRegularFileSystemTestCases, |
613 kRegularFileSystemTestCaseSize)); | 613 kRegularFileSystemTestCaseSize)); |
614 | 614 |
615 // Move it. | 615 // Move it. |
616 helper.Move(src, dest); | 616 helper.Move(src, dest); |
617 | 617 |
618 // Verify. | 618 // Verify. |
619 ASSERT_TRUE(helper.DirectoryExists(src)); | 619 ASSERT_TRUE(helper.DirectoryExists(src)); |
620 ASSERT_TRUE(helper.DirectoryExists(dest)); | 620 ASSERT_TRUE(helper.DirectoryExists(dest)); |
621 | 621 |
| 622 // In the move operation, [file 0, file 2, file 3] are processed as LIFO. |
| 623 // After file 3 is processed, file 2 is rejected by the validator and the |
| 624 // operation fails. That is, only file 3 should be in dest. |
622 FileSystemTestCaseRecord kMoveDirResultCases[] = { | 625 FileSystemTestCaseRecord kMoveDirResultCases[] = { |
623 {false, FILE_PATH_LITERAL("file 0"), 38}, | |
624 {false, FILE_PATH_LITERAL("file 3"), 0}, | 626 {false, FILE_PATH_LITERAL("file 3"), 0}, |
625 }; | 627 }; |
626 | 628 |
627 helper.VerifyTestCaseFiles(dest, | 629 helper.VerifyTestCaseFiles(dest, |
628 kMoveDirResultCases, | 630 kMoveDirResultCases, |
629 arraysize(kMoveDirResultCases)); | 631 arraysize(kMoveDirResultCases)); |
630 } | 632 } |
631 | 633 |
632 TEST(LocalFileSystemCopyOrMoveOperationTest, CopySingleFileNoValidator) { | 634 TEST(LocalFileSystemCopyOrMoveOperationTest, CopySingleFileNoValidator) { |
633 CopyOrMoveOperationTestHelper helper(GURL("http://foo"), | 635 CopyOrMoveOperationTestHelper helper(GURL("http://foo"), |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 | 868 |
867 base::File::Error error = base::File::FILE_ERROR_FAILED; | 869 base::File::Error error = base::File::FILE_ERROR_FAILED; |
868 base::RunLoop run_loop; | 870 base::RunLoop run_loop; |
869 helper.Run(base::Bind(&AssignAndQuit, &run_loop, &error)); | 871 helper.Run(base::Bind(&AssignAndQuit, &run_loop, &error)); |
870 run_loop.Run(); | 872 run_loop.Run(); |
871 | 873 |
872 EXPECT_EQ(base::File::FILE_ERROR_ABORT, error); | 874 EXPECT_EQ(base::File::FILE_ERROR_ABORT, error); |
873 } | 875 } |
874 | 876 |
875 } // namespace content | 877 } // namespace content |
OLD | NEW |