OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/test/fake_remote_host_info_fetcher.h" | 5 #include "remoting/test/fake_remote_host_info_fetcher.h" |
6 | 6 |
7 namespace remoting { | 7 namespace remoting { |
8 namespace test { | 8 namespace test { |
9 | 9 |
10 FakeRemoteHostInfoFetcher::FakeRemoteHostInfoFetcher() : | 10 FakeRemoteHostInfoFetcher::FakeRemoteHostInfoFetcher() |
11 fail_retrieve_remote_host_info_(false) {} | 11 : fail_retrieve_remote_host_info_(false) { |
| 12 } |
12 | 13 |
13 FakeRemoteHostInfoFetcher::~FakeRemoteHostInfoFetcher() {} | 14 FakeRemoteHostInfoFetcher::~FakeRemoteHostInfoFetcher() { |
| 15 } |
14 | 16 |
15 bool FakeRemoteHostInfoFetcher::RetrieveRemoteHostInfo( | 17 bool FakeRemoteHostInfoFetcher::RetrieveRemoteHostInfo( |
16 const std::string& application_id, | 18 const std::string& application_id, |
17 const std::string& access_token, | 19 const std::string& access_token, |
18 ServiceEnvironment service_environment, | 20 ServiceEnvironment service_environment, |
19 const RemoteHostInfoCallback& callback) { | 21 const RemoteHostInfoCallback& callback) { |
20 RemoteHostInfo remote_host_info; | 22 RemoteHostInfo remote_host_info; |
21 | 23 |
22 if (fail_retrieve_remote_host_info_) { | 24 if (fail_retrieve_remote_host_info_) { |
23 remote_host_info.remote_host_status = kRemoteHostStatusPending; | 25 remote_host_info.remote_host_status = kRemoteHostStatusPending; |
24 } else { | 26 } else { |
25 remote_host_info.remote_host_status = kRemoteHostStatusReady; | 27 remote_host_info.remote_host_status = kRemoteHostStatusReady; |
26 remote_host_info.application_id = application_id; | 28 remote_host_info.application_id = application_id; |
27 } | 29 } |
28 | 30 |
29 callback.Run(remote_host_info); | 31 callback.Run(remote_host_info); |
30 | 32 |
31 return !fail_retrieve_remote_host_info_; | 33 return !fail_retrieve_remote_host_info_; |
32 } | 34 } |
33 | 35 |
34 } // namespace test | 36 } // namespace test |
35 } // namespace remoting | 37 } // namespace remoting |
OLD | NEW |