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

Unified Diff: remoting/test/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/test/host_info.h ('k') | remoting/test/remote_host_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/test/host_info.cc
diff --git a/remoting/test/host_info.cc b/remoting/test/host_info.cc
index 341829f662e5f40815c61b2b29e817de77cc8172..1370011a4a97871e8e603c35dd266c47758e7e15 100644
--- a/remoting/test/host_info.cc
+++ b/remoting/test/host_info.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "remoting/protocol/authentication_method.h"
#include "remoting/test/host_info.h"
#include "base/logging.h"
@@ -70,5 +71,36 @@ bool HostInfo::ParseHostInfo(const base::DictionaryValue& host_info) {
return true;
}
+bool HostInfo::IsReadyForConnection() const {
+ return !host_jid.empty() && status == kHostStatusOnline;
+}
+
+ConnectionSetupInfo HostInfo::GenerateConnectionSetupInfo(
+ const std::string& access_token,
+ const std::string& user_name,
+ const std::string& pin) const {
+ ConnectionSetupInfo connection_setup_info;
+ connection_setup_info.access_token = access_token;
+ connection_setup_info.host_id = host_id;
+ connection_setup_info.host_jid = host_jid;
+ connection_setup_info.host_name = host_name;
+ connection_setup_info.pin = pin;
+ connection_setup_info.public_key = public_key;
+ connection_setup_info.user_name = user_name;
+
+ connection_setup_info.auth_methods.push_back(
+ protocol::AuthenticationMethod::Spake2Pair());
+ connection_setup_info.auth_methods.push_back(
+ protocol::AuthenticationMethod::Spake2(
+ protocol::AuthenticationMethod::HashFunction::NONE));
+ connection_setup_info.auth_methods.push_back(
+ protocol::AuthenticationMethod::Spake2(
+ protocol::AuthenticationMethod::HashFunction::HMAC_SHA256));
+ connection_setup_info.auth_methods.push_back(
+ protocol::AuthenticationMethod::ThirdParty());
+
+ return connection_setup_info;
+}
+
} // namespace test
} // namespace remoting
« no previous file with comments | « remoting/test/host_info.h ('k') | remoting/test/remote_host_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698