components/autofill/core/common/autofill_payments_features.cc
[chromium-dfly.git] / components / sync_device_info / fake_device_info_sync_service.h
1 // Copyright 2019 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 COMPONENTS_SYNC_DEVICE_INFO_FAKE_DEVICE_INFO_SYNC_SERVICE_H_
6 #define COMPONENTS_SYNC_DEVICE_INFO_FAKE_DEVICE_INFO_SYNC_SERVICE_H_
7
8 #include "base/callback.h"
9 #include "components/sync/test/model/fake_model_type_controller_delegate.h"
10 #include "components/sync_device_info/device_info_sync_service.h"
11 #include "components/sync_device_info/fake_device_info_tracker.h"
12 #include "components/sync_device_info/fake_local_device_info_provider.h"
13
14 namespace syncer {
15
16 class FakeDeviceInfoSyncService : public DeviceInfoSyncService {
17  public:
18   FakeDeviceInfoSyncService();
19   ~FakeDeviceInfoSyncService() override;
20
21   // DeviceInfoSyncService implementation.
22   FakeLocalDeviceInfoProvider* GetLocalDeviceInfoProvider() override;
23   FakeDeviceInfoTracker* GetDeviceInfoTracker() override;
24   base::WeakPtr<ModelTypeControllerDelegate> GetControllerDelegate() override;
25   void RefreshLocalDeviceInfo(base::OnceClosure callback) override;
26
27   // Returns number of times RefreshLocalDeviceInfo() has been called.
28   int RefreshLocalDeviceInfoCount();
29
30  private:
31   FakeDeviceInfoTracker fake_device_info_tracker_;
32   FakeLocalDeviceInfoProvider fake_local_device_info_provider_;
33   FakeModelTypeControllerDelegate fake_model_type_controller_delegate_;
34
35   int refresh_local_device_info_count_ = 0;
36 };
37
38 }  // namespace syncer
39
40 #endif  // COMPONENTS_SYNC_DEVICE_INFO_FAKE_DEVICE_INFO_SYNC_SERVICE_H_