OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "content/public/test/async_file_test_helper.h" | 9 #include "content/public/test/async_file_test_helper.h" |
10 #include "storage/browser/fileapi/file_system_backend.h" | 10 #include "storage/browser/fileapi/file_system_backend.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 return result; | 209 return result; |
210 } | 210 } |
211 | 211 |
212 base::File::Error AsyncFileTestHelper::GetMetadata( | 212 base::File::Error AsyncFileTestHelper::GetMetadata( |
213 storage::FileSystemContext* context, | 213 storage::FileSystemContext* context, |
214 const storage::FileSystemURL& url, | 214 const storage::FileSystemURL& url, |
215 base::File::Info* file_info) { | 215 base::File::Info* file_info) { |
216 base::File::Error result = base::File::FILE_ERROR_FAILED; | 216 base::File::Error result = base::File::FILE_ERROR_FAILED; |
217 base::RunLoop run_loop; | 217 base::RunLoop run_loop; |
218 context->operation_runner()->GetMetadata( | 218 context->operation_runner()->GetMetadata( |
219 url, base::Bind(&GetMetadataCallback, &run_loop, &result, | 219 url, storage::FileSystemOperation::GET_METADATA_FIELD_IS_DIRECTORY | |
220 file_info)); | 220 storage::FileSystemOperation::GET_METADATA_FIELD_SIZE | |
| 221 storage::FileSystemOperation::GET_METADATA_FIELD_LAST_MODIFIED, |
| 222 base::Bind(&GetMetadataCallback, &run_loop, &result, file_info)); |
221 run_loop.Run(); | 223 run_loop.Run(); |
222 return result; | 224 return result; |
223 } | 225 } |
224 | 226 |
225 base::File::Error AsyncFileTestHelper::GetPlatformPath( | 227 base::File::Error AsyncFileTestHelper::GetPlatformPath( |
226 storage::FileSystemContext* context, | 228 storage::FileSystemContext* context, |
227 const storage::FileSystemURL& url, | 229 const storage::FileSystemURL& url, |
228 base::FilePath* platform_path) { | 230 base::FilePath* platform_path) { |
229 base::File::Error result = base::File::FILE_ERROR_FAILED; | 231 base::File::Error result = base::File::FILE_ERROR_FAILED; |
230 base::RunLoop run_loop; | 232 base::RunLoop run_loop; |
(...skipping 30 matching lines...) Expand all Loading... |
261 storage::QuotaStatusCode status = storage::kQuotaStatusUnknown; | 263 storage::QuotaStatusCode status = storage::kQuotaStatusUnknown; |
262 quota_manager->GetUsageAndQuota( | 264 quota_manager->GetUsageAndQuota( |
263 origin, | 265 origin, |
264 FileSystemTypeToQuotaStorageType(type), | 266 FileSystemTypeToQuotaStorageType(type), |
265 base::Bind(&DidGetUsageAndQuota, &status, usage, quota)); | 267 base::Bind(&DidGetUsageAndQuota, &status, usage, quota)); |
266 base::RunLoop().RunUntilIdle(); | 268 base::RunLoop().RunUntilIdle(); |
267 return status; | 269 return status; |
268 } | 270 } |
269 | 271 |
270 } // namespace storage | 272 } // namespace storage |
OLD | NEW |