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

Unified Diff: components/sync/test/fake_server/fake_server.cc

Issue 2973833002: [Sync] Added integ tests to verify UserEvents retry on TRANSIENT_ERROR. (Closed)
Patch Set: Created 3 years, 5 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/fake_server/fake_server.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/fake_server/fake_server.cc
diff --git a/components/sync/test/fake_server/fake_server.cc b/components/sync/test/fake_server/fake_server.cc
index 8eb3dccebe9ab1f72d774e8342d1eedc0a2f2f11..9f490a1516b8fc105843d918b0a87932ce22fd00 100644
--- a/components/sync/test/fake_server/fake_server.cc
+++ b/components/sync/test/fake_server/fake_server.cc
@@ -401,13 +401,20 @@ string FakeServer::CommitEntity(
return id;
}
+void FakeServer::OverrideResponseType(
+ ResponseTypeProvider response_type_override) {
+ response_type_override_ = std::move(response_type_override);
+}
+
void FakeServer::BuildEntryResponseForSuccessfulCommit(
const std::string& entity_id,
sync_pb::CommitResponse_EntryResponse* entry_response) {
EntityMap::const_iterator iter = entities_.find(entity_id);
CHECK(iter != entities_.end());
const FakeServerEntity& entity = *iter->second;
- entry_response->set_response_type(sync_pb::CommitResponse::SUCCESS);
+ entry_response->set_response_type(response_type_override_
+ ? response_type_override_.Run(entity)
+ : sync_pb::CommitResponse::SUCCESS);
entry_response->set_id_string(entity.id());
if (entity.IsDeleted()) {
« no previous file with comments | « components/sync/test/fake_server/fake_server.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698