Index: chrome/test/sync/engine/mock_connection_manager.h |
diff --git a/chrome/test/sync/engine/mock_connection_manager.h b/chrome/test/sync/engine/mock_connection_manager.h |
index a6edce69d2539f4bb536199a3d476ef1c78627f3..5fe44b5e816f9637b90b832aa38983b9315448d6 100644 |
--- a/chrome/test/sync/engine/mock_connection_manager.h |
+++ b/chrome/test/sync/engine/mock_connection_manager.h |
@@ -9,6 +9,7 @@ |
#pragma once |
#include <bitset> |
+#include <list> |
#include <string> |
#include <vector> |
@@ -58,11 +59,6 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager { |
// that the client renames all commited entries, prepending this string. |
void SetCommitTimeRename(string prepend); |
- // Control of get updates response. All updates set will only be returned |
- // once. This mock object doesn't simulate a changelist, it simulates server |
- // responses. |
- void ResetUpdates(); |
- |
// Generic versions of AddUpdate functions. Tests using these function should |
// compile for both the int64 and string id based versions of the server. |
// The SyncEntity returned is only valid until the Sync is completed |
@@ -117,8 +113,13 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager { |
void SetLastUpdateOriginatorFields(const string& client_id, |
const string& entry_id); |
void SetLastUpdatePosition(int64 position_in_parent); |
- void SetNewTimestamp(int64 ts); |
- void SetChangesRemaining(int64 timestamp); |
+ void SetNewTimestamp(int ts); |
+ void SetChangesRemaining(int64 count); |
+ |
+ // Add a new batch of updates after the current one. Allows multiple |
+ // GetUpdates responses to be buffered up, since the syncer may |
+ // issue multiple requests during a sync cycle. |
+ void NextUpdateBatch(); |
// For AUTHENTICATE responses. |
void SetAuthenticationResponseInfo(const std::string& valid_auth_token, |
@@ -255,10 +256,17 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager { |
return next_position_in_parent_--; |
} |
- // Determine whether an EntitySpecifics filter (like that sent in |
- // GetUpdates.requested_types) indicates that a particular ModelType |
+ // Get a mutable update response which will eventually be returned to the |
+ // client. |
+ sync_pb::GetUpdatesResponse* GetUpdateResponse(); |
+ void ApplyToken(); |
+ |
+ // Determine whether an progress marker array (like that sent in |
+ // GetUpdates.from_progress_marker) indicates that a particular ModelType |
// should be included. |
- bool IsModelTypePresentInSpecifics(const sync_pb::EntitySpecifics& filter, |
+ bool IsModelTypePresentInSpecifics( |
+ const google::protobuf::RepeatedPtrField< |
+ sync_pb::DataTypeProgressMarker>& filter, |
syncable::ModelType value); |
// All IDs that have been committed. |
@@ -290,7 +298,7 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager { |
std::string directory_name_; |
// The updates we'll return to the next request. |
- sync_pb::GetUpdatesResponse updates_; |
+ std::list<sync_pb::GetUpdatesResponse> update_queue_; |
scoped_ptr<Callback0::Type> mid_commit_callback_; |
MidCommitObserver* mid_commit_observer_; |
@@ -331,6 +339,8 @@ class MockConnectionManager : public browser_sync::ServerConnectionManager { |
int num_get_updates_requests_; |
+ std::string next_token_; |
+ |
sync_pb::ClientToServerMessage last_request_; |
DISALLOW_COPY_AND_ASSIGN(MockConnectionManager); |