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

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

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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
« no previous file with comments | « sync/api/attachments/attachment_store_backend.cc ('k') | sync/api/conflict_resolution.h » ('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
deleted file mode 100644
index 3b45fbe4ff325e0014487144eadd6792e8cbe8fb..0000000000000000000000000000000000000000
--- a/sync/api/attachments/attachment_unittest.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/api/attachments/attachment.h"
-
-#include <stdint.h>
-
-#include <string>
-
-#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"
-
-namespace syncer {
-
-namespace {
-
-const char kAttachmentData[] = "some data";
-
-} // namespace
-
-class AttachmentTest : public testing::Test {};
-
-TEST_F(AttachmentTest, Create_UniqueIdIsUnique) {
- scoped_refptr<base::RefCountedString> some_data(new base::RefCountedString);
- some_data->data() = kAttachmentData;
- Attachment a1 = Attachment::Create(some_data);
- Attachment a2 = Attachment::Create(some_data);
- EXPECT_NE(a1.GetId(), a2.GetId());
- EXPECT_EQ(a1.GetData(), a2.GetData());
-}
-
-TEST_F(AttachmentTest, Create_WithEmptyData) {
- scoped_refptr<base::RefCountedString> empty_data(new base::RefCountedString);
- Attachment a = Attachment::Create(empty_data);
- EXPECT_EQ(empty_data, a.GetData());
-}
-
-TEST_F(AttachmentTest, CreateFromParts_HappyCase) {
- scoped_refptr<base::RefCountedString> some_data(new base::RefCountedString);
- some_data->data() = kAttachmentData;
- uint32_t crc32c = ComputeCrc32c(some_data);
- AttachmentId id = AttachmentId::Create(some_data->size(), crc32c);
- Attachment a = Attachment::CreateFromParts(id, some_data);
- EXPECT_EQ(id, a.GetId());
- EXPECT_EQ(some_data, a.GetData());
-}
-
-} // namespace syncer
« no previous file with comments | « sync/api/attachments/attachment_store_backend.cc ('k') | sync/api/conflict_resolution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698