| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // anonymous namespace | 94 } // anonymous namespace |
| 95 | 95 |
| 96 namespace gdata { | 96 namespace gdata { |
| 97 | 97 |
| 98 class GDataFileSystemTest : public testing::Test { | 98 class GDataFileSystemTest : public testing::Test { |
| 99 protected: | 99 protected: |
| 100 GDataFileSystemTest() | 100 GDataFileSystemTest() |
| 101 : ui_thread_(content::BrowserThread::UI, &message_loop_), | 101 : ui_thread_(content::BrowserThread::UI, &message_loop_), |
| 102 file_thread_(content::BrowserThread::FILE), |
| 102 io_thread_(content::BrowserThread::IO, &message_loop_), | 103 io_thread_(content::BrowserThread::IO, &message_loop_), |
| 103 file_thread_(content::BrowserThread::FILE), | |
| 104 file_system_(NULL), | 104 file_system_(NULL), |
| 105 mock_doc_service_(NULL), | 105 mock_doc_service_(NULL), |
| 106 mock_sync_client_(NULL), | 106 mock_sync_client_(NULL), |
| 107 num_callback_invocations_(0), | 107 num_callback_invocations_(0), |
| 108 expected_error_(base::PLATFORM_FILE_OK), | 108 expected_error_(base::PLATFORM_FILE_OK), |
| 109 expected_cache_state_(0), | 109 expected_cache_state_(0), |
| 110 expected_sub_dir_type_(GDataRootDirectory::CACHE_TYPE_META), | 110 expected_sub_dir_type_(GDataRootDirectory::CACHE_TYPE_META), |
| 111 expected_file_(NULL), | 111 expected_file_(NULL), |
| 112 expect_outgoing_symlink_(false) { | 112 expect_outgoing_symlink_(false) { |
| 113 } | 113 } |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 | 768 |
| 769 base::PlatformFileError last_error_; | 769 base::PlatformFileError last_error_; |
| 770 FilePath download_path_; | 770 FilePath download_path_; |
| 771 std::string mime_type_; | 771 std::string mime_type_; |
| 772 GDataFileType file_type_; | 772 GDataFileType file_type_; |
| 773 int quota_bytes_total_; | 773 int quota_bytes_total_; |
| 774 int quota_bytes_used_; | 774 int quota_bytes_used_; |
| 775 }; | 775 }; |
| 776 | 776 |
| 777 MessageLoopForUI message_loop_; | 777 MessageLoopForUI message_loop_; |
| 778 // The order of the test threads is important, do not change the order. |
| 779 // See also content/browser/browser_thread_imple.cc. |
| 778 content::TestBrowserThread ui_thread_; | 780 content::TestBrowserThread ui_thread_; |
| 781 content::TestBrowserThread file_thread_; |
| 779 content::TestBrowserThread io_thread_; | 782 content::TestBrowserThread io_thread_; |
| 780 content::TestBrowserThread file_thread_; | |
| 781 scoped_ptr<TestingProfile> profile_; | 783 scoped_ptr<TestingProfile> profile_; |
| 782 scoped_refptr<CallbackHelper> callback_helper_; | 784 scoped_refptr<CallbackHelper> callback_helper_; |
| 783 GDataFileSystem* file_system_; | 785 GDataFileSystem* file_system_; |
| 784 MockDocumentsService* mock_doc_service_; | 786 MockDocumentsService* mock_doc_service_; |
| 785 scoped_ptr<MockGDataSyncClient> mock_sync_client_; | 787 scoped_ptr<MockGDataSyncClient> mock_sync_client_; |
| 786 | 788 |
| 787 int num_callback_invocations_; | 789 int num_callback_invocations_; |
| 788 base::PlatformFileError expected_error_; | 790 base::PlatformFileError expected_error_; |
| 789 int expected_cache_state_; | 791 int expected_cache_state_; |
| 790 GDataRootDirectory::CacheSubDirectoryType expected_sub_dir_type_; | 792 GDataRootDirectory::CacheSubDirectoryType expected_sub_dir_type_; |
| (...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2343 | 2345 |
| 2344 // Verify account meta feed is saved to cache. | 2346 // Verify account meta feed is saved to cache. |
| 2345 RunAllPendingForIO(); | 2347 RunAllPendingForIO(); |
| 2346 FilePath path = file_system_->cache_paths_[ | 2348 FilePath path = file_system_->cache_paths_[ |
| 2347 GDataRootDirectory::CACHE_TYPE_META].Append( | 2349 GDataRootDirectory::CACHE_TYPE_META].Append( |
| 2348 FILE_PATH_LITERAL("account_metadata.json")); | 2350 FILE_PATH_LITERAL("account_metadata.json")); |
| 2349 EXPECT_TRUE(file_util::PathExists(path)); | 2351 EXPECT_TRUE(file_util::PathExists(path)); |
| 2350 } | 2352 } |
| 2351 | 2353 |
| 2352 } // namespace gdata | 2354 } // namespace gdata |
| OLD | NEW |