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

Unified Diff: sync/test/engine/mock_connection_manager.h

Issue 11636006: WIP: The Bookmark Position Megapatch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Various updates, including switch suffix to unique_client_tag style Created 8 years 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/syncable/syncable_util.cc ('k') | sync/test/engine/mock_connection_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/engine/mock_connection_manager.h
diff --git a/sync/test/engine/mock_connection_manager.h b/sync/test/engine/mock_connection_manager.h
index 008887b428015fcb0b029397ac8f424d7fb5cb00..ad8da0d1255b0251d015c32bb21bd18b99e72d5a 100644
--- a/sync/test/engine/mock_connection_manager.h
+++ b/sync/test/engine/mock_connection_manager.h
@@ -18,6 +18,7 @@
#include "sync/engine/net/server_connection_manager.h"
#include "sync/internal_api/public/base/model_type.h"
#include "sync/internal_api/public/base/model_type_invalidation_map.h"
+#include "sync/internal_api/public/base/unique_position.h"
#include "sync/protocol/sync.pb.h"
namespace syncer {
@@ -92,6 +93,13 @@ class MockConnectionManager : public ServerConnectionManager {
sync_pb::SyncEntity* AddUpdateSpecifics(int id, int parent_id,
std::string name,int64 version, int64 sync_ts, bool is_dir,
int64 position, const sync_pb::EntitySpecifics& specifics);
+ sync_pb::SyncEntity* AddBookmarkUpdateSpecifics(
+ int id, int parent_id, std::string name, int64 version, int64 sync_ts,
+ bool is_dir, int64 position, const sync_pb::EntitySpecifics& specifics);
+ sync_pb::SyncEntity* AddBookmarkUpdateSpecifics(int id, int parent_id,
+ std::string name, int64 version, int64 sync_ts, bool is_dir,
+ const syncer::UniquePosition& position,
+ const sync_pb::EntitySpecifics& specifics);
sync_pb::SyncEntity* SetNigori(int id, int64 version, int64 sync_ts,
const sync_pb::EntitySpecifics& specifics);
@@ -268,6 +276,15 @@ class MockConnectionManager : public ServerConnectionManager {
sync_pb::DataTypeProgressMarker>& filter,
ModelType value);
+ // Sets some reasonable values for originator_item_id and
+ // originator_cache_guid if the given entity is of type BOOKMARKS.
+ //
+ // Unfortunately, there's no guarantee that a single item will always have the
+ // same originator_client_item_id, though such a guarantee would be exist in a
+ // real sync system. This could lead to spurious position changes in some
+ // situations.
+ void SetUpdateOriginatorFields(sync_pb::SyncEntity* ent);
+
// When false, we pretend to have network connectivity issues.
bool server_reachable_;
@@ -349,6 +366,9 @@ class MockConnectionManager : public ServerConnectionManager {
sync_pb::ClientToServerMessage last_request_;
+ // A unique originator_item_id value.
+ int64 originator_item_id_;
+
DISALLOW_COPY_AND_ASSIGN(MockConnectionManager);
};
« no previous file with comments | « sync/syncable/syncable_util.cc ('k') | sync/test/engine/mock_connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698