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

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: Edited merge errors, comments, and optimized code. 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
Index: remoting/test/host_info.cc
diff --git a/remoting/test/host_info.cc b/remoting/test/host_info.cc
index 341829f662e5f40815c61b2b29e817de77cc8172..d96dad42ba76bb312eefe8fb7baae1d2694dbf4b 100644
--- a/remoting/test/host_info.cc
+++ b/remoting/test/host_info.cc
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+
joedow 2015/07/17 23:26:29 remove extra newline
tonychun 2015/07/20 14:29:17 Done.
+#include "base/strings/string_split.h"
joedow 2015/07/17 23:26:30 Is the string split header still needed? It seems
tonychun 2015/07/20 14:29:17 Done.
+#include "remoting/protocol/authentication_method.h"
#include "remoting/test/host_info.h"
#include "base/logging.h"
@@ -70,5 +73,35 @@ 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;
joedow 2015/07/17 23:26:29 Can you some newlines here, one after line 84 woul
tonychun 2015/07/20 14:29:17 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698