Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc

Issue 1275743002: [Sync] Remove backend unrecoverable error handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix leak Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/sync/glue/sync_backend_host_impl.h" 5 #include "chrome/browser/sync/glue/sync_backend_host_impl.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 EXPECT_CALL(mock_frontend_, OnBackendInitialized(_, _, _, expect_success)). 211 EXPECT_CALL(mock_frontend_, OnBackendInitialized(_, _, _, expect_success)).
212 WillOnce(InvokeWithoutArgs(QuitMessageLoop)); 212 WillOnce(InvokeWithoutArgs(QuitMessageLoop));
213 backend_->Initialize( 213 backend_->Initialize(
214 &mock_frontend_, 214 &mock_frontend_,
215 scoped_ptr<base::Thread>(), 215 scoped_ptr<base::Thread>(),
216 syncer::WeakHandle<syncer::JsEventHandler>(), 216 syncer::WeakHandle<syncer::JsEventHandler>(),
217 GURL(std::string()), 217 GURL(std::string()),
218 credentials_, 218 credentials_,
219 true, 219 true,
220 fake_manager_factory_.Pass(), 220 fake_manager_factory_.Pass(),
221 make_scoped_ptr(new syncer::TestUnrecoverableErrorHandler), 221 MakeWeakHandle(test_unrecoverable_error_handler_.GetWeakPtr()),
222 base::Closure(), 222 base::Closure(),
223 network_resources_.get(), 223 network_resources_.get(),
224 saved_nigori_state_.Pass()); 224 saved_nigori_state_.Pass());
225 base::RunLoop run_loop; 225 base::RunLoop run_loop;
226 BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, 226 BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE,
227 run_loop.QuitClosure(), 227 run_loop.QuitClosure(),
228 TestTimeouts::action_timeout()); 228 TestTimeouts::action_timeout());
229 run_loop.Run(); 229 run_loop.Run();
230 // |fake_manager_factory_|'s fake_manager() is set on the sync 230 // |fake_manager_factory_|'s fake_manager() is set on the sync
231 // thread, but we can rely on the message loop barriers to 231 // thread, but we can rely on the message loop barriers to
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 282
283 void OnDownloadRetry() { 283 void OnDownloadRetry() {
284 NOTIMPLEMENTED(); 284 NOTIMPLEMENTED();
285 } 285 }
286 286
287 content::TestBrowserThreadBundle thread_bundle_; 287 content::TestBrowserThreadBundle thread_bundle_;
288 StrictMock<MockSyncFrontend> mock_frontend_; 288 StrictMock<MockSyncFrontend> mock_frontend_;
289 syncer::SyncCredentials credentials_; 289 syncer::SyncCredentials credentials_;
290 TestingProfileManager profile_manager_; 290 TestingProfileManager profile_manager_;
291 TestingProfile* profile_; 291 TestingProfile* profile_;
292 syncer::TestUnrecoverableErrorHandler test_unrecoverable_error_handler_;
292 scoped_ptr<sync_driver::SyncPrefs> sync_prefs_; 293 scoped_ptr<sync_driver::SyncPrefs> sync_prefs_;
293 scoped_ptr<SyncBackendHostImpl> backend_; 294 scoped_ptr<SyncBackendHostImpl> backend_;
294 scoped_ptr<FakeSyncManagerFactory> fake_manager_factory_; 295 scoped_ptr<FakeSyncManagerFactory> fake_manager_factory_;
295 FakeSyncManager* fake_manager_; 296 FakeSyncManager* fake_manager_;
296 syncer::ModelTypeSet enabled_types_; 297 syncer::ModelTypeSet enabled_types_;
297 scoped_ptr<syncer::NetworkResources> network_resources_; 298 scoped_ptr<syncer::NetworkResources> network_resources_;
298 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state_; 299 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state_;
299 }; 300 };
300 301
301 // Test basic initialization with no initial types (first time initialization). 302 // Test basic initialization with no initial types (first time initialization).
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 EXPECT_EQ(invalidation_versions.size(), 868 EXPECT_EQ(invalidation_versions.size(),
868 persisted_invalidation_versions.size()); 869 persisted_invalidation_versions.size());
869 for (auto iter : persisted_invalidation_versions) { 870 for (auto iter : persisted_invalidation_versions) {
870 EXPECT_EQ(invalidation_versions[iter.first], iter.second); 871 EXPECT_EQ(invalidation_versions[iter.first], iter.second);
871 } 872 }
872 } 873 }
873 874
874 } // namespace 875 } // namespace
875 876
876 } // namespace browser_sync 877 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host_impl.cc ('k') | chrome/browser/sync/glue/sync_backend_host_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698