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

Unified Diff: sync/internal_api/public/base/attachment_id_proto_unittest.cc

Issue 393083004: Update Commit and GetUpdatesResponse messages to include attachment ids. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update SyncManagerImpl to detect attachment metadata changes. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sync/internal_api/public/base/attachment_id_proto_unittest.cc
diff --git a/sync/internal_api/public/base/attachment_id_proto_unittest.cc b/sync/internal_api/public/base/attachment_id_proto_unittest.cc
index 8883a4560edf337b2407922ef1e692e474e1ebd5..6f029addfd276998efb1abb4d4a1d5dacea70d33 100644
--- a/sync/internal_api/public/base/attachment_id_proto_unittest.cc
+++ b/sync/internal_api/public/base/attachment_id_proto_unittest.cc
@@ -26,4 +26,24 @@ TEST(AttachmentIdProtoTest, UniqueIdFormat) {
EXPECT_EQ(StringToLowerASCII(id_proto.unique_id()), id_proto.unique_id());
}
+TEST(AttachmentIdProtoTest, CreateAttachmentMetadata_Empty) {
+ google::protobuf::RepeatedPtrField<sync_pb::AttachmentIdProto> ids;
+ sync_pb::AttachmentMetadata metadata = CreateAttachmentMetadata(ids);
+ EXPECT_EQ(0, metadata.record_size());
+}
+
+TEST(AttachmentIdProtoTest, CreateAttachmentMetadata_NonEmpty) {
+ google::protobuf::RepeatedPtrField<sync_pb::AttachmentIdProto> ids;
+ *ids.Add() = CreateAttachmentIdProto();
+ *ids.Add() = CreateAttachmentIdProto();
+ *ids.Add() = CreateAttachmentIdProto();
+ sync_pb::AttachmentMetadata metadata = CreateAttachmentMetadata(ids);
+ ASSERT_EQ(3, metadata.record_size());
+ for (int i = 0; i < metadata.record_size(); ++i) {
+ EXPECT_EQ(ids.Get(i).SerializeAsString(),
+ metadata.record(i).id().SerializeAsString());
+ EXPECT_TRUE(metadata.record(i).is_on_server());
+ }
+}
+
} // namespace syncer
« no previous file with comments | « sync/internal_api/public/base/attachment_id_proto.cc ('k') | sync/internal_api/public/test/test_entry_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698