summaryrefslogtreecommitdiffstats
path: root/remoting/test/fake_host_list_fetcher.h
blob: be77ca099dfe493e687402076dc7d258a291b7c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef REMOTING_TEST_FAKE_HOST_LIST_FETCHER_H_
#define REMOTING_TEST_FAKE_HOST_LIST_FETCHER_H_

#include "remoting/test/host_list_fetcher.h"

namespace remoting {
namespace test {

// Used to fake retrieving the host list without making any actual calls to the
// directory service for information.
class FakeHostListFetcher : public HostListFetcher {
 public:
  FakeHostListFetcher();
  ~FakeHostListFetcher() override;

  // HostListFetcher interface.
  void RetrieveHostlist(const std::string& access_token,
                        const HostlistCallback& callback) override;

  void set_retrieved_host_list(const std::vector<HostInfo>& host_list) {
    host_list_ = host_list;
  }

 private:
  std::vector<HostInfo> host_list_;

  DISALLOW_COPY_AND_ASSIGN(FakeHostListFetcher);
};

}  // namespace test
}  // namespace remoting

#endif  // REMOTING_TEST_FAKE_HOST_LIST_FETCHER_H_