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

Unified Diff: sync/api/attachments/attachment_unittest.cc

Issue 710073003: Store attachment crc in AttachmentStore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Add comment in attachment_util.h. Created 6 years, 1 month 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
« no previous file with comments | « sync/api/attachments/attachment.cc ('k') | sync/internal_api/attachments/attachment_downloader_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/attachments/attachment_unittest.cc
diff --git a/sync/api/attachments/attachment_unittest.cc b/sync/api/attachments/attachment_unittest.cc
index c9e55503e715606ad9c6f69d5ca7880308d51faf..49b4cabf1ac847e59fa8cbd500871aa18f38fa44 100644
--- a/sync/api/attachments/attachment_unittest.cc
+++ b/sync/api/attachments/attachment_unittest.cc
@@ -8,6 +8,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/ref_counted_memory.h"
+#include "sync/internal_api/public/attachments/attachment_util.h"
#include "sync/protocol/sync.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -36,11 +37,12 @@ TEST_F(AttachmentTest, Create_WithEmptyData) {
EXPECT_EQ(empty_data, a.GetData());
}
-TEST_F(AttachmentTest, CreateWithId_HappyCase) {
+TEST_F(AttachmentTest, CreateFromParts_HappyCase) {
AttachmentId id = AttachmentId::Create();
scoped_refptr<base::RefCountedString> some_data(new base::RefCountedString);
some_data->data() = kAttachmentData;
- Attachment a = Attachment::CreateWithId(id, some_data);
+ uint32_t crc32c = ComputeCrc32c(some_data);
+ Attachment a = Attachment::CreateFromParts(id, some_data, crc32c);
EXPECT_EQ(id, a.GetId());
EXPECT_EQ(some_data, a.GetData());
}
« no previous file with comments | « sync/api/attachments/attachment.cc ('k') | sync/internal_api/attachments/attachment_downloader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698