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

Side by Side Diff: remoting/test/app_remoting_connection_helper.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: Made changes to unittest to use ConnectionSetupInfo. 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698