Chromium Code Reviews| Index: sync/internal_api/public/test/test_entry_factory.h |
| diff --git a/sync/internal_api/public/test/test_entry_factory.h b/sync/internal_api/public/test/test_entry_factory.h |
| index 83efe2643e9b6a2b7a561f10ca7f46920b41dfc9..69a1fd8d9ca5b38c0f21177b6ec7d6ced0499d3b 100644 |
| --- a/sync/internal_api/public/test/test_entry_factory.h |
| +++ b/sync/internal_api/public/test/test_entry_factory.h |
| @@ -18,6 +18,11 @@ class Directory; |
| class Id; |
| } |
| +enum SpecificsType { |
| + SERVER_SPECIFICS, |
|
rlarocque
2012/09/13 22:10:51
This identifier is dangerously close to syncable::
Nicolas Zea
2012/09/13 22:50:14
Moot now that it's two methods.
|
| + LOCAL_SPECIFICS, |
| +}; |
| + |
| class TestEntryFactory { |
| public: |
| explicit TestEntryFactory(syncable::Directory* dir); |
| @@ -30,9 +35,9 @@ class TestEntryFactory { |
| const std::string& parent_id); |
| // Create a new unapplied update without a parent. |
| - void CreateUnappliedNewItem(const std::string& item_id, |
| - const sync_pb::EntitySpecifics& specifics, |
| - bool is_unique); |
| + int64 CreateUnappliedNewItem(const std::string& item_id, |
| + const sync_pb::EntitySpecifics& specifics, |
| + bool is_unique); |
| // Create an unsynced item in the database. If item_id is a local ID, it will |
| // be treated as a create-new. Otherwise, if it's a server ID, we'll fake the |
| @@ -56,6 +61,25 @@ class TestEntryFactory { |
| int64 CreateSyncedItem(const std::string& name, |
| ModelType model_type, bool is_folder); |
| + // Looks up the item referenced by |meta_handle|. If successful, overwrites |
| + // the specifics determined by |specifics_type| with |specifics|, sets |
| + // IS_UNAPPLIED_UPDATES/IS_UNSYNCED appropriately, and returns true. |
| + // Else, return false. |
| + bool SetSpecificsForItem(int64 meta_handle, |
| + SpecificsType specifics_type, |
| + const sync_pb::EntitySpecifics specifics); |
| + |
| + // Looks up the item referenced by |meta_handle|. If successful, stores |
| + // the specifics determined by |specifics_type| into |specifics| and returns |
| + // true. Else, return false. |
| + const sync_pb::EntitySpecifics& GetSpecificsForItem( |
| + int64 meta_handle, |
| + SpecificsType specifics_type) const; |
| + |
| + // Getters for IS_UNSYNCED and IS_UNAPPLIED_UPDATE bit fields. |
| + bool GetIsUnsyncedForItem(int64 meta_handle) const; |
| + bool GetIsUnappliedForItem(int64 meta_handle) const; |
| + |
| int64 GetNextRevision(); |
| private: |