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 <utility> |
| 8 |
7 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
8 #include "base/logging.h" | 10 #include "base/logging.h" |
9 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
10 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
11 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
12 #include "base/values.h" | 14 #include "base/values.h" |
13 #include "remoting/protocol/host_stub.h" | 15 #include "remoting/protocol/host_stub.h" |
14 #include "remoting/test/app_remoting_test_driver_environment.h" | 16 #include "remoting/test/app_remoting_test_driver_environment.h" |
15 #include "remoting/test/remote_application_details.h" | 17 #include "remoting/test/remote_application_details.h" |
16 #include "remoting/test/test_chromoting_client.h" | 18 #include "remoting/test/test_chromoting_client.h" |
(...skipping 22 matching lines...) Expand all Loading... |
39 if (!connection_is_ready_for_tests_) { | 41 if (!connection_is_ready_for_tests_) { |
40 client_->RemoveRemoteConnectionObserver(this); | 42 client_->RemoveRemoteConnectionObserver(this); |
41 } | 43 } |
42 client_.reset(); | 44 client_.reset(); |
43 | 45 |
44 base::RunLoop().RunUntilIdle(); | 46 base::RunLoop().RunUntilIdle(); |
45 } | 47 } |
46 | 48 |
47 void AppRemotingConnectionHelper::Initialize( | 49 void AppRemotingConnectionHelper::Initialize( |
48 scoped_ptr<TestChromotingClient> test_chromoting_client) { | 50 scoped_ptr<TestChromotingClient> test_chromoting_client) { |
49 client_ = test_chromoting_client.Pass(); | 51 client_ = std::move(test_chromoting_client); |
50 client_->AddRemoteConnectionObserver(this); | 52 client_->AddRemoteConnectionObserver(this); |
51 } | 53 } |
52 | 54 |
53 bool AppRemotingConnectionHelper::StartConnection() { | 55 bool AppRemotingConnectionHelper::StartConnection() { |
54 DCHECK(thread_checker_.CalledOnValidThread()); | 56 DCHECK(thread_checker_.CalledOnValidThread()); |
55 DCHECK(client_); | 57 DCHECK(client_); |
56 | 58 |
57 RemoteHostInfo remote_host_info; | 59 RemoteHostInfo remote_host_info; |
58 remoting::test::AppRemotingSharedData->GetRemoteHostInfoForApplicationId( | 60 remoting::test::AppRemotingSharedData->GetRemoteHostInfoForApplicationId( |
59 application_details_.application_id, &remote_host_info); | 61 application_details_.application_id, &remote_host_info); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 DCHECK(run_loop_); | 212 DCHECK(run_loop_); |
211 // Now that the main window is visible, give the app some time to settle | 213 // Now that the main window is visible, give the app some time to settle |
212 // before signaling that it is ready to run tests. | 214 // before signaling that it is ready to run tests. |
213 timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(2), | 215 timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(2), |
214 run_loop_->QuitClosure()); | 216 run_loop_->QuitClosure()); |
215 } | 217 } |
216 } | 218 } |
217 | 219 |
218 } // namespace test | 220 } // namespace test |
219 } // namespace remoting | 221 } // namespace remoting |
OLD | NEW |