Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Side by Side Diff: remoting/test/remote_host_info.cc

Issue 1237093004: Support for connecting to localhost on the chromoting test driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Indent fix. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/test/remote_host_info.h ('k') | remoting/test/test_chromoting_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/protocol/authentication_method.h"
5 #include "remoting/test/remote_host_info.h" 6 #include "remoting/test/remote_host_info.h"
6 7
7 #include "base/logging.h" 8 #include "base/logging.h"
8 9
10 namespace {
11 const char kAppRemotingCapabilities[] =
12 "rateLimitResizeRequests desktopShape sendInitialResolution googleDrive";
13 const char kFakeHostPublicKey[] = "FAKE_HOST_PUBLIC_KEY";
14 }
15
9 namespace remoting { 16 namespace remoting {
10 namespace test { 17 namespace test {
11 18
12 RemoteHostInfo::RemoteHostInfo() 19 RemoteHostInfo::RemoteHostInfo()
13 : remote_host_status(kRemoteHostStatusUnknown) { 20 : remote_host_status(kRemoteHostStatusUnknown) {
14 } 21 }
15 22
16 RemoteHostInfo::~RemoteHostInfo() { 23 RemoteHostInfo::~RemoteHostInfo() {
17 } 24 }
18 25
19 bool RemoteHostInfo::IsReadyForConnection() const { 26 bool RemoteHostInfo::IsReadyForConnection() const {
20 return (remote_host_status == kRemoteHostStatusReady); 27 return remote_host_status == kRemoteHostStatusReady;
21 } 28 }
22 29
23 void RemoteHostInfo::SetRemoteHostStatusFromString( 30 void RemoteHostInfo::SetRemoteHostStatusFromString(
24 const std::string& status_string) { 31 const std::string& status_string) {
25 if (status_string == "done") { 32 if (status_string == "done") {
26 remote_host_status = kRemoteHostStatusReady; 33 remote_host_status = kRemoteHostStatusReady;
27 } else if (status_string == "pending") { 34 } else if (status_string == "pending") {
28 remote_host_status = kRemoteHostStatusPending; 35 remote_host_status = kRemoteHostStatusPending;
29 } else { 36 } else {
30 LOG(WARNING) << "Unknown status passed in: " << status_string; 37 LOG(WARNING) << "Unknown status passed in: " << status_string;
31 remote_host_status = kRemoteHostStatusUnknown; 38 remote_host_status = kRemoteHostStatusUnknown;
32 } 39 }
33 } 40 }
34 41
42 ConnectionSetupInfo RemoteHostInfo::GenerateConnectionSetupInfo(
43 const std::string& access_token,
44 const std::string& user_name) const {
45 ConnectionSetupInfo connection_setup_info;
46 connection_setup_info.access_token = access_token;
47 connection_setup_info.authorization_code = authorization_code;
48 connection_setup_info.capabilities = kAppRemotingCapabilities;
49 connection_setup_info.host_id = host_id;
50 connection_setup_info.host_jid = host_jid;
51 connection_setup_info.public_key = kFakeHostPublicKey;
52 connection_setup_info.shared_secret = shared_secret;
53 connection_setup_info.user_name = user_name;
54
55 connection_setup_info.auth_methods.push_back(
56 protocol::AuthenticationMethod::ThirdParty());
57
58 return connection_setup_info;
59 }
60
35 } // namespace test 61 } // namespace test
36 } // namespace remoting 62 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/test/remote_host_info.h ('k') | remoting/test/test_chromoting_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698