| 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 "components/sync/driver/glue/sync_backend_host_impl.h" | 5 #include "components/sync/driver/glue/sync_backend_host_impl.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 MOCK_METHOD1(OnActionableError, void(const SyncProtocolError& sync_error)); | 100 MOCK_METHOD1(OnActionableError, void(const SyncProtocolError& sync_error)); |
| 101 MOCK_METHOD0(OnSyncConfigureRetry, void()); | 101 MOCK_METHOD0(OnSyncConfigureRetry, void()); |
| 102 MOCK_METHOD1(OnLocalSetPassphraseEncryption, | 102 MOCK_METHOD1(OnLocalSetPassphraseEncryption, |
| 103 void(const SyncEncryptionHandler::NigoriState& nigori_state)); | 103 void(const SyncEncryptionHandler::NigoriState& nigori_state)); |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 class FakeSyncManagerFactory : public SyncManagerFactory { | 106 class FakeSyncManagerFactory : public SyncManagerFactory { |
| 107 public: | 107 public: |
| 108 explicit FakeSyncManagerFactory(FakeSyncManager** fake_manager) | 108 explicit FakeSyncManagerFactory(FakeSyncManager** fake_manager) |
| 109 : fake_manager_(fake_manager) { | 109 : fake_manager_(fake_manager) { |
| 110 *fake_manager_ = NULL; | 110 *fake_manager_ = nullptr; |
| 111 } | 111 } |
| 112 ~FakeSyncManagerFactory() override {} | 112 ~FakeSyncManagerFactory() override {} |
| 113 | 113 |
| 114 // SyncManagerFactory implementation. Called on the sync thread. | 114 // SyncManagerFactory implementation. Called on the sync thread. |
| 115 std::unique_ptr<SyncManager> CreateSyncManager( | 115 std::unique_ptr<SyncManager> CreateSyncManager( |
| 116 const std::string& /* name */) override { | 116 const std::string& /* name */) override { |
| 117 *fake_manager_ = | 117 *fake_manager_ = |
| 118 new FakeSyncManager(initial_sync_ended_types_, progress_marker_types_, | 118 new FakeSyncManager(initial_sync_ended_types_, progress_marker_types_, |
| 119 configure_fail_types_); | 119 configure_fail_types_); |
| 120 return std::unique_ptr<SyncManager>(*fake_manager_); | 120 return std::unique_ptr<SyncManager>(*fake_manager_); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 148 case GROUP_PASSIVE: | 148 case GROUP_PASSIVE: |
| 149 return new PassiveModelWorker(observer); | 149 return new PassiveModelWorker(observer); |
| 150 default: | 150 default: |
| 151 return nullptr; | 151 return nullptr; |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 class SyncBackendHostTest : public testing::Test { | 156 class SyncBackendHostTest : public testing::Test { |
| 157 protected: | 157 protected: |
| 158 SyncBackendHostTest() : fake_manager_(NULL) {} | 158 SyncBackendHostTest() : fake_manager_(nullptr) {} |
| 159 | 159 |
| 160 ~SyncBackendHostTest() override {} | 160 ~SyncBackendHostTest() override {} |
| 161 | 161 |
| 162 void SetUp() override { | 162 void SetUp() override { |
| 163 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 163 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 164 | 164 |
| 165 SyncPrefs::RegisterProfilePrefs(pref_service_.registry()); | 165 SyncPrefs::RegisterProfilePrefs(pref_service_.registry()); |
| 166 | 166 |
| 167 sync_prefs_ = base::MakeUnique<SyncPrefs>(&pref_service_); | 167 sync_prefs_ = base::MakeUnique<SyncPrefs>(&pref_service_); |
| 168 backend_ = base::MakeUnique<SyncBackendHostImpl>( | 168 backend_ = base::MakeUnique<SyncBackendHostImpl>( |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 backend_->StopSyncingForShutdown(); | 823 backend_->StopSyncingForShutdown(); |
| 824 // Verify that call to DeactivateNonBlockingDataType doesn't assert. | 824 // Verify that call to DeactivateNonBlockingDataType doesn't assert. |
| 825 backend_->DeactivateNonBlockingDataType(AUTOFILL); | 825 backend_->DeactivateNonBlockingDataType(AUTOFILL); |
| 826 backend_->Shutdown(STOP_SYNC); | 826 backend_->Shutdown(STOP_SYNC); |
| 827 backend_.reset(); | 827 backend_.reset(); |
| 828 } | 828 } |
| 829 | 829 |
| 830 } // namespace | 830 } // namespace |
| 831 | 831 |
| 832 } // namespace syncer | 832 } // namespace syncer |
| OLD | NEW |