OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/protocol/jingle_session.h" | 5 #include "remoting/protocol/jingle_session.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 } else { | 189 } else { |
190 EXPECT_CALL(host_session_event_handler_, | 190 EXPECT_CALL(host_session_event_handler_, |
191 OnSessionStateChange(Session::AUTHENTICATED)) | 191 OnSessionStateChange(Session::AUTHENTICATED)) |
192 .Times(1); | 192 .Times(1); |
193 // Expect that the connection will be closed eventually. | 193 // Expect that the connection will be closed eventually. |
194 EXPECT_CALL(host_session_event_handler_, | 194 EXPECT_CALL(host_session_event_handler_, |
195 OnSessionStateChange(Session::CLOSED)) | 195 OnSessionStateChange(Session::CLOSED)) |
196 .Times(AtMost(1)); | 196 .Times(AtMost(1)); |
197 } | 197 } |
198 } | 198 } |
199 EXPECT_CALL(host_session_event_handler_, | |
200 OnSessionRouteChange(kChannelName, _)) | |
201 .Times(AtMost(1)); | |
Sergey Ulanov
2012/07/23 21:44:26
It might be flaky with AtMost(1). It should be AtL
simonmorris
2012/07/23 22:00:06
That makes the Connect* tests fail. I've removed t
| |
199 | 202 |
200 { | 203 { |
201 InSequence dummy; | 204 InSequence dummy; |
202 | 205 |
203 EXPECT_CALL(client_session_event_handler_, | 206 EXPECT_CALL(client_session_event_handler_, |
204 OnSessionStateChange(Session::CONNECTED)) | 207 OnSessionStateChange(Session::CONNECTED)) |
205 .Times(AtMost(1)); | 208 .Times(AtMost(1)); |
206 if (expect_fail) { | 209 if (expect_fail) { |
207 EXPECT_CALL(client_session_event_handler_, | 210 EXPECT_CALL(client_session_event_handler_, |
208 OnSessionStateChange(Session::FAILED)) | 211 OnSessionStateChange(Session::FAILED)) |
209 .Times(1); | 212 .Times(1); |
210 } else { | 213 } else { |
211 EXPECT_CALL(client_session_event_handler_, | 214 EXPECT_CALL(client_session_event_handler_, |
212 OnSessionStateChange(Session::AUTHENTICATED)) | 215 OnSessionStateChange(Session::AUTHENTICATED)) |
213 .Times(1); | 216 .Times(1); |
214 // Expect that the connection will be closed eventually. | 217 // Expect that the connection will be closed eventually. |
215 EXPECT_CALL(client_session_event_handler_, | 218 EXPECT_CALL(client_session_event_handler_, |
216 OnSessionStateChange(Session::CLOSED)) | 219 OnSessionStateChange(Session::CLOSED)) |
217 .Times(AtMost(1)); | 220 .Times(AtMost(1)); |
218 } | 221 } |
219 } | 222 } |
223 EXPECT_CALL(client_session_event_handler_, | |
224 OnSessionRouteChange(kChannelName, _)) | |
225 .Times(AtMost(1)); | |
220 | 226 |
221 scoped_ptr<Authenticator> authenticator(new FakeAuthenticator( | 227 scoped_ptr<Authenticator> authenticator(new FakeAuthenticator( |
222 FakeAuthenticator::CLIENT, auth_round_trips, auth_action, true)); | 228 FakeAuthenticator::CLIENT, auth_round_trips, auth_action, true)); |
223 | 229 |
224 client_session_ = client_server_->Connect( | 230 client_session_ = client_server_->Connect( |
225 kHostJid, authenticator.Pass(), | 231 kHostJid, authenticator.Pass(), |
226 CandidateSessionConfig::CreateDefault()); | 232 CandidateSessionConfig::CreateDefault()); |
227 client_session_->SetEventHandler(&client_session_event_handler_); | 233 client_session_->SetEventHandler(&client_session_event_handler_); |
228 | 234 |
229 message_loop_->RunAllPending(); | 235 message_loop_->RunAllPending(); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 EXPECT_CALL(client_channel_callback_, OnDone(_)) | 388 EXPECT_CALL(client_channel_callback_, OnDone(_)) |
383 .Times(AtMost(1)); | 389 .Times(AtMost(1)); |
384 | 390 |
385 message_loop_->Run(); | 391 message_loop_->Run(); |
386 | 392 |
387 EXPECT_TRUE(!host_socket_.get()); | 393 EXPECT_TRUE(!host_socket_.get()); |
388 } | 394 } |
389 | 395 |
390 } // namespace protocol | 396 } // namespace protocol |
391 } // namespace remoting | 397 } // namespace remoting |
OLD | NEW |