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

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: Check ShouldDispatch in Dispatch. 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 }; 49 };
50 50
51 MockAttachmentService::MockAttachmentService() 51 MockAttachmentService::MockAttachmentService()
52 : AttachmentServiceImpl( 52 : AttachmentServiceImpl(
53 scoped_ptr<syncer::AttachmentStore>(new syncer::FakeAttachmentStore( 53 scoped_ptr<syncer::AttachmentStore>(new syncer::FakeAttachmentStore(
54 base::MessageLoopProxy::current())), 54 base::MessageLoopProxy::current())),
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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 syncer::ReadNode node(&read_transaction); 424 syncer::ReadNode node(&read_transaction);
423 ASSERT_EQ(node.InitByClientTagLookup(syncer::PREFERENCES, tag), 425 ASSERT_EQ(node.InitByClientTagLookup(syncer::PREFERENCES, tag),
424 syncer::BaseNode::INIT_OK); 426 syncer::BaseNode::INIT_OK);
425 syncer::AttachmentIdList attachment_ids = node.GetAttachmentIds(); 427 syncer::AttachmentIdList attachment_ids = node.GetAttachmentIds();
426 EXPECT_EQ(1U, attachment_ids.size()); 428 EXPECT_EQ(1U, attachment_ids.size());
427 } 429 }
428 430
429 } // namespace 431 } // namespace
430 432
431 } // namespace sync_driver 433 } // namespace sync_driver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698