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