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

Unified Diff: sync/internal_api/sync_manager_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/internal_api/sync_manager_impl.cc ('k') | sync/internal_api/sync_rollback_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/sync_manager_impl_unittest.cc
diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc
index fcd55d344a7a5d7857a789a2476720d46c9858d6..34ba76f97a4e7b02fee77ed1af9c5886f6c81f68 100644
--- a/sync/internal_api/sync_manager_impl_unittest.cc
+++ b/sync/internal_api/sync_manager_impl_unittest.cc
@@ -832,8 +832,7 @@ class SyncManagerTest : public testing::Test,
};
SyncManagerTest()
- : sync_manager_("Test sync manager"),
- mock_unrecoverable_error_handler_(NULL) {
+ : sync_manager_("Test sync manager") {
switches_.encryption_method =
InternalComponentsFactory::ENCRYPTION_KEYSTORE;
}
@@ -883,8 +882,8 @@ class SyncManagerTest : public testing::Test,
args.invalidator_client_id = "fake_invalidator_client_id";
args.internal_components_factory.reset(GetFactory());
args.encryptor = &encryptor_;
- mock_unrecoverable_error_handler_ = new MockUnrecoverableErrorHandler();
- args.unrecoverable_error_handler.reset(mock_unrecoverable_error_handler_);
+ args.unrecoverable_error_handler =
+ MakeWeakHandle(mock_unrecoverable_error_handler_.GetWeakPtr());
args.cancelation_signal = &cancelation_signal_;
sync_manager_.Init(&args);
@@ -1079,9 +1078,7 @@ class SyncManagerTest : public testing::Test,
}
bool HasUnrecoverableError() {
- if (mock_unrecoverable_error_handler_)
- return mock_unrecoverable_error_handler_->invocation_count() > 0;
- return false;
+ return mock_unrecoverable_error_handler_.invocation_count() > 0;
}
private:
@@ -1103,9 +1100,7 @@ class SyncManagerTest : public testing::Test,
StrictMock<SyncEncryptionHandlerObserverMock> encryption_observer_;
InternalComponentsFactory::Switches switches_;
InternalComponentsFactory::StorageOption storage_used_;
-
- // Not owned (ownership is passed to the SyncManager).
- MockUnrecoverableErrorHandler* mock_unrecoverable_error_handler_;
+ MockUnrecoverableErrorHandler mock_unrecoverable_error_handler_;
};
TEST_F(SyncManagerTest, GetAllNodesForTypeTest) {
« no previous file with comments | « sync/internal_api/sync_manager_impl.cc ('k') | sync/internal_api/sync_rollback_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698