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

Side by Side Diff: components/sync/test/fake_server/unique_client_entity.h

Issue 2948303002: [Sync] Sanity test for UserEvents. (Closed)
Patch Set: Rebase Created 3 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ 5 #ifndef COMPONENTS_SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_
6 #define COMPONENTS_SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ 6 #define COMPONENTS_SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 30 matching lines...) Expand all
41 // Factory function for creating a UniqueClientEntity. 41 // Factory function for creating a UniqueClientEntity.
42 static std::unique_ptr<FakeServerEntity> Create( 42 static std::unique_ptr<FakeServerEntity> Create(
43 const sync_pb::SyncEntity& client_entity); 43 const sync_pb::SyncEntity& client_entity);
44 44
45 // Factory function for creating a UniqueClientEntity for use in the 45 // Factory function for creating a UniqueClientEntity for use in the
46 // FakeServer injection API. 46 // FakeServer injection API.
47 static std::unique_ptr<FakeServerEntity> CreateForInjection( 47 static std::unique_ptr<FakeServerEntity> CreateForInjection(
48 const std::string& name, 48 const std::string& name,
49 const sync_pb::EntitySpecifics& entity_specifics); 49 const sync_pb::EntitySpecifics& entity_specifics);
50 50
51 // Derives an ID from a unique client tagged entity.
52 static std::string EffectiveIdForClientTaggedEntity(
53 const sync_pb::SyncEntity& entity);
54
55 // FakeServerEntity implementation. 51 // FakeServerEntity implementation.
56 bool RequiresParentId() const override; 52 bool RequiresParentId() const override;
57 std::string GetParentId() const override; 53 std::string GetParentId() const override;
58 void SerializeAsProto(sync_pb::SyncEntity* proto) const override; 54 void SerializeAsProto(sync_pb::SyncEntity* proto) const override;
59 55
60 private: 56 private:
61 // These member values have equivalent fields in SyncEntity. 57 // These member values have equivalent fields in SyncEntity.
62 int64_t creation_time_; 58 int64_t creation_time_;
63 int64_t last_modified_time_; 59 int64_t last_modified_time_;
64 }; 60 };
65 61
66 } // namespace fake_server 62 } // namespace fake_server
67 63
68 #endif // COMPONENTS_SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_ 64 #endif // COMPONENTS_SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_
OLDNEW
« no previous file with comments | « components/sync/test/fake_server/fake_server.cc ('k') | components/sync/test/fake_server/unique_client_entity.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698