fake_device_info_sync_service.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #ifndef COMPONENTS_SYNC_DEVICE_INFO_FAKE_DEVICE_INFO_SYNC_SERVICE_H_
  5. #define COMPONENTS_SYNC_DEVICE_INFO_FAKE_DEVICE_INFO_SYNC_SERVICE_H_
  6. #include "components/sync/test/fake_model_type_controller_delegate.h"
  7. #include "components/sync_device_info/device_info_sync_service.h"
  8. #include "components/sync_device_info/fake_device_info_tracker.h"
  9. #include "components/sync_device_info/fake_local_device_info_provider.h"
  10. namespace syncer {
  11. class FakeDeviceInfoSyncService : public DeviceInfoSyncService {
  12. public:
  13. explicit FakeDeviceInfoSyncService(bool skip_engine_connection = false);
  14. ~FakeDeviceInfoSyncService() override;
  15. // DeviceInfoSyncService implementation.
  16. FakeLocalDeviceInfoProvider* GetLocalDeviceInfoProvider() override;
  17. FakeDeviceInfoTracker* GetDeviceInfoTracker() override;
  18. base::WeakPtr<ModelTypeControllerDelegate> GetControllerDelegate() override;
  19. void RefreshLocalDeviceInfo() override;
  20. // Returns number of times RefreshLocalDeviceInfo() has been called.
  21. int RefreshLocalDeviceInfoCount();
  22. private:
  23. FakeDeviceInfoTracker fake_device_info_tracker_;
  24. FakeLocalDeviceInfoProvider fake_local_device_info_provider_;
  25. FakeModelTypeControllerDelegate fake_model_type_controller_delegate_;
  26. int refresh_local_device_info_count_ = 0;
  27. };
  28. } // namespace syncer
  29. #endif // COMPONENTS_SYNC_DEVICE_INFO_FAKE_DEVICE_INFO_SYNC_SERVICE_H_