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

Side by Side Diff: components/sync_driver/generic_change_processor_unittest.cc

Issue 554743004: Update AttachmentServiceImpl to retry attachment uploads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master. Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync_driver/generic_change_processor.h" 5 #include "components/sync_driver/generic_change_processor.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 std::vector<syncer::AttachmentIdSet> attachment_id_sets_; 49 std::vector<syncer::AttachmentIdSet> attachment_id_sets_;
50 }; 50 };
51 51
52 MockAttachmentService::MockAttachmentService( 52 MockAttachmentService::MockAttachmentService(
53 const scoped_refptr<syncer::AttachmentStore>& attachment_store) 53 const scoped_refptr<syncer::AttachmentStore>& attachment_store)
54 : AttachmentServiceImpl(attachment_store, 54 : AttachmentServiceImpl(attachment_store,
55 scoped_ptr<syncer::AttachmentUploader>( 55 scoped_ptr<syncer::AttachmentUploader>(
56 new syncer::FakeAttachmentUploader), 56 new syncer::FakeAttachmentUploader),
57 scoped_ptr<syncer::AttachmentDownloader>( 57 scoped_ptr<syncer::AttachmentDownloader>(
58 new syncer::FakeAttachmentDownloader), 58 new syncer::FakeAttachmentDownloader),
59 NULL) { 59 NULL,
60 base::TimeDelta(),
61 base::TimeDelta()) {
60 } 62 }
61 63
62 MockAttachmentService::~MockAttachmentService() { 64 MockAttachmentService::~MockAttachmentService() {
63 } 65 }
64 66
65 void MockAttachmentService::UploadAttachments( 67 void MockAttachmentService::UploadAttachments(
66 const syncer::AttachmentIdSet& attachment_ids) { 68 const syncer::AttachmentIdSet& attachment_ids) {
67 attachment_id_sets_.push_back(attachment_ids); 69 attachment_id_sets_.push_back(attachment_ids);
68 AttachmentServiceImpl::UploadAttachments(attachment_ids); 70 AttachmentServiceImpl::UploadAttachments(attachment_ids);
69 } 71 }
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 syncer::ReadNode node(&read_transaction); 429 syncer::ReadNode node(&read_transaction);
428 ASSERT_EQ(node.InitByClientTagLookup(syncer::PREFERENCES, tag), 430 ASSERT_EQ(node.InitByClientTagLookup(syncer::PREFERENCES, tag),
429 syncer::BaseNode::INIT_OK); 431 syncer::BaseNode::INIT_OK);
430 syncer::AttachmentIdList attachment_ids = node.GetAttachmentIds(); 432 syncer::AttachmentIdList attachment_ids = node.GetAttachmentIds();
431 EXPECT_EQ(1U, attachment_ids.size()); 433 EXPECT_EQ(1U, attachment_ids.size());
432 } 434 }
433 435
434 } // namespace 436 } // namespace
435 437
436 } // namespace sync_driver 438 } // namespace sync_driver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698