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 <errno.h> | 5 #include <errno.h> |
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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 ASSERT_TRUE(file_util::CreateDirectory(cache_dir_path)); | 765 ASSERT_TRUE(file_util::CreateDirectory(cache_dir_path)); |
766 ASSERT_TRUE(file_util::CopyFile(file_path, | 766 ASSERT_TRUE(file_util::CopyFile(file_path, |
767 cache_dir_path.Append(meta_cache_path.BaseName()))); | 767 cache_dir_path.Append(meta_cache_path.BaseName()))); |
768 | 768 |
769 ReadOnlyFindFileDelegate delegate; | 769 ReadOnlyFindFileDelegate delegate; |
770 file_system_->LoadRootFeedFromCache( | 770 file_system_->LoadRootFeedFromCache( |
771 FilePath(FILE_PATH_LITERAL("gdata")), | 771 FilePath(FILE_PATH_LITERAL("gdata")), |
772 false, // load_from_server | 772 false, // load_from_server |
773 base::Bind(&GDataFileSystemTest::OnExpectToFindFile, | 773 base::Bind(&GDataFileSystemTest::OnExpectToFindFile, |
774 FilePath(FILE_PATH_LITERAL("gdata")))); | 774 FilePath(FILE_PATH_LITERAL("gdata")))); |
775 RunAllPendingForIO(); | 775 BrowserThread::GetBlockingPool()->FlushForTesting(); |
| 776 message_loop_.RunAllPending(); |
776 } | 777 } |
777 | 778 |
778 static void OnExpectToFindFile(const FilePath& search_file_path, | 779 static void OnExpectToFindFile(const FilePath& search_file_path, |
779 base::PlatformFileError error, | 780 base::PlatformFileError error, |
780 const FilePath& directory_path, | 781 const FilePath& directory_path, |
781 GDataFileBase* file) { | 782 GDataFileBase* file) { |
782 ASSERT_TRUE(file); | 783 ASSERT_TRUE(file); |
783 if (file->file_info().is_directory) | 784 if (file->file_info().is_directory) |
784 ASSERT_EQ(search_file_path, directory_path); | 785 ASSERT_EQ(search_file_path, directory_path); |
785 else | 786 else |
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2529 | 2530 |
2530 // Verify account meta feed is saved to cache. | 2531 // Verify account meta feed is saved to cache. |
2531 RunAllPendingForIO(); | 2532 RunAllPendingForIO(); |
2532 FilePath path = file_system_->cache_paths_[ | 2533 FilePath path = file_system_->cache_paths_[ |
2533 GDataRootDirectory::CACHE_TYPE_META].Append( | 2534 GDataRootDirectory::CACHE_TYPE_META].Append( |
2534 FILE_PATH_LITERAL("account_metadata.json")); | 2535 FILE_PATH_LITERAL("account_metadata.json")); |
2535 EXPECT_TRUE(file_util::PathExists(path)); | 2536 EXPECT_TRUE(file_util::PathExists(path)); |
2536 } | 2537 } |
2537 | 2538 |
2538 } // namespace gdata | 2539 } // namespace gdata |
OLD | NEW |