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

Side by Side Diff: sync/api/sync_data_unittest.cc

Issue 982883002: [Sync] Add size and crc32c to AttachmentId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master. Created 5 years, 9 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 #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
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
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
OLDNEW
« no previous file with comments | « sync/api/attachments/attachment_unittest.cc ('k') | sync/engine/directory_commit_contribution_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698