OLD | NEW |
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 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 FilePath child_file_path(CreateUniqueFileInDir(parent_dir_path)); | 1039 FilePath child_file_path(CreateUniqueFileInDir(parent_dir_path)); |
1040 FilePath child_dir_path(CreateUniqueDirInDir(parent_dir_path)); | 1040 FilePath child_dir_path(CreateUniqueDirInDir(parent_dir_path)); |
1041 ASSERT_FALSE(child_dir_path.empty()); | 1041 ASSERT_FALSE(child_dir_path.empty()); |
1042 | 1042 |
1043 operation()->Remove(URLForPath(parent_dir_path), true /* recursive */, | 1043 operation()->Remove(URLForPath(parent_dir_path), true /* recursive */, |
1044 RecordStatusCallback()); | 1044 RecordStatusCallback()); |
1045 MessageLoop::current()->RunUntilIdle(); | 1045 MessageLoop::current()->RunUntilIdle(); |
1046 EXPECT_EQ(base::PLATFORM_FILE_OK, status()); | 1046 EXPECT_EQ(base::PLATFORM_FILE_OK, status()); |
1047 EXPECT_FALSE(DirectoryExists(parent_dir_path)); | 1047 EXPECT_FALSE(DirectoryExists(parent_dir_path)); |
1048 | 1048 |
1049 // Remove is not a 'read' access. | |
1050 EXPECT_EQ(0, quota_manager_proxy()->notify_storage_accessed_count()); | |
1051 | |
1052 EXPECT_EQ(2, change_observer()->get_and_reset_remove_directory_count()); | 1049 EXPECT_EQ(2, change_observer()->get_and_reset_remove_directory_count()); |
1053 EXPECT_EQ(1, change_observer()->get_and_reset_remove_file_count()); | 1050 EXPECT_EQ(1, change_observer()->get_and_reset_remove_file_count()); |
1054 EXPECT_TRUE(change_observer()->HasNoChange()); | 1051 EXPECT_TRUE(change_observer()->HasNoChange()); |
1055 } | 1052 } |
1056 | 1053 |
1057 TEST_F(LocalFileSystemOperationTest, TestTruncate) { | 1054 TEST_F(LocalFileSystemOperationTest, TestTruncate) { |
1058 FilePath dir_path(CreateUniqueDir()); | 1055 FilePath dir_path(CreateUniqueDir()); |
1059 FilePath file_path(CreateUniqueFileInDir(dir_path)); | 1056 FilePath file_path(CreateUniqueFileInDir(dir_path)); |
1060 | 1057 |
1061 char test_data[] = "test data"; | 1058 char test_data[] = "test data"; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 EXPECT_FALSE(info().is_directory); | 1195 EXPECT_FALSE(info().is_directory); |
1199 EXPECT_EQ(PlatformPath(file_path), path()); | 1196 EXPECT_EQ(PlatformPath(file_path), path()); |
1200 EXPECT_TRUE(change_observer()->HasNoChange()); | 1197 EXPECT_TRUE(change_observer()->HasNoChange()); |
1201 | 1198 |
1202 // The FileSystemOpration implementation does not create a | 1199 // The FileSystemOpration implementation does not create a |
1203 // shareable file reference. | 1200 // shareable file reference. |
1204 EXPECT_EQ(NULL, shareable_file_ref()); | 1201 EXPECT_EQ(NULL, shareable_file_ref()); |
1205 } | 1202 } |
1206 | 1203 |
1207 } // namespace fileapi | 1204 } // namespace fileapi |
OLD | NEW |