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

Unified Diff: components/sync/test/engine/mock_model_type_worker.cc

Issue 2363853002: [Sync] Test that MergeSyncData is not called on subsequent starts. (Closed)
Patch Set: Remove OnInitialSyncDone. Created 4 years, 3 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 | « components/sync/test/engine/mock_model_type_worker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/test/engine/mock_model_type_worker.cc
diff --git a/components/sync/test/engine/mock_model_type_worker.cc b/components/sync/test/engine/mock_model_type_worker.cc
index 34620a3c10cf3b7e3922a0f501ba5f3424ba932d..ee9c3f64caf5e4df5847f7e188305223402a2486 100644
--- a/components/sync/test/engine/mock_model_type_worker.cc
+++ b/components/sync/test/engine/mock_model_type_worker.cc
@@ -21,7 +21,9 @@ namespace {
MockModelTypeWorker::MockModelTypeWorker(
const sync_pb::DataTypeState& data_type_state,
ModelTypeProcessor* processor)
- : data_type_state_(data_type_state), processor_(processor) {}
+ : data_type_state_(data_type_state), processor_(processor) {
+ data_type_state_.set_initial_sync_done(true);
+}
MockModelTypeWorker::~MockModelTypeWorker() {}
@@ -88,6 +90,10 @@ void MockModelTypeWorker::ExpectPendingCommits(
}
}
+void MockModelTypeWorker::UpdateFromServer() {
+ processor_->OnUpdateReceived(data_type_state_, UpdateResponseDataList());
+}
+
void MockModelTypeWorker::UpdateFromServer(
const std::string& tag_hash,
const sync_pb::EntitySpecifics& specifics) {
@@ -107,10 +113,10 @@ void MockModelTypeWorker::UpdateFromServer(
const sync_pb::EntitySpecifics& specifics,
int64_t version_offset,
const std::string& ekn) {
- UpdateResponseDataList update;
- update.push_back(
+ UpdateResponseDataList updates;
+ updates.push_back(
GenerateUpdateData(tag_hash, specifics, version_offset, ekn));
- processor_->OnUpdateReceived(data_type_state_, update);
+ processor_->OnUpdateReceived(data_type_state_, updates);
}
UpdateResponseData MockModelTypeWorker::GenerateUpdateData(
« no previous file with comments | « components/sync/test/engine/mock_model_type_worker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698