| 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/pepper_session.h" | 5 #include "remoting/protocol/pepper_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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 base::MessageLoopProxy::current())); | 100 base::MessageLoopProxy::current())); |
| 101 host_server_->Init(host_signal_strategy_.get(), &host_server_listener_, | 101 host_server_->Init(host_signal_strategy_.get(), &host_server_listener_, |
| 102 NetworkSettings(false)); | 102 NetworkSettings(false)); |
| 103 | 103 |
| 104 scoped_ptr<AuthenticatorFactory> factory( | 104 scoped_ptr<AuthenticatorFactory> factory( |
| 105 new FakeHostAuthenticatorFactory(auth_round_trips, auth_action, true)); | 105 new FakeHostAuthenticatorFactory(auth_round_trips, auth_action, true)); |
| 106 host_server_->set_authenticator_factory(factory.Pass()); | 106 host_server_->set_authenticator_factory(factory.Pass()); |
| 107 | 107 |
| 108 EXPECT_CALL(client_server_listener_, OnSessionManagerReady()) | 108 EXPECT_CALL(client_server_listener_, OnSessionManagerReady()) |
| 109 .Times(1); | 109 .Times(1); |
| 110 client_server_.reset(new PepperSessionManager(NULL)); | 110 client_server_.reset(new PepperSessionManager( |
| 111 scoped_ptr<TransportFactory>(NULL))); |
| 111 client_server_->Init(client_signal_strategy_.get(), | 112 client_server_->Init(client_signal_strategy_.get(), |
| 112 &client_server_listener_, NetworkSettings()); | 113 &client_server_listener_, NetworkSettings()); |
| 113 } | 114 } |
| 114 | 115 |
| 115 void CloseSessionManager() { | 116 void CloseSessionManager() { |
| 116 if (host_server_.get()) { | 117 if (host_server_.get()) { |
| 117 host_server_->Close(); | 118 host_server_->Close(); |
| 118 host_server_.reset(); | 119 host_server_.reset(); |
| 119 } | 120 } |
| 120 if (client_server_.get()) { | 121 if (client_server_.get()) { |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } | 263 } |
| 263 | 264 |
| 264 // Verify that connection is terminated when multi-step auth fails. | 265 // Verify that connection is terminated when multi-step auth fails. |
| 265 TEST_F(PepperSessionTest, ConnectWithBadMultistepAuth) { | 266 TEST_F(PepperSessionTest, ConnectWithBadMultistepAuth) { |
| 266 CreateSessionManagers(3, FakeAuthenticator::REJECT); | 267 CreateSessionManagers(3, FakeAuthenticator::REJECT); |
| 267 InitiateConnection(3, FakeAuthenticator::ACCEPT, true); | 268 InitiateConnection(3, FakeAuthenticator::ACCEPT, true); |
| 268 } | 269 } |
| 269 | 270 |
| 270 } // namespace protocol | 271 } // namespace protocol |
| 271 } // namespace remoting | 272 } // namespace remoting |
| OLD | NEW |