Chromium Code Reviews| 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..15afca8f72a3a19ca848340c73d3b08d3cabe6e4 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" |
| @@ -197,7 +198,7 @@ int main(int argc, char* argv[]) { |
| return 0; |
| } |
| - // Update the logging verbosity level is user specified one. |
| + // Update the logging verbosity level if user specified one. |
| std::string verbosity_level( |
| command_line->GetSwitchValueASCII(switches::kLoggingLevelSwitchName)); |
| if (!verbosity_level.empty()) { |
| @@ -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; |
| + test_chromoting_client.AddRemoteConnectionObserver(&observer); |
|
joedow
2015/07/27 21:45:44
Please send an update once your change to add the
tonychun
2015/07/28 17:53:44
The changes have landed and are now together with
|
| + |
| + // 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.Initialize(); |
| 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"; |