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

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

Issue 1849563005: [Sync] Add cookie jar mismatch logging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests again Created 4 years, 8 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/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: sync/test/fake_server/fake_server.cc
diff --git a/sync/test/fake_server/fake_server.cc b/sync/test/fake_server/fake_server.cc
index 69ad49a8df150ba9157f7f043b223901067a8f11..6fb632637222db4c1f198b2e74e4401fd58b2842 100644
--- a/sync/test/fake_server/fake_server.cc
+++ b/sync/test/fake_server/fake_server.cc
@@ -277,10 +277,12 @@ void FakeServer::HandleCommand(const string& request,
bool success = false;
switch (message.message_contents()) {
case sync_pb::ClientToServerMessage::GET_UPDATES:
+ last_getupdates_message_ = message;
success = HandleGetUpdatesRequest(message.get_updates(),
response_proto.mutable_get_updates());
break;
case sync_pb::ClientToServerMessage::COMMIT:
+ last_commit_message_ = message;
success = HandleCommitRequest(message.commit(),
message.invalidator_client_id(),
response_proto.mutable_commit());
@@ -319,6 +321,24 @@ void FakeServer::HandleCommand(const string& request,
completion_closure.Run();
}
+bool FakeServer::GetLastCommitMessage(
+ sync_pb::ClientToServerMessage* message) {
+ if (!last_commit_message_.has_commit())
+ return false;
+
+ message->CopyFrom(last_commit_message_);
+ return true;
+}
+
+bool FakeServer::GetLastGetUpdatesMessage(
+ sync_pb::ClientToServerMessage* message) {
+ if (!last_getupdates_message_.has_get_updates())
+ return false;
+
+ message->CopyFrom(last_getupdates_message_);
+ return true;
+}
+
bool FakeServer::HandleGetUpdatesRequest(
const sync_pb::GetUpdatesMessage& get_updates,
sync_pb::GetUpdatesResponse* response) {
« no previous file with comments | « 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