OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef COMPONENTS_SYNC_DRIVER_FAKE_SYNC_CLIENT_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_FAKE_SYNC_CLIENT_H_ |
6 #define COMPONENTS_SYNC_DRIVER_FAKE_SYNC_CLIENT_H_ | 6 #define COMPONENTS_SYNC_DRIVER_FAKE_SYNC_CLIENT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "components/sync/driver/sync_client.h" | 11 #include "components/sync/driver/sync_client.h" |
12 #include "components/syncable_prefs/testing_pref_service_syncable.h" | 12 #include "components/sync_preferences/testing_pref_service_syncable.h" |
13 | 13 |
14 namespace syncer { | 14 namespace syncer { |
15 | 15 |
16 class FakeSyncService; | 16 class FakeSyncService; |
17 | 17 |
18 // Fake implementation of SyncClient interface for tests. | 18 // Fake implementation of SyncClient interface for tests. |
19 class FakeSyncClient : public SyncClient { | 19 class FakeSyncClient : public SyncClient { |
20 public: | 20 public: |
21 FakeSyncClient(); | 21 FakeSyncClient(); |
22 explicit FakeSyncClient(SyncApiComponentFactory* factory); | 22 explicit FakeSyncClient(SyncApiComponentFactory* factory); |
(...skipping 19 matching lines...) Expand all Loading... |
42 base::WeakPtr<ModelTypeService> GetModelTypeServiceForType( | 42 base::WeakPtr<ModelTypeService> GetModelTypeServiceForType( |
43 ModelType type) override; | 43 ModelType type) override; |
44 scoped_refptr<ModelSafeWorker> CreateModelWorkerForGroup( | 44 scoped_refptr<ModelSafeWorker> CreateModelWorkerForGroup( |
45 ModelSafeGroup group, | 45 ModelSafeGroup group, |
46 WorkerLoopDestructionObserver* observer) override; | 46 WorkerLoopDestructionObserver* observer) override; |
47 SyncApiComponentFactory* GetSyncApiComponentFactory() override; | 47 SyncApiComponentFactory* GetSyncApiComponentFactory() override; |
48 | 48 |
49 void SetModelTypeService(ModelTypeService* model_type_service); | 49 void SetModelTypeService(ModelTypeService* model_type_service); |
50 | 50 |
51 private: | 51 private: |
52 syncable_prefs::TestingPrefServiceSyncable pref_service_; | 52 sync_preferences::TestingPrefServiceSyncable pref_service_; |
53 ModelTypeService* model_type_service_; | 53 ModelTypeService* model_type_service_; |
54 SyncApiComponentFactory* factory_; | 54 SyncApiComponentFactory* factory_; |
55 std::unique_ptr<FakeSyncService> sync_service_; | 55 std::unique_ptr<FakeSyncService> sync_service_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(FakeSyncClient); | 57 DISALLOW_COPY_AND_ASSIGN(FakeSyncClient); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace syncer | 60 } // namespace syncer |
61 | 61 |
62 #endif // COMPONENTS_SYNC_DRIVER_FAKE_SYNC_CLIENT_H_ | 62 #endif // COMPONENTS_SYNC_DRIVER_FAKE_SYNC_CLIENT_H_ |
OLD | NEW |