Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync / profile_sync_components_factory_mock.cc
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/sync/glue/change_processor.h"
6 #include "chrome/browser/sync/profile_sync_components_factory_mock.h"
7 #include "components/sync_driver/model_associator.h"
8
9 using browser_sync::AssociatorInterface;
10 using browser_sync::ChangeProcessor;
11 using testing::_;
12 using testing::InvokeWithoutArgs;
13
14 ProfileSyncComponentsFactoryMock::ProfileSyncComponentsFactoryMock() {}
15
16 ProfileSyncComponentsFactoryMock::ProfileSyncComponentsFactoryMock(
17     AssociatorInterface* model_associator, ChangeProcessor* change_processor)
18     : model_associator_(model_associator),
19       change_processor_(change_processor) {
20   ON_CALL(*this, CreateBookmarkSyncComponents(_, _)).
21       WillByDefault(
22           InvokeWithoutArgs(
23               this,
24               &ProfileSyncComponentsFactoryMock::MakeSyncComponents));
25 }
26
27 ProfileSyncComponentsFactoryMock::~ProfileSyncComponentsFactoryMock() {}
28
29 ProfileSyncComponentsFactory::SyncComponents
30     ProfileSyncComponentsFactoryMock::MakeSyncComponents() {
31   return SyncComponents(model_associator_.release(),
32                         change_processor_.release());
33 }