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

Unified Diff: sync/internal_api/attachments/attachment_uploader_impl_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
Index: sync/internal_api/attachments/attachment_uploader_impl_unittest.cc
diff --git a/sync/internal_api/attachments/attachment_uploader_impl_unittest.cc b/sync/internal_api/attachments/attachment_uploader_impl_unittest.cc
index 1213b9faaa47df0a15b868217c6c1d2134f3f286..d31fc180441d428054d780dae79f9d5febbd4747 100644
--- a/sync/internal_api/attachments/attachment_uploader_impl_unittest.cc
+++ b/sync/internal_api/attachments/attachment_uploader_impl_unittest.cc
@@ -23,6 +23,7 @@
#include "net/test/embedded_test_server/http_response.h"
#include "net/url_request/url_request_test_util.h"
#include "sync/api/attachments/attachment.h"
+#include "sync/internal_api/public/attachments/attachment_util.h"
#include "sync/protocol/sync.pb.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -627,18 +628,16 @@ TEST_F(AttachmentUploaderImplTest, UploadAttachment_BadToken) {
ASSERT_EQ(1, token_service().num_invalidate_token());
}
-TEST_F(AttachmentUploaderImplTest, ComputeCrc32cHash) {
+TEST_F(AttachmentUploaderImplTest, FormatCrc32cHash) {
scoped_refptr<base::RefCountedString> empty(new base::RefCountedString);
empty->data() = "";
EXPECT_EQ("AAAAAA==",
- AttachmentUploaderImpl::ComputeCrc32cHash(empty->front_as<char>(),
- empty->size()));
+ AttachmentUploaderImpl::FormatCrc32cHash(ComputeCrc32c(empty)));
scoped_refptr<base::RefCountedString> hello_world(new base::RefCountedString);
hello_world->data() = "hello world";
- EXPECT_EQ("yZRlqg==",
- AttachmentUploaderImpl::ComputeCrc32cHash(
- hello_world->front_as<char>(), hello_world->size()));
+ EXPECT_EQ("yZRlqg==", AttachmentUploaderImpl::FormatCrc32cHash(
+ ComputeCrc32c(hello_world)));
}
// TODO(maniscalco): Add test case for when we are uploading an attachment that
« no previous file with comments | « sync/internal_api/attachments/attachment_uploader_impl.cc ('k') | sync/internal_api/attachments/attachment_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698