khorimoto | 54b7508 | 2017-03-03 23:54:31 | [diff] [blame] | 1 | // 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 Horimoto | ffeff6a7 | 2018-12-01 02:42:06 | [diff] [blame] | 11 | #include "chromeos/components/multidevice/remote_device_ref.h" |
khorimoto | 54b7508 | 2017-03-03 23:54:31 | [diff] [blame] | 12 | #include "chromeos/components/tether/tether_host_fetcher.h" |
khorimoto | 54b7508 | 2017-03-03 23:54:31 | [diff] [blame] | 13 | |
| 14 | namespace chromeos { |
| 15 | |
| 16 | namespace tether { |
| 17 | |
| 18 | // Test double for TetherHostFetcher. |
| 19 | class FakeTetherHostFetcher : public TetherHostFetcher { |
| 20 | public: |
Kyle Horimoto | ffeff6a7 | 2018-12-01 02:42:06 | [diff] [blame] | 21 | explicit FakeTetherHostFetcher( |
| 22 | const multidevice::RemoteDeviceRefList& tether_hosts); |
Kyle Horimoto | cdfd4cb7c2 | 2017-12-06 00:47:55 | [diff] [blame] | 23 | FakeTetherHostFetcher(); |
khorimoto | 54b7508 | 2017-03-03 23:54:31 | [diff] [blame] | 24 | ~FakeTetherHostFetcher() override; |
| 25 | |
Kyle Horimoto | ffeff6a7 | 2018-12-01 02:42:06 | [diff] [blame] | 26 | void set_tether_hosts(const multidevice::RemoteDeviceRefList& tether_hosts) { |
Kyle Horimoto | cdfd4cb7c2 | 2017-12-06 00:47:55 | [diff] [blame] | 27 | tether_hosts_ = tether_hosts; |
khorimoto | 73dc567 | 2017-07-12 20:19:29 | [diff] [blame] | 28 | } |
| 29 | |
Kyle Horimoto | cdfd4cb7c2 | 2017-12-06 00:47:55 | [diff] [blame] | 30 | void NotifyTetherHostsUpdated(); |
khorimoto | 54b7508 | 2017-03-03 23:54:31 | [diff] [blame] | 31 | |
| 32 | // TetherHostFetcher: |
Kyle Horimoto | cdfd4cb7c2 | 2017-12-06 00:47:55 | [diff] [blame] | 33 | bool HasSyncedTetherHosts() override; |
khorimoto | 54b7508 | 2017-03-03 23:54:31 | [diff] [blame] | 34 | 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 Horimoto | ffeff6a7 | 2018-12-01 02:42:06 | [diff] [blame] | 41 | multidevice::RemoteDeviceRefList tether_hosts_; |
khorimoto | 54b7508 | 2017-03-03 23:54:31 | [diff] [blame] | 42 | |
| 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_ |