OLD | NEW |
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 #include "sync/api/sync_data.h" | 5 #include "sync/api/sync_data.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 EXPECT_TRUE(data.IsLocal()); | 65 EXPECT_TRUE(data.IsLocal()); |
66 EXPECT_EQ(kSyncTag, SyncDataLocal(data).GetTag()); | 66 EXPECT_EQ(kSyncTag, SyncDataLocal(data).GetTag()); |
67 EXPECT_EQ(kDatatype, data.GetDataType()); | 67 EXPECT_EQ(kDatatype, data.GetDataType()); |
68 EXPECT_EQ(kNonUniqueTitle, data.GetTitle()); | 68 EXPECT_EQ(kNonUniqueTitle, data.GetTitle()); |
69 EXPECT_TRUE(data.GetSpecifics().has_preference()); | 69 EXPECT_TRUE(data.GetSpecifics().has_preference()); |
70 } | 70 } |
71 | 71 |
72 TEST_F(SyncDataTest, CreateLocalDataWithAttachments) { | 72 TEST_F(SyncDataTest, CreateLocalDataWithAttachments) { |
73 specifics.mutable_preference(); | 73 specifics.mutable_preference(); |
74 AttachmentIdList attachment_ids; | 74 AttachmentIdList attachment_ids; |
75 attachment_ids.push_back(AttachmentId::Create()); | 75 attachment_ids.push_back(AttachmentId::Create(0, 0)); |
76 attachment_ids.push_back(AttachmentId::Create()); | 76 attachment_ids.push_back(AttachmentId::Create(0, 0)); |
77 attachment_ids.push_back(AttachmentId::Create()); | 77 attachment_ids.push_back(AttachmentId::Create(0, 0)); |
78 | 78 |
79 SyncData data = SyncData::CreateLocalDataWithAttachments( | 79 SyncData data = SyncData::CreateLocalDataWithAttachments( |
80 kSyncTag, kNonUniqueTitle, specifics, attachment_ids); | 80 kSyncTag, kNonUniqueTitle, specifics, attachment_ids); |
81 EXPECT_TRUE(data.IsValid()); | 81 EXPECT_TRUE(data.IsValid()); |
82 EXPECT_TRUE(data.IsLocal()); | 82 EXPECT_TRUE(data.IsLocal()); |
83 EXPECT_EQ(kSyncTag, SyncDataLocal(data).GetTag()); | 83 EXPECT_EQ(kSyncTag, SyncDataLocal(data).GetTag()); |
84 EXPECT_EQ(kDatatype, data.GetDataType()); | 84 EXPECT_EQ(kDatatype, data.GetDataType()); |
85 EXPECT_EQ(kNonUniqueTitle, data.GetTitle()); | 85 EXPECT_EQ(kNonUniqueTitle, data.GetTitle()); |
86 EXPECT_TRUE(data.GetSpecifics().has_preference()); | 86 EXPECT_TRUE(data.GetSpecifics().has_preference()); |
87 attachment_ids = data.GetAttachmentIds(); | 87 attachment_ids = data.GetAttachmentIds(); |
(...skipping 28 matching lines...) Expand all Loading... |
116 EXPECT_TRUE(data.GetSpecifics().has_preference()); | 116 EXPECT_TRUE(data.GetSpecifics().has_preference()); |
117 EXPECT_TRUE(data.GetAttachmentIds().empty()); | 117 EXPECT_TRUE(data.GetAttachmentIds().empty()); |
118 } | 118 } |
119 | 119 |
120 // TODO(maniscalco): Add test cases that verify GetLocalAttachmentsForUpload | 120 // TODO(maniscalco): Add test cases that verify GetLocalAttachmentsForUpload |
121 // calls are passed through to the underlying AttachmentService. | 121 // calls are passed through to the underlying AttachmentService. |
122 | 122 |
123 } // namespace | 123 } // namespace |
124 | 124 |
125 } // namespace syncer | 125 } // namespace syncer |
OLD | NEW |