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

Side by Side Diff: sync/test/test_entry_factory.h

Issue 10559104: sync: Process 'control' data separately (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename, cleanup, fix tests Created 8 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/test/engine/syncer_command_test.cc ('k') | sync/test/test_entry_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SYNC_TEST_TEST_ENTRY_FACTORY_H_
6 #define SYNC_TEST_TEST_ENTRY_FACTORY_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "sync/internal_api/public/syncable/model_type.h"
12 #include "sync/protocol/sync.pb.h"
13
14 namespace syncable {
15 class Directory;
16 class Id;
17 }
18
19 namespace csync {
20
21 class TestEntryFactory {
22 public:
23 TestEntryFactory(syncable::Directory* dir);
24 ~TestEntryFactory();
25
26 // Create a new unapplied folder node with a parent.
27 void CreateUnappliedNewItemWithParent(
28 const std::string& item_id,
29 const sync_pb::EntitySpecifics& specifics,
30 const std::string& parent_id);
31
32 // Create a new unapplied update without a parent.
33 void CreateUnappliedNewItem(const std::string& item_id,
34 const sync_pb::EntitySpecifics& specifics,
35 bool is_unique);
36
37 // Create an unsynced item in the database. If item_id is a local ID, it will
38 // be treated as a create-new. Otherwise, if it's a server ID, we'll fake the
39 // server data so that it looks like it exists on the server. Returns the
40 // methandle of the created item in |metahandle_out| if not NULL.
41 void CreateUnsyncedItem(const syncable::Id& item_id,
42 const syncable::Id& parent_id,
43 const std::string& name,
44 bool is_folder,
45 syncable::ModelType model_type,
46 int64* metahandle_out);
47
48 // Creates an item that is both unsynced an an unapplied update. Returns the
49 // metahandle of the created item.
50 int64 CreateUnappliedAndUnsyncedItem(const std::string& name,
51 syncable::ModelType model_type);
52
53 // Creates an item that has neither IS_UNSYNED or IS_UNAPPLIED_UPDATE. The
54 // item is known to both the server and client. Returns the metahandle of
55 // the created item.
56 int64 CreateSyncedItem(const std::string& name, syncable::ModelType
57 model_type, bool is_folder);
58
59 int64 GetNextRevision();
60
61 private:
62 syncable::Directory* directory();
63
64 syncable::Directory* directory_;
65 int64 next_revision_;
66
67 DISALLOW_COPY_AND_ASSIGN(TestEntryFactory);
68 };
69
70 } // namespace csync
71
72 #endif // SYNC_TEST_TEST_ENTRY_FACTORY_H_
OLDNEW
« no previous file with comments | « sync/test/engine/syncer_command_test.cc ('k') | sync/test/test_entry_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698