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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <map> | 7 #include <map> |
8 #include <queue> | 8 #include <queue> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 directories.pop(); | 322 directories.pop(); |
323 ASSERT_EQ(base::File::FILE_OK, ReadDirectory(dir, &entries)); | 323 ASSERT_EQ(base::File::FILE_OK, ReadDirectory(dir, &entries)); |
324 for (size_t i = 0; i < entries.size(); ++i) { | 324 for (size_t i = 0; i < entries.size(); ++i) { |
325 FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL( | 325 FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL( |
326 dir.origin(), | 326 dir.origin(), |
327 dir.mount_type(), | 327 dir.mount_type(), |
328 dir.virtual_path().Append(entries[i].name)); | 328 dir.virtual_path().Append(entries[i].name)); |
329 base::FilePath relative; | 329 base::FilePath relative; |
330 root.virtual_path().AppendRelativePath(url.virtual_path(), &relative); | 330 root.virtual_path().AppendRelativePath(url.virtual_path(), &relative); |
331 relative = relative.NormalizePathSeparators(); | 331 relative = relative.NormalizePathSeparators(); |
332 ASSERT_TRUE(ContainsKey(test_case_map, relative)); | 332 ASSERT_TRUE(base::ContainsKey(test_case_map, relative)); |
333 if (entries[i].is_directory) { | 333 if (entries[i].is_directory) { |
334 EXPECT_TRUE(test_case_map[relative]->is_directory); | 334 EXPECT_TRUE(test_case_map[relative]->is_directory); |
335 directories.push(url); | 335 directories.push(url); |
336 } else { | 336 } else { |
337 EXPECT_FALSE(test_case_map[relative]->is_directory); | 337 EXPECT_FALSE(test_case_map[relative]->is_directory); |
338 EXPECT_TRUE(FileExists(url, test_case_map[relative]->data_file_size)); | 338 EXPECT_TRUE(FileExists(url, test_case_map[relative]->data_file_size)); |
339 } | 339 } |
340 test_case_map.erase(relative); | 340 test_case_map.erase(relative); |
341 } | 341 } |
342 } | 342 } |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 | 868 |
869 base::File::Error error = base::File::FILE_ERROR_FAILED; | 869 base::File::Error error = base::File::FILE_ERROR_FAILED; |
870 base::RunLoop run_loop; | 870 base::RunLoop run_loop; |
871 helper.Run(base::Bind(&AssignAndQuit, &run_loop, &error)); | 871 helper.Run(base::Bind(&AssignAndQuit, &run_loop, &error)); |
872 run_loop.Run(); | 872 run_loop.Run(); |
873 | 873 |
874 EXPECT_EQ(base::File::FILE_ERROR_ABORT, error); | 874 EXPECT_EQ(base::File::FILE_ERROR_ABORT, error); |
875 } | 875 } |
876 | 876 |
877 } // namespace content | 877 } // namespace content |
OLD | NEW |