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

Side by Side Diff: chrome/browser/sync/profile_sync_components_factory_mock.cc

Issue 398423002: Sync: Refactoring of DEVICE_INFO syncable type - Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed wrong signin_scoped_device_id assert from LocalDeviceInfoProvider. Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/sync/profile_sync_components_factory_mock.h" 5 #include "chrome/browser/sync/profile_sync_components_factory_mock.h"
6
7 #include "chrome/browser/sync/glue/local_device_info_provider_mock.h"
6 #include "components/sync_driver/change_processor.h" 8 #include "components/sync_driver/change_processor.h"
7 #include "components/sync_driver/model_associator.h" 9 #include "components/sync_driver/model_associator.h"
8 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
9 #include "sync/api/attachments/attachment_service_impl.h" 11 #include "sync/api/attachments/attachment_service_impl.h"
10 #include "sync/internal_api/public/attachments/fake_attachment_store.h" 12 #include "sync/internal_api/public/attachments/fake_attachment_store.h"
11 13
12 using browser_sync::AssociatorInterface; 14 using browser_sync::AssociatorInterface;
13 using browser_sync::ChangeProcessor; 15 using browser_sync::ChangeProcessor;
14 using testing::_; 16 using testing::_;
15 using testing::InvokeWithoutArgs; 17 using testing::InvokeWithoutArgs;
18 using testing::Return;
16 19
17 ProfileSyncComponentsFactoryMock::ProfileSyncComponentsFactoryMock() {} 20 ProfileSyncComponentsFactoryMock::ProfileSyncComponentsFactoryMock()
21 : local_device_(new browser_sync::LocalDeviceInfoProviderMock()) {
22 }
18 23
19 ProfileSyncComponentsFactoryMock::ProfileSyncComponentsFactoryMock( 24 ProfileSyncComponentsFactoryMock::ProfileSyncComponentsFactoryMock(
20 AssociatorInterface* model_associator, ChangeProcessor* change_processor) 25 AssociatorInterface* model_associator, ChangeProcessor* change_processor)
21 : model_associator_(model_associator), 26 : model_associator_(model_associator),
22 change_processor_(change_processor) { 27 change_processor_(change_processor),
28 local_device_(new browser_sync::LocalDeviceInfoProviderMock()) {
23 ON_CALL(*this, CreateBookmarkSyncComponents(_, _)). 29 ON_CALL(*this, CreateBookmarkSyncComponents(_, _)).
24 WillByDefault( 30 WillByDefault(
25 InvokeWithoutArgs( 31 InvokeWithoutArgs(
26 this, 32 this,
27 &ProfileSyncComponentsFactoryMock::MakeSyncComponents)); 33 &ProfileSyncComponentsFactoryMock::MakeSyncComponents));
28 } 34 }
29 35
30 ProfileSyncComponentsFactoryMock::~ProfileSyncComponentsFactoryMock() {} 36 ProfileSyncComponentsFactoryMock::~ProfileSyncComponentsFactoryMock() {}
31 37
32 scoped_ptr<syncer::AttachmentService> 38 scoped_ptr<syncer::AttachmentService>
33 ProfileSyncComponentsFactoryMock::CreateAttachmentService( 39 ProfileSyncComponentsFactoryMock::CreateAttachmentService(
34 const syncer::UserShare& user_share, 40 const syncer::UserShare& user_share,
35 syncer::AttachmentService::Delegate* delegate) { 41 syncer::AttachmentService::Delegate* delegate) {
36 return syncer::AttachmentServiceImpl::CreateForTest(); 42 return syncer::AttachmentServiceImpl::CreateForTest();
37 } 43 }
38 44
39 ProfileSyncComponentsFactory::SyncComponents 45 ProfileSyncComponentsFactory::SyncComponents
40 ProfileSyncComponentsFactoryMock::MakeSyncComponents() { 46 ProfileSyncComponentsFactoryMock::MakeSyncComponents() {
41 return SyncComponents(model_associator_.release(), 47 return SyncComponents(model_associator_.release(),
42 change_processor_.release()); 48 change_processor_.release());
43 } 49 }
50
51 scoped_ptr<browser_sync::LocalDeviceInfoProvider>
52 ProfileSyncComponentsFactoryMock::CreateLocalDeviceInfoProvider() {
53 return local_device_.Pass();
54 }
55
56 void ProfileSyncComponentsFactoryMock::SetLocalDeviceInfoProvider(
57 scoped_ptr<browser_sync::LocalDeviceInfoProvider> local_device) {
58 local_device_ = local_device.Pass();
59 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_components_factory_mock.h ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698