summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-22 21:30:14 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-22 21:30:14 +0000
commit2d6a18a7d05e207d993219246468cef12e4d0654 (patch)
treee2b539c06dd52c5f5b01acefd52f3cbcf458fc9e /sync
parent6efc376e3b3b3fd354633fa0b05ac544d292d262 (diff)
downloadchromium_src-2d6a18a7d05e207d993219246468cef12e4d0654.zip
chromium_src-2d6a18a7d05e207d993219246468cef12e4d0654.tar.gz
chromium_src-2d6a18a7d05e207d993219246468cef12e4d0654.tar.bz2
sync: Implement fake server reflection blocking
Implements reflection blocking for the in-process fake sync server. The notifications delivery system used in the real world will not deliver notifications of new or modified items to the client that originated that change. This feature is known by the names "reflection blocking" or "squelching". Most of out integration tests expect reflection blocking to be disabled, so we can't turn this on in all tests. The default is to leave it off. Tests that want to enable reflection blocking must override "TestUsesSelfNotifications" in their test framework class. BUG=323265 Review URL: https://codereview.chromium.org/296743005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r--sync/test/fake_server/fake_server.cc5
-rw-r--r--sync/test/fake_server/fake_server.h7
2 files changed, 9 insertions, 3 deletions
diff --git a/sync/test/fake_server/fake_server.cc b/sync/test/fake_server/fake_server.cc
index 44bce54..207f1a2 100644
--- a/sync/test/fake_server/fake_server.cc
+++ b/sync/test/fake_server/fake_server.cc
@@ -227,6 +227,7 @@ void FakeServer::HandleCommand(const string& request,
break;
case sync_pb::ClientToServerMessage::COMMIT:
success = HandleCommitRequest(message.commit(),
+ message.invalidator_client_id(),
response_proto.mutable_commit());
break;
default:
@@ -396,6 +397,7 @@ bool FakeServer::DeleteChildren(const string& id) {
bool FakeServer::HandleCommitRequest(
const sync_pb::CommitMessage& commit,
+ const std::string& invalidator_client_id,
sync_pb::CommitResponse* response) {
std::map<string, string> client_to_server_ids;
string guid = commit.cache_guid();
@@ -430,7 +432,8 @@ bool FakeServer::HandleCommitRequest(
committed_model_types.Put(entity->GetModelType());
}
- FOR_EACH_OBSERVER(Observer, observers_, OnCommit(committed_model_types));
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OnCommit(invalidator_client_id, committed_model_types));
return true;
}
diff --git a/sync/test/fake_server/fake_server.h b/sync/test/fake_server/fake_server.h
index 8bb2c08..c33db91 100644
--- a/sync/test/fake_server/fake_server.h
+++ b/sync/test/fake_server/fake_server.h
@@ -32,7 +32,9 @@ class FakeServer {
// Called after FakeServer has processed a successful commit. The types
// updated as part of the commit are passed in |committed_model_types|.
- virtual void OnCommit(syncer::ModelTypeSet committed_model_types) = 0;
+ virtual void OnCommit(
+ const std::string& committer_id,
+ syncer::ModelTypeSet committed_model_types) = 0;
};
FakeServer();
@@ -71,7 +73,8 @@ class FakeServer {
sync_pb::GetUpdatesResponse* response);
// Processes a Commit call.
- bool HandleCommitRequest(const sync_pb::CommitMessage& commit,
+ bool HandleCommitRequest(const sync_pb::CommitMessage& message,
+ const std::string& invalidator_client_id,
sync_pb::CommitResponse* response);
// Inserts the default permanent items in |entities_|.