| 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 "chrome/browser/chromeos/drive/file_system/operation_test_base.h" | 5 #include "chrome/browser/chromeos/drive/file_system/operation_test_base.h" |
| 6 | 6 |
| 7 #include "base/prefs/testing_pref_service.h" | 7 #include "base/prefs/testing_pref_service.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
| 9 #include "chrome/browser/chromeos/drive/change_list_loader.h" | 9 #include "chrome/browser/chromeos/drive/change_list_loader.h" |
| 10 #include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h" | 10 #include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h" |
| 11 #include "chrome/browser/chromeos/drive/file_cache.h" | 11 #include "chrome/browser/chromeos/drive/file_cache.h" |
| 12 #include "chrome/browser/chromeos/drive/file_change.h" |
| 12 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" | 13 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" |
| 13 #include "chrome/browser/chromeos/drive/job_scheduler.h" | 14 #include "chrome/browser/chromeos/drive/job_scheduler.h" |
| 14 #include "chrome/browser/chromeos/drive/resource_metadata.h" | 15 #include "chrome/browser/chromeos/drive/resource_metadata.h" |
| 15 #include "chrome/browser/chromeos/drive/test_util.h" | 16 #include "chrome/browser/chromeos/drive/test_util.h" |
| 16 #include "chrome/browser/drive/event_logger.h" | 17 #include "chrome/browser/drive/event_logger.h" |
| 17 #include "chrome/browser/drive/fake_drive_service.h" | 18 #include "chrome/browser/drive/fake_drive_service.h" |
| 18 #include "chrome/browser/drive/test_util.h" | 19 #include "chrome/browser/drive/test_util.h" |
| 19 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| 20 #include "google_apis/drive/test_util.h" | 21 #include "google_apis/drive/test_util.h" |
| 21 | 22 |
| 22 namespace drive { | 23 namespace drive { |
| 23 namespace file_system { | 24 namespace file_system { |
| 24 | 25 |
| 25 OperationTestBase::LoggingObserver::LoggingObserver() { | 26 OperationTestBase::LoggingObserver::LoggingObserver() { |
| 26 } | 27 } |
| 27 | 28 |
| 28 OperationTestBase::LoggingObserver::~LoggingObserver() { | 29 OperationTestBase::LoggingObserver::~LoggingObserver() { |
| 29 } | 30 } |
| 30 | 31 |
| 31 void OperationTestBase::LoggingObserver::OnDirectoryChangedByOperation( | 32 void OperationTestBase::LoggingObserver::OnFileChangedByOperation( |
| 32 const base::FilePath& path) { | 33 const FileChange& changed_files) { |
| 33 changed_paths_.insert(path); | 34 changed_files_.Apply(changed_files); |
| 34 } | 35 } |
| 35 | 36 |
| 36 void OperationTestBase::LoggingObserver::OnEntryUpdatedByOperation( | 37 void OperationTestBase::LoggingObserver::OnEntryUpdatedByOperation( |
| 37 const std::string& local_id) { | 38 const std::string& local_id) { |
| 38 updated_local_ids_.insert(local_id); | 39 updated_local_ids_.insert(local_id); |
| 39 } | 40 } |
| 40 | 41 |
| 41 void OperationTestBase::LoggingObserver::OnDriveSyncError( | 42 void OperationTestBase::LoggingObserver::OnDriveSyncError( |
| 42 DriveSyncErrorType type, const std::string& local_id) { | 43 DriveSyncErrorType type, const std::string& local_id) { |
| 43 drive_sync_errors_.push_back(type); | 44 drive_sync_errors_.push_back(type); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 FileError OperationTestBase::CheckForUpdates() { | 178 FileError OperationTestBase::CheckForUpdates() { |
| 178 FileError error = FILE_ERROR_FAILED; | 179 FileError error = FILE_ERROR_FAILED; |
| 179 change_list_loader_->CheckForUpdates( | 180 change_list_loader_->CheckForUpdates( |
| 180 google_apis::test_util::CreateCopyResultCallback(&error)); | 181 google_apis::test_util::CreateCopyResultCallback(&error)); |
| 181 test_util::RunBlockingPoolTask(); | 182 test_util::RunBlockingPoolTask(); |
| 182 return error; | 183 return error; |
| 183 } | 184 } |
| 184 | 185 |
| 185 } // namespace file_system | 186 } // namespace file_system |
| 186 } // namespace drive | 187 } // namespace drive |
| OLD | NEW |