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

Unified Diff: sync/internal_api/attachments/fake_attachment_store_unittest.cc

Issue 293143002: Add AttachmentDownloader interface, change signature of AttachmentStore::Read (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/internal_api/attachments/fake_attachment_store_unittest.cc
diff --git a/sync/internal_api/attachments/fake_attachment_store_unittest.cc b/sync/internal_api/attachments/fake_attachment_store_unittest.cc
index dffe3cf6a95c3f2aea7895f6b35242f8f5ffa356..9ed38ea91d61a98148a002b01ae740f43e9f2ced 100644
--- a/sync/internal_api/attachments/fake_attachment_store_unittest.cc
+++ b/sync/internal_api/attachments/fake_attachment_store_unittest.cc
@@ -23,6 +23,7 @@ class FakeAttachmentStoreTest : public testing::Test {
FakeAttachmentStore store;
AttachmentStore::Result result;
scoped_ptr<AttachmentMap> attachments;
+ scoped_ptr<AttachmentIdList> failed_attachment_ids;
AttachmentStore::ReadCallback read_callback;
AttachmentStore::WriteCallback write_callback;
@@ -38,7 +39,8 @@ class FakeAttachmentStoreTest : public testing::Test {
read_callback = base::Bind(&FakeAttachmentStoreTest::CopyResultAttachments,
base::Unretained(this),
&result,
- &attachments);
+ &attachments,
+ &failed_attachment_ids);
write_callback = base::Bind(
&FakeAttachmentStoreTest::CopyResult, base::Unretained(this), &result);
drop_callback = write_callback;
@@ -66,12 +68,16 @@ class FakeAttachmentStoreTest : public testing::Test {
*destination_result = source_result;
}
- void CopyResultAttachments(AttachmentStore::Result* destination_result,
- scoped_ptr<AttachmentMap>* destination_attachments,
- const AttachmentStore::Result& source_result,
- scoped_ptr<AttachmentMap> source_attachments) {
+ void CopyResultAttachments(
+ AttachmentStore::Result* destination_result,
+ scoped_ptr<AttachmentMap>* destination_attachments,
+ scoped_ptr<AttachmentIdList>* destination_failed_attachment_ids,
+ const AttachmentStore::Result& source_result,
+ scoped_ptr<AttachmentMap> source_attachments,
+ scoped_ptr<AttachmentIdList> source_failed_attachment_ids) {
CopyResult(destination_result, source_result);
*destination_attachments = source_attachments.Pass();
+ *destination_failed_attachment_ids = source_failed_attachment_ids.Pass();
}
};
@@ -160,6 +166,7 @@ TEST_F(FakeAttachmentStoreTest, Read_OneNotFound) {
// See that only attachment1 was read.
EXPECT_EQ(result, AttachmentStore::UNSPECIFIED_ERROR);
EXPECT_EQ(attachments->size(), 1U);
+ EXPECT_EQ(failed_attachment_ids->size(), 1U);
}
// Try to drop two attachments when only one exists. Verify that no error occurs

Powered by Google App Engine
This is Rietveld 408576698