1 // Copyright 2014 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.
5 #ifndef COMPONENTS_SYNC_DRIVER_LOCAL_DEVICE_INFO_PROVIDER_MOCK_H_
6 #define COMPONENTS_SYNC_DRIVER_LOCAL_DEVICE_INFO_PROVIDER_MOCK_H_
8 #include "components/sync_driver/device_info.h"
9 #include "components/sync_driver/local_device_info_provider.h"
11 namespace sync_driver
{
13 class LocalDeviceInfoProviderMock
14 : public sync_driver::LocalDeviceInfoProvider
{
16 // Creates uninitialized provider.
17 LocalDeviceInfoProviderMock();
18 // Creates initialized provider with the specified device info.
19 LocalDeviceInfoProviderMock(
20 const std::string
& guid
,
21 const std::string
& client_name
,
22 const std::string
& chrome_version
,
23 const std::string
& sync_user_agent
,
24 const sync_pb::SyncEnums::DeviceType device_type
,
25 const std::string
& signin_scoped_device_id
);
26 ~LocalDeviceInfoProviderMock() override
;
28 const DeviceInfo
* GetLocalDeviceInfo() const override
;
29 std::string
GetLocalSyncCacheGUID() const override
;
30 void Initialize(const std::string
& cache_guid
,
31 const std::string
& signin_scoped_device_id
) override
;
32 scoped_ptr
<Subscription
> RegisterOnInitializedCallback(
33 const base::Closure
& callback
) override
;
35 void SetInitialized(bool is_initialized
);
40 scoped_ptr
<DeviceInfo
> local_device_info_
;
41 base::CallbackList
<void(void)> callback_list_
;
44 } // namespace sync_driver
46 #endif // COMPONENTS_SYNC_DRIVER_LOCAL_DEVICE_INFO_PROVIDER_MOCK_H_