| 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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_TEST_BASE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_TEST_BASE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_TEST_BASE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_TEST_BASE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| 11 #include "chrome/browser/chromeos/drive/drive.pb.h" | 11 #include "chrome/browser/chromeos/drive/drive.pb.h" |
| 12 #include "chrome/browser/chromeos/drive/file_change.h" |
| 12 #include "chrome/browser/chromeos/drive/file_errors.h" | 13 #include "chrome/browser/chromeos/drive/file_errors.h" |
| 13 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" | 14 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" |
| 14 #include "chrome/browser/chromeos/drive/test_util.h" | 15 #include "chrome/browser/chromeos/drive/test_util.h" |
| 15 #include "content/public/test/test_browser_thread_bundle.h" | 16 #include "content/public/test/test_browser_thread_bundle.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 18 |
| 18 class TestingPrefServiceSimple; | 19 class TestingPrefServiceSimple; |
| 19 | 20 |
| 20 namespace base { | 21 namespace base { |
| 21 class SequencedTaskRunner; | 22 class SequencedTaskRunner; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 44 // FakeDriveService for testing. | 45 // FakeDriveService for testing. |
| 45 class OperationTestBase : public testing::Test { | 46 class OperationTestBase : public testing::Test { |
| 46 protected: | 47 protected: |
| 47 // OperationObserver that records all the events. | 48 // OperationObserver that records all the events. |
| 48 class LoggingObserver : public OperationObserver { | 49 class LoggingObserver : public OperationObserver { |
| 49 public: | 50 public: |
| 50 LoggingObserver(); | 51 LoggingObserver(); |
| 51 ~LoggingObserver(); | 52 ~LoggingObserver(); |
| 52 | 53 |
| 53 // OperationObserver overrides. | 54 // OperationObserver overrides. |
| 54 virtual void OnDirectoryChangedByOperation( | 55 virtual void OnFileChangedByOperation( |
| 55 const base::FilePath& path) OVERRIDE; | 56 const FileChange& changed_files) OVERRIDE; |
| 56 virtual void OnEntryUpdatedByOperation( | 57 virtual void OnEntryUpdatedByOperation( |
| 57 const std::string& local_id) OVERRIDE; | 58 const std::string& local_id) OVERRIDE; |
| 58 virtual void OnDriveSyncError(DriveSyncErrorType type, | 59 virtual void OnDriveSyncError(DriveSyncErrorType type, |
| 59 const std::string& local_id) OVERRIDE; | 60 const std::string& local_id) OVERRIDE; |
| 60 | 61 |
| 61 // Gets the set of changed paths. | 62 // Gets the set of changed paths. |
| 62 const std::set<base::FilePath>& get_changed_paths() { | 63 const FileChange& get_changed_files() { return changed_files_; } |
| 63 return changed_paths_; | |
| 64 } | |
| 65 | 64 |
| 66 // Gets the set of updated local IDs. | 65 // Gets the set of updated local IDs. |
| 67 const std::set<std::string>& updated_local_ids() const { | 66 const std::set<std::string>& updated_local_ids() const { |
| 68 return updated_local_ids_; | 67 return updated_local_ids_; |
| 69 } | 68 } |
| 70 | 69 |
| 71 // Gets the list of drive sync errors. | 70 // Gets the list of drive sync errors. |
| 72 const std::vector<DriveSyncErrorType>& drive_sync_errors() const { | 71 const std::vector<DriveSyncErrorType>& drive_sync_errors() const { |
| 73 return drive_sync_errors_; | 72 return drive_sync_errors_; |
| 74 } | 73 } |
| 75 | 74 |
| 76 private: | 75 private: |
| 77 std::set<base::FilePath> changed_paths_; | 76 FileChange changed_files_; |
| 78 std::set<std::string> updated_local_ids_; | 77 std::set<std::string> updated_local_ids_; |
| 79 std::vector<DriveSyncErrorType> drive_sync_errors_; | 78 std::vector<DriveSyncErrorType> drive_sync_errors_; |
| 80 }; | 79 }; |
| 81 | 80 |
| 82 OperationTestBase(); | 81 OperationTestBase(); |
| 83 explicit OperationTestBase(int test_thread_bundle_options); | 82 explicit OperationTestBase(int test_thread_bundle_options); |
| 84 virtual ~OperationTestBase(); | 83 virtual ~OperationTestBase(); |
| 85 | 84 |
| 86 // testing::Test overrides. | 85 // testing::Test overrides. |
| 87 virtual void SetUp() OVERRIDE; | 86 virtual void SetUp() OVERRIDE; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 metadata_; | 145 metadata_; |
| 147 scoped_ptr<internal::AboutResourceLoader> about_resource_loader_; | 146 scoped_ptr<internal::AboutResourceLoader> about_resource_loader_; |
| 148 scoped_ptr<internal::LoaderController> loader_controller_; | 147 scoped_ptr<internal::LoaderController> loader_controller_; |
| 149 scoped_ptr<internal::ChangeListLoader> change_list_loader_; | 148 scoped_ptr<internal::ChangeListLoader> change_list_loader_; |
| 150 }; | 149 }; |
| 151 | 150 |
| 152 } // namespace file_system | 151 } // namespace file_system |
| 153 } // namespace drive | 152 } // namespace drive |
| 154 | 153 |
| 155 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_TEST_BASE_H_ | 154 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_TEST_BASE_H_ |
| OLD | NEW |