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

Side by Side Diff: webkit/fileapi/local_file_system_operation_unittest.cc

Issue 12036022: Split recursive Copy/Move into async tasks and support cross operation (in local case) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « webkit/fileapi/local_file_system_operation.cc ('k') | webkit/fileapi/obfuscated_file_util.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "webkit/fileapi/local_file_system_operation.h" 5 #include "webkit/fileapi/local_file_system_operation.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 FilePath dest_dir_path(CreateUniqueDir()); 678 FilePath dest_dir_path(CreateUniqueDir());
679 operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_dir_path), 679 operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_dir_path),
680 RecordStatusCallback()); 680 RecordStatusCallback());
681 MessageLoop::current()->RunUntilIdle(); 681 MessageLoop::current()->RunUntilIdle();
682 EXPECT_EQ(base::PLATFORM_FILE_OK, status()); 682 EXPECT_EQ(base::PLATFORM_FILE_OK, status());
683 EXPECT_TRUE(DirectoryExists(dest_dir_path.Append( 683 EXPECT_TRUE(DirectoryExists(dest_dir_path.Append(
684 VirtualPath::BaseName(child_dir_path)))); 684 VirtualPath::BaseName(child_dir_path))));
685 EXPECT_TRUE(FileExists(dest_dir_path.Append( 685 EXPECT_TRUE(FileExists(dest_dir_path.Append(
686 VirtualPath::BaseName(child_dir_path)).Append( 686 VirtualPath::BaseName(child_dir_path)).Append(
687 VirtualPath::BaseName(grandchild_file_path)))); 687 VirtualPath::BaseName(grandchild_file_path))));
688 EXPECT_EQ(1, quota_manager_proxy()->notify_storage_accessed_count()); 688
689 // For recursive copy we may record multiple read access.
690 EXPECT_GE(quota_manager_proxy()->notify_storage_accessed_count(), 1);
689 691
690 EXPECT_EQ(2, change_observer()->get_and_reset_create_directory_count()); 692 EXPECT_EQ(2, change_observer()->get_and_reset_create_directory_count());
691 EXPECT_EQ(1, change_observer()->get_and_reset_remove_directory_count()); 693 EXPECT_EQ(1, change_observer()->get_and_reset_remove_directory_count());
692 EXPECT_EQ(1, change_observer()->get_and_reset_create_file_from_count()); 694 EXPECT_EQ(1, change_observer()->get_and_reset_create_file_from_count());
693 EXPECT_TRUE(change_observer()->HasNoChange()); 695 EXPECT_TRUE(change_observer()->HasNoChange());
694 } 696 }
695 697
696 TEST_F(LocalFileSystemOperationTest, TestCopyInForeignFileSuccess) { 698 TEST_F(LocalFileSystemOperationTest, TestCopyInForeignFileSuccess) {
697 FilePath src_local_disk_file_path; 699 FilePath src_local_disk_file_path;
698 file_util::CreateTemporaryFile(&src_local_disk_file_path); 700 file_util::CreateTemporaryFile(&src_local_disk_file_path);
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 EXPECT_FALSE(info().is_directory); 1197 EXPECT_FALSE(info().is_directory);
1196 EXPECT_EQ(PlatformPath(file_path), path()); 1198 EXPECT_EQ(PlatformPath(file_path), path());
1197 EXPECT_TRUE(change_observer()->HasNoChange()); 1199 EXPECT_TRUE(change_observer()->HasNoChange());
1198 1200
1199 // The FileSystemOpration implementation does not create a 1201 // The FileSystemOpration implementation does not create a
1200 // shareable file reference. 1202 // shareable file reference.
1201 EXPECT_EQ(NULL, shareable_file_ref()); 1203 EXPECT_EQ(NULL, shareable_file_ref());
1202 } 1204 }
1203 1205
1204 } // namespace fileapi 1206 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/local_file_system_operation.cc ('k') | webkit/fileapi/obfuscated_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698