Index: components/sync/core/shared_model_type_processor_unittest.cc |
diff --git a/components/sync/core/shared_model_type_processor_unittest.cc b/components/sync/core/shared_model_type_processor_unittest.cc |
index d5c7f08c1510e272a30e671241639f56e356236c..2835c9e816b391f769af3304260bbabcc64fce77 100644 |
--- a/components/sync/core/shared_model_type_processor_unittest.cc |
+++ b/components/sync/core/shared_model_type_processor_unittest.cc |
@@ -8,6 +8,7 @@ |
#include <stdint.h> |
#include <map> |
+#include <memory> |
#include <utility> |
#include <vector> |
@@ -16,6 +17,7 @@ |
#include "base/memory/ptr_util.h" |
#include "base/message_loop/message_loop.h" |
#include "base/run_loop.h" |
+#include "components/sync/api/data_type_error_handler_mock.h" |
#include "components/sync/api/fake_model_type_service.h" |
#include "components/sync/base/model_type.h" |
#include "components/sync/base/time.h" |
@@ -23,7 +25,6 @@ |
#include "components/sync/core/data_batch_impl.h" |
#include "components/sync/core/non_blocking_sync_common.h" |
#include "components/sync/core/simple_metadata_change_list.h" |
-#include "components/sync/core/test/data_type_error_handler_mock.h" |
#include "components/sync/engine/commit_queue.h" |
#include "components/sync/protocol/data_type_state.pb.h" |
#include "components/sync/protocol/sync.pb.h" |
@@ -243,8 +244,11 @@ class SharedModelTypeProcessorTest : public ::testing::Test, |
} |
void OnSyncStarting() { |
+ std::unique_ptr<syncer::DataTypeErrorHandlerMock> error_handler = |
+ base::MakeUnique<syncer::DataTypeErrorHandlerMock>(); |
+ error_handler_ = error_handler.get(); |
type_processor()->OnSyncStarting( |
- &error_handler_, |
+ std::move(error_handler), |
base::Bind(&SharedModelTypeProcessorTest::OnReadyToConnect, |
base::Unretained(this))); |
} |
@@ -380,7 +384,10 @@ class SharedModelTypeProcessorTest : public ::testing::Test, |
return static_cast<SharedModelTypeProcessor*>(change_processor()); |
} |
- syncer::DataTypeErrorHandlerMock* error_handler() { return &error_handler_; } |
+ syncer::DataTypeErrorHandlerMock* error_handler() { |
+ DCHECK(error_handler_); |
+ return error_handler_; |
+ } |
private: |
void CheckPostConditions() { |
@@ -545,7 +552,7 @@ class SharedModelTypeProcessorTest : public ::testing::Test, |
SimpleStore db_; |
// The processor's error handler. |
- syncer::DataTypeErrorHandlerMock error_handler_; |
+ syncer::DataTypeErrorHandlerMock* error_handler_; |
// The error to produce on the next service call. |
syncer::SyncError service_error_; |