| 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 "chrome/browser/chromeos/drive/sync_client.h" | 5 #include "chrome/browser/chromeos/drive/sync_client.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 void AddResourceIdToFetch(const std::string& resource_id) { | 205 void AddResourceIdToFetch(const std::string& resource_id) { |
| 206 sync_client_->AddResourceIdForTesting(SyncClient::FETCH, resource_id); | 206 sync_client_->AddResourceIdForTesting(SyncClient::FETCH, resource_id); |
| 207 } | 207 } |
| 208 | 208 |
| 209 // Adds a resource ID of a file to upload. | 209 // Adds a resource ID of a file to upload. |
| 210 void AddResourceIdToUpload(const std::string& resource_id) { | 210 void AddResourceIdToUpload(const std::string& resource_id) { |
| 211 sync_client_->AddResourceIdForTesting(SyncClient::UPLOAD, resource_id); | 211 sync_client_->AddResourceIdForTesting(SyncClient::UPLOAD, resource_id); |
| 212 } | 212 } |
| 213 | 213 |
| 214 protected: | 214 protected: |
| 215 MessageLoopForUI message_loop_; | 215 base::MessageLoopForUI message_loop_; |
| 216 content::TestBrowserThread ui_thread_; | 216 content::TestBrowserThread ui_thread_; |
| 217 base::ScopedTempDir temp_dir_; | 217 base::ScopedTempDir temp_dir_; |
| 218 scoped_ptr<StrictMock<MockDriveFileSystem> > mock_file_system_; | 218 scoped_ptr<StrictMock<MockDriveFileSystem> > mock_file_system_; |
| 219 scoped_ptr<DriveCache, test_util::DestroyHelperForTests> cache_; | 219 scoped_ptr<DriveCache, test_util::DestroyHelperForTests> cache_; |
| 220 scoped_ptr<SyncClient> sync_client_; | 220 scoped_ptr<SyncClient> sync_client_; |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 TEST_F(SyncClientTest, StartInitialScan) { | 223 TEST_F(SyncClientTest, StartInitialScan) { |
| 224 // Start processing the files in the backlog. This will collect the | 224 // Start processing the files in the backlog. This will collect the |
| 225 // resource IDs of these files. | 225 // resource IDs of these files. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // Start checking the existing pinned files. This will collect the resource | 290 // Start checking the existing pinned files. This will collect the resource |
| 291 // IDs of pinned files, with stale local cache files. | 291 // IDs of pinned files, with stale local cache files. |
| 292 sync_client_->StartCheckingExistingPinnedFiles(); | 292 sync_client_->StartCheckingExistingPinnedFiles(); |
| 293 | 293 |
| 294 SetExpectationForGetFileByResourceId("resource_id_fetched"); | 294 SetExpectationForGetFileByResourceId("resource_id_fetched"); |
| 295 | 295 |
| 296 google_apis::test_util::RunBlockingPoolTask(); | 296 google_apis::test_util::RunBlockingPoolTask(); |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace drive | 299 } // namespace drive |
| OLD | NEW |