blob: 2532de31f1524ce848d8bb3c7bdb0c5190340055 [file] [log] [blame]
khorimoto54b75082017-03-03 23:54:311// Copyright 2017 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 CHROMEOS_COMPONENTS_TETHER_FAKE_TETHER_HOST_FETCHER_H_
6#define CHROMEOS_COMPONENTS_TETHER_FAKE_TETHER_HOST_FETCHER_H_
7
8#include <vector>
9
10#include "base/macros.h"
Kyle Horimotoffeff6a72018-12-01 02:42:0611#include "chromeos/components/multidevice/remote_device_ref.h"
khorimoto54b75082017-03-03 23:54:3112#include "chromeos/components/tether/tether_host_fetcher.h"
khorimoto54b75082017-03-03 23:54:3113
14namespace chromeos {
15
16namespace tether {
17
18// Test double for TetherHostFetcher.
19class FakeTetherHostFetcher : public TetherHostFetcher {
20 public:
Kyle Horimotoffeff6a72018-12-01 02:42:0621 explicit FakeTetherHostFetcher(
22 const multidevice::RemoteDeviceRefList& tether_hosts);
Kyle Horimotocdfd4cb7c22017-12-06 00:47:5523 FakeTetherHostFetcher();
khorimoto54b75082017-03-03 23:54:3124 ~FakeTetherHostFetcher() override;
25
Kyle Horimotoffeff6a72018-12-01 02:42:0626 void set_tether_hosts(const multidevice::RemoteDeviceRefList& tether_hosts) {
Kyle Horimotocdfd4cb7c22017-12-06 00:47:5527 tether_hosts_ = tether_hosts;
khorimoto73dc5672017-07-12 20:19:2928 }
29
Kyle Horimotocdfd4cb7c22017-12-06 00:47:5530 void NotifyTetherHostsUpdated();
khorimoto54b75082017-03-03 23:54:3131
32 // TetherHostFetcher:
Kyle Horimotocdfd4cb7c22017-12-06 00:47:5533 bool HasSyncedTetherHosts() override;
khorimoto54b75082017-03-03 23:54:3134 void FetchAllTetherHosts(
35 const TetherHostFetcher::TetherHostListCallback& callback) override;
36 void FetchTetherHost(
37 const std::string& device_id,
38 const TetherHostFetcher::TetherHostCallback& callback) override;
39
40 private:
Kyle Horimotoffeff6a72018-12-01 02:42:0641 multidevice::RemoteDeviceRefList tether_hosts_;
khorimoto54b75082017-03-03 23:54:3142
43 DISALLOW_COPY_AND_ASSIGN(FakeTetherHostFetcher);
44};
45
46} // namespace tether
47
48} // namespace chromeos
49
50#endif // CHROMEOS_COMPONENTS_TETHER_FAKE_TETHER_HOST_FETCHER_H_