| OLD | NEW |
| 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/test/app_remoting_connection_helper.h" | 5 #include "remoting/test/app_remoting_connection_helper.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 DCHECK(!run_loop_ || !run_loop_->running()); | 71 DCHECK(!run_loop_ || !run_loop_->running()); |
| 72 run_loop_.reset(new base::RunLoop()); | 72 run_loop_.reset(new base::RunLoop()); |
| 73 | 73 |
| 74 // We will wait up to 30 seconds to complete the remote connection and for the | 74 // We will wait up to 30 seconds to complete the remote connection and for the |
| 75 // main application window to become visible. | 75 // main application window to become visible. |
| 76 DCHECK(!timer_->IsRunning()); | 76 DCHECK(!timer_->IsRunning()); |
| 77 timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(30), | 77 timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(30), |
| 78 run_loop_->QuitClosure()); | 78 run_loop_->QuitClosure()); |
| 79 | 79 |
| 80 client_->StartConnection(AppRemotingSharedData->user_name(), | 80 client_->StartConnection(remote_host_info.GenerateConnectionSetupInfo( |
| 81 AppRemotingSharedData->access_token(), | 81 AppRemotingSharedData->access_token(), |
| 82 remote_host_info); | 82 AppRemotingSharedData->user_name())); |
| 83 | 83 |
| 84 run_loop_->Run(); | 84 run_loop_->Run(); |
| 85 timer_->Stop(); | 85 timer_->Stop(); |
| 86 | 86 |
| 87 if (connection_is_ready_for_tests_) { | 87 if (connection_is_ready_for_tests_) { |
| 88 return true; | 88 return true; |
| 89 } else { | 89 } else { |
| 90 client_->EndConnection(); | 90 client_->EndConnection(); |
| 91 return false; | 91 return false; |
| 92 } | 92 } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 DCHECK(run_loop_); | 216 DCHECK(run_loop_); |
| 217 // Now that the main window is visible, give the app some time to settle | 217 // Now that the main window is visible, give the app some time to settle |
| 218 // before signaling that it is ready to run tests. | 218 // before signaling that it is ready to run tests. |
| 219 timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(2), | 219 timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(2), |
| 220 run_loop_->QuitClosure()); | 220 run_loop_->QuitClosure()); |
| 221 } | 221 } |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace test | 224 } // namespace test |
| 225 } // namespace remoting | 225 } // namespace remoting |
| OLD | NEW |