Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc

Issue 1619733004: Run recursive file operations sequentially. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a unit test which assumed parallel copy. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | storage/browser/fileapi/recursive_operation_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | storage/browser/fileapi/recursive_operation_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698