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 <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 using fileapi::FileSystemURL; | 34 using fileapi::FileSystemURL; |
35 | 35 |
36 namespace iphoto { | 36 namespace iphoto { |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 void ReadDirectoryTestHelperCallback( | 40 void ReadDirectoryTestHelperCallback( |
41 base::RunLoop* run_loop, | 41 base::RunLoop* run_loop, |
42 FileSystemOperation::FileEntryList* contents, | 42 FileSystemOperation::FileEntryList* contents, |
43 bool* completed, | 43 bool* completed, |
44 base::PlatformFileError error, | 44 base::File::Error error, |
45 const FileSystemOperation::FileEntryList& file_list, | 45 const FileSystemOperation::FileEntryList& file_list, |
46 bool has_more) { | 46 bool has_more) { |
47 DCHECK(!*completed); | 47 DCHECK(!*completed); |
48 *completed = !has_more && error == base::PLATFORM_FILE_OK; | 48 *completed = !has_more && error == base::File::FILE_OK; |
49 *contents = file_list; | 49 *contents = file_list; |
50 run_loop->Quit(); | 50 run_loop->Quit(); |
51 } | 51 } |
52 | 52 |
53 void ReadDirectoryTestHelper(fileapi::FileSystemOperationRunner* runner, | 53 void ReadDirectoryTestHelper(fileapi::FileSystemOperationRunner* runner, |
54 const FileSystemURL& url, | 54 const FileSystemURL& url, |
55 FileSystemOperation::FileEntryList* contents, | 55 FileSystemOperation::FileEntryList* contents, |
56 bool* completed) { | 56 bool* completed) { |
57 DCHECK(contents); | 57 DCHECK(contents); |
58 DCHECK(completed); | 58 DCHECK(completed); |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 completed = false; | 337 completed = false; |
338 ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed); | 338 ReadDirectoryTestHelper(operation_runner(), url, &contents, &completed); |
339 ASSERT_TRUE(completed); | 339 ASSERT_TRUE(completed); |
340 ASSERT_EQ(1u, contents.size()); | 340 ASSERT_EQ(1u, contents.size()); |
341 | 341 |
342 EXPECT_FALSE(contents.front().is_directory); | 342 EXPECT_FALSE(contents.front().is_directory); |
343 EXPECT_EQ("a.jpg", contents.front().name); | 343 EXPECT_EQ("a.jpg", contents.front().name); |
344 } | 344 } |
345 | 345 |
346 } // namespace iphoto | 346 } // namespace iphoto |
OLD | NEW |