summaryrefslogtreecommitdiffstats
path: root/sync/test/engine/mock_connection_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'sync/test/engine/mock_connection_manager.h')
-rw-r--r--sync/test/engine/mock_connection_manager.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sync/test/engine/mock_connection_manager.h b/sync/test/engine/mock_connection_manager.h
index 0818b72..53b950bd 100644
--- a/sync/test/engine/mock_connection_manager.h
+++ b/sync/test/engine/mock_connection_manager.h
@@ -174,6 +174,8 @@ class MockConnectionManager : public ServerConnectionManager {
void SetGUClientCommand(sync_pb::ClientCommand* command);
void SetCommitClientCommand(sync_pb::ClientCommand* command);
+ void SetTransientErrorId(syncable::Id);
+
const std::vector<syncable::Id>& committed_ids() const {
return committed_ids_;
}
@@ -284,6 +286,10 @@ class MockConnectionManager : public ServerConnectionManager {
// Determine if one entry in a commit should be rejected with a conflict.
bool ShouldConflictThisCommit();
+ // Determine if the given item's commit request should be refused with
+ // a TRANSIENT_ERROR response.
+ bool ShouldTransientErrorThisId(syncable::Id id);
+
// Generate a numeric position_in_parent value. We use a global counter
// that only decreases; this simulates new objects always being added to the
// front of the ordering.
@@ -315,6 +321,9 @@ class MockConnectionManager : public ServerConnectionManager {
// All IDs that have been committed.
std::vector<syncable::Id> committed_ids_;
+ // List of IDs which should return a transient error.
+ std::vector<syncable::Id> transient_error_ids_;
+
// Control of when/if we return conflicts.
bool conflict_all_commits_;
int conflict_n_commits_;