blob: 71d646a7c132911c2a5b6982f513ce33bb6836a8 [file] [log] [blame]
Richard Knolla5e43b82020-01-28 19:49:031// Copyright 2020 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_SHARING_MOCK_SHARING_DEVICE_SOURCE_H_
6#define CHROME_BROWSER_SHARING_MOCK_SHARING_DEVICE_SOURCE_H_
7
8#include <memory>
9#include <string>
10#include <vector>
11
12#include "chrome/browser/sharing/sharing_device_source.h"
13#include "components/sync_device_info/device_info.h"
14#include "testing/gmock/include/gmock/gmock.h"
15
16class MockSharingDeviceSource : public SharingDeviceSource {
17 public:
18 MockSharingDeviceSource();
19 MockSharingDeviceSource(const MockSharingDeviceSource&) = delete;
20 MockSharingDeviceSource& operator=(const MockSharingDeviceSource&) = delete;
21 ~MockSharingDeviceSource() override;
22
23 MOCK_METHOD0(IsReady, bool());
24
25 MOCK_METHOD1(GetDeviceByGuid,
26 std::unique_ptr<syncer::DeviceInfo>(const std::string& guid));
27
28 MOCK_METHOD1(
29 GetDeviceCandidates,
30 std::vector<std::unique_ptr<syncer::DeviceInfo>>(
31 sync_pb::SharingSpecificFields::EnabledFeatures required_feature));
32
33 void MaybeRunReadyCallbacksForTesting() { MaybeRunReadyCallbacks(); }
34};
35
36#endif // CHROME_BROWSER_SHARING_MOCK_SHARING_DEVICE_SOURCE_H_