OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/host/it2me/it2me_host.h" | 5 #include "remoting/host/it2me/it2me_host.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 void It2MeHostTest::RunValidationCallback(const std::string& remote_jid) { | 160 void It2MeHostTest::RunValidationCallback(const std::string& remote_jid) { |
161 base::RunLoop run_loop; | 161 base::RunLoop run_loop; |
162 | 162 |
163 network_task_runner_->PostTask( | 163 network_task_runner_->PostTask( |
164 FROM_HERE, base::Bind(&It2MeHost::SetStateForTesting, it2me_host_.get(), | 164 FROM_HERE, base::Bind(&It2MeHost::SetStateForTesting, it2me_host_.get(), |
165 It2MeHostState::kStarting, std::string())); | 165 It2MeHostState::kStarting, std::string())); |
166 | 166 |
167 network_task_runner_->PostTask( | 167 network_task_runner_->PostTask( |
168 FROM_HERE, | 168 FROM_HERE, |
| 169 base::Bind(&It2MeHost::SetStateForTesting, it2me_host_.get(), |
| 170 It2MeHostState::kRequestedAccessCode, std::string())); |
| 171 |
| 172 network_task_runner_->PostTask( |
| 173 FROM_HERE, |
| 174 base::Bind(&It2MeHost::SetStateForTesting, it2me_host_.get(), |
| 175 It2MeHostState::kReceivedAccessCode, std::string())); |
| 176 |
| 177 network_task_runner_->PostTask( |
| 178 FROM_HERE, |
169 base::Bind(it2me_host_->GetValidationCallbackForTesting(), remote_jid, | 179 base::Bind(it2me_host_->GetValidationCallbackForTesting(), remote_jid, |
170 base::Bind(&It2MeHostTest::OnValidationComplete, | 180 base::Bind(&It2MeHostTest::OnValidationComplete, |
171 base::Unretained(this), run_loop.QuitClosure()))); | 181 base::Unretained(this), run_loop.QuitClosure()))); |
172 | 182 |
173 run_loop.Run(); | 183 run_loop.Run(); |
174 | 184 |
175 it2me_host_->Disconnect(); | 185 it2me_host_->Disconnect(); |
176 } | 186 } |
177 | 187 |
178 TEST_F(It2MeHostTest, ConnectionValidation_NoClientDomainPolicy_ValidJid) { | 188 TEST_F(It2MeHostTest, ConnectionValidation_NoClientDomainPolicy_ValidJid) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 } | 249 } |
240 | 250 |
241 TEST_F(It2MeHostTest, ConnectionValidation_ConfirmationDialog_Reject) { | 251 TEST_F(It2MeHostTest, ConnectionValidation_ConfirmationDialog_Reject) { |
242 dialog_->set_dialog_result(DialogResult::CANCEL); | 252 dialog_->set_dialog_result(DialogResult::CANCEL); |
243 RunValidationCallback(kTestClientJid); | 253 RunValidationCallback(kTestClientJid); |
244 ASSERT_EQ(ValidationResult::ERROR_REJECTED_BY_USER, validation_result_); | 254 ASSERT_EQ(ValidationResult::ERROR_REJECTED_BY_USER, validation_result_); |
245 ASSERT_STREQ(kTestClientUserName, remote_user_email_.c_str()); | 255 ASSERT_STREQ(kTestClientUserName, remote_user_email_.c_str()); |
246 } | 256 } |
247 | 257 |
248 } // namespace remoting | 258 } // namespace remoting |
OLD | NEW |