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

Unified Diff: remoting/test/chromoting_test_driver.cc

Issue 1238343002: Added ConnectionTimeObserver to calculate the times to authenticate and connect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified display stats and added quit after connected. 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/chromoting_test_driver.cc
diff --git a/remoting/test/chromoting_test_driver.cc b/remoting/test/chromoting_test_driver.cc
index 05dddc0a37bc62764861c210b04d444529ab6557..dfd92a7d8ecd8241dad68f7abefce085be38a1de 100644
--- a/remoting/test/chromoting_test_driver.cc
+++ b/remoting/test/chromoting_test_driver.cc
@@ -17,6 +17,7 @@
#include "google_apis/google_api_keys.h"
#include "net/base/escape.h"
#include "remoting/test/access_token_fetcher.h"
+#include "remoting/test/connection_time_observer.h"
#include "remoting/test/host_info.h"
#include "remoting/test/host_list_fetcher.h"
#include "remoting/test/refresh_token_store.h"
@@ -305,12 +306,22 @@ int main(int argc, char* argv[]) {
if (it != hostlist.end()) {
// Host is online and ready, initiate a remote session.
base::Timer timer(true, false);
+ remoting::test::ConnectionTimeObserver observer(&timer);
+ test_chromoting_client.AddRemoteConnectionObserver(&observer);
+
+ // The timer will forcefully end the chromoting connection process in
+ // |kConnectionTimeoutSeconds| seconds. The set limit on time to connect
+ // stops the client from waiting indefinitely for a connection.
timer.Start(FROM_HERE,
base::TimeDelta::FromSeconds(kConnectionTimeoutSeconds),
run_loop->QuitClosure());
+ observer.SetInitializingState();
test_chromoting_client.StartConnection(
it->GenerateConnectionSetupInfo(access_token, username, pin));
run_loop->Run();
+
+ observer.DisplayConnectionStats();
+ test_chromoting_client.RemoveRemoteConnectionObserver(&observer);
test_chromoting_client.EndConnection();
} else {
LOG(ERROR) << "Requested host not found or not ready to connect";

Powered by Google App Engine
This is Rietveld 408576698