1// Copyright (c) 2011 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#ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_FACTORY_MOCK_H__
6#define CHROME_BROWSER_SYNC_PROFILE_SYNC_FACTORY_MOCK_H__
7#pragma once
8
9#include "base/memory/scoped_ptr.h"
10#include "chrome/browser/sync/profile_sync_service.h"
11#include "chrome/browser/sync/profile_sync_factory.h"
12#include "testing/gmock/include/gmock/gmock.h"
13
14namespace browser_sync {
15class AssociatorInterface;
16class ChangeProcessor;
17}
18
19class ProfileSyncFactoryMock : public ProfileSyncFactory {
20 public:
21  ProfileSyncFactoryMock();
22  ProfileSyncFactoryMock(
23      browser_sync::AssociatorInterface* bookmark_model_associator,
24      browser_sync::ChangeProcessor* bookmark_change_processor);
25  virtual ~ProfileSyncFactoryMock();
26
27  MOCK_METHOD1(CreateProfileSyncService,
28               ProfileSyncService*(const std::string&));
29  MOCK_METHOD2(CreateDataTypeManager,
30               browser_sync::DataTypeManager*(
31                   browser_sync::SyncBackendHost*,
32                   const browser_sync::DataTypeController::TypeMap&));
33  MOCK_METHOD2(CreateAppSyncComponents,
34      SyncComponents(ProfileSyncService* profile_sync_service,
35                     browser_sync::UnrecoverableErrorHandler* error_handler));
36  MOCK_METHOD4(CreateAutofillSyncComponents,
37               SyncComponents(
38                   ProfileSyncService* profile_sync_service,
39                   WebDatabase* web_database,
40                   PersonalDataManager* personal_data,
41                   browser_sync::UnrecoverableErrorHandler* error_handler));
42  MOCK_METHOD4(CreateAutofillProfileSyncComponents,
43               SyncComponents(
44                   ProfileSyncService* profile_sync_service,
45                   WebDatabase* web_database,
46                   PersonalDataManager* personal_data,
47                   browser_sync::UnrecoverableErrorHandler* error_handler));
48  MOCK_METHOD2(CreateBookmarkSyncComponents,
49      SyncComponents(ProfileSyncService* profile_sync_service,
50                     browser_sync::UnrecoverableErrorHandler* error_handler));
51  MOCK_METHOD2(CreateExtensionSyncComponents,
52      SyncComponents(ProfileSyncService* profile_sync_service,
53                     browser_sync::UnrecoverableErrorHandler* error_handler));
54  MOCK_METHOD3(CreatePasswordSyncComponents,
55               SyncComponents(
56                   ProfileSyncService* profile_sync_service,
57                   PasswordStore* password_store,
58                   browser_sync::UnrecoverableErrorHandler* error_handler));
59  MOCK_METHOD2(CreatePreferenceSyncComponents,
60      SyncComponents(ProfileSyncService* profile_sync_service,
61                     browser_sync::UnrecoverableErrorHandler* error_handler));
62  MOCK_METHOD2(CreateSessionSyncComponents,
63      SyncComponents(ProfileSyncService* profile_sync_service,
64      browser_sync::UnrecoverableErrorHandler* error_handler));
65  MOCK_METHOD2(CreateThemeSyncComponents,
66      SyncComponents(ProfileSyncService* profile_sync_service,
67                     browser_sync::UnrecoverableErrorHandler* error_handler));
68  MOCK_METHOD3(CreateTypedUrlSyncComponents,
69               SyncComponents(
70                   ProfileSyncService* profile_sync_service,
71                   history::HistoryBackend* history_backend,
72                   browser_sync::UnrecoverableErrorHandler* error_handler));
73
74 private:
75  SyncComponents MakeBookmarkSyncComponents();
76
77  scoped_ptr<browser_sync::AssociatorInterface> bookmark_model_associator_;
78  scoped_ptr<browser_sync::ChangeProcessor> bookmark_change_processor_;
79};
80
81#endif  // CHROME_BROWSER_SYNC_PROFILE_SYNC_FACTORY_MOCK_H__
82