Adding Test Fixture for initial test cases for the App Remoting Test Driver. Also...
[chromium-blink-merge.git] / remoting / test / fake_remote_host_info_fetcher.cc
blob8270984daf28d091db447af32bfa27da7011bdbe
1 // Copyright 2015 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 #include "remoting/test/fake_remote_host_info_fetcher.h"
7 namespace remoting {
8 namespace test {
10 FakeRemoteHostInfoFetcher::FakeRemoteHostInfoFetcher() :
11 fail_retrieve_remote_host_info_(false) {}
13 FakeRemoteHostInfoFetcher::~FakeRemoteHostInfoFetcher() {}
15 bool FakeRemoteHostInfoFetcher::RetrieveRemoteHostInfo(
16 const std::string& application_id,
17 const std::string& access_token,
18 ServiceEnvironment service_environment,
19 const RemoteHostInfoCallback& callback) {
20 RemoteHostInfo remote_host_info;
22 if (fail_retrieve_remote_host_info_) {
23 remote_host_info.remote_host_status = kRemoteHostStatusPending;
24 } else {
25 remote_host_info.remote_host_status = kRemoteHostStatusReady;
26 remote_host_info.application_id = application_id;
29 callback.Run(remote_host_info);
31 return !fail_retrieve_remote_host_info_;
34 } // namespace test
35 } // namespace remoting