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

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

Issue 187303006: Update sync API to support attachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachmentapi
Patch Set: Fix enum related compile errors on mac. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sync/api/attachments/attachment_unittest.cc
diff --git a/sync/api/attachments/attachment_unittest.cc b/sync/api/attachments/attachment_unittest.cc
index b61d6231a498be6cfb7ac8659a376bc07e903b7f..c9e55503e715606ad9c6f69d5ca7880308d51faf 100644
--- a/sync/api/attachments/attachment_unittest.cc
+++ b/sync/api/attachments/attachment_unittest.cc
@@ -8,7 +8,6 @@
#include "base/memory/ref_counted.h"
#include "base/memory/ref_counted_memory.h"
-#include "base/memory/scoped_ptr.h"
#include "sync/protocol/sync.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -25,25 +24,25 @@ class AttachmentTest : public testing::Test {};
TEST_F(AttachmentTest, Create_UniqueIdIsUnique) {
scoped_refptr<base::RefCountedString> some_data(new base::RefCountedString);
some_data->data() = kAttachmentData;
- scoped_ptr<Attachment> a1 = Attachment::Create(some_data);
- scoped_ptr<Attachment> a2 = Attachment::Create(some_data);
- EXPECT_NE(a1->GetId(), a2->GetId());
- EXPECT_EQ(a1->GetData(), a2->GetData());
+ 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> emptyData(new base::RefCountedString);
- scoped_ptr<Attachment> a = Attachment::Create(emptyData);
- EXPECT_EQ(emptyData, a->GetData());
+ scoped_refptr<base::RefCountedString> empty_data(new base::RefCountedString);
+ Attachment a = Attachment::Create(empty_data);
+ EXPECT_EQ(empty_data, a.GetData());
}
TEST_F(AttachmentTest, CreateWithId_HappyCase) {
AttachmentId id = AttachmentId::Create();
scoped_refptr<base::RefCountedString> some_data(new base::RefCountedString);
some_data->data() = kAttachmentData;
- scoped_ptr<Attachment> a = Attachment::CreateWithId(id, some_data);
- EXPECT_EQ(id, a->GetId());
- EXPECT_EQ(some_data, a->GetData());
+ Attachment a = Attachment::CreateWithId(id, some_data);
+ EXPECT_EQ(id, a.GetId());
+ EXPECT_EQ(some_data, a.GetData());
}
} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698