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/ssl_hmac_channel_authenticator.h" | 5 #include "remoting/protocol/ssl_hmac_channel_authenticator.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 if (expected_host_error != net::OK) { | 104 if (expected_host_error != net::OK) { |
105 EXPECT_CALL(host_callback_, OnDone(expected_host_error, nullptr)) | 105 EXPECT_CALL(host_callback_, OnDone(expected_host_error, nullptr)) |
106 .WillOnce(QuitThreadOnCounter(&callback_counter)); | 106 .WillOnce(QuitThreadOnCounter(&callback_counter)); |
107 } else { | 107 } else { |
108 EXPECT_CALL(host_callback_, OnDone(net::OK, NotNull())) | 108 EXPECT_CALL(host_callback_, OnDone(net::OK, NotNull())) |
109 .WillOnce(QuitThreadOnCounter(&callback_counter)); | 109 .WillOnce(QuitThreadOnCounter(&callback_counter)); |
110 } | 110 } |
111 | 111 |
112 // Ensure that .Run() does not run unbounded if the callbacks are never | 112 // Ensure that .Run() does not run unbounded if the callbacks are never |
113 // called. | 113 // called. |
114 base::Timer shutdown_timer(false, false); | 114 base::OneShotTimer shutdown_timer; |
115 shutdown_timer.Start(FROM_HERE, TestTimeouts::action_timeout(), | 115 shutdown_timer.Start(FROM_HERE, TestTimeouts::action_timeout(), |
116 base::MessageLoop::QuitWhenIdleClosure()); | 116 base::MessageLoop::QuitWhenIdleClosure()); |
117 base::RunLoop().Run(); | 117 base::RunLoop().Run(); |
118 } | 118 } |
119 | 119 |
120 void OnHostConnected(const std::string& ref_argument, | 120 void OnHostConnected(const std::string& ref_argument, |
121 int error, | 121 int error, |
122 std::unique_ptr<P2PStreamSocket> socket) { | 122 std::unique_ptr<P2PStreamSocket> socket) { |
123 // Try deleting the authenticator and verify that this doesn't destroy | 123 // Try deleting the authenticator and verify that this doesn't destroy |
124 // reference parameters. | 124 // reference parameters. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 host_auth_ = SslHmacChannelAuthenticator::CreateForHost( | 197 host_auth_ = SslHmacChannelAuthenticator::CreateForHost( |
198 host_cert_, key_pair_, kTestSharedSecret); | 198 host_cert_, key_pair_, kTestSharedSecret); |
199 | 199 |
200 RunChannelAuth(net::ERR_CERT_INVALID, net::ERR_CONNECTION_CLOSED); | 200 RunChannelAuth(net::ERR_CERT_INVALID, net::ERR_CONNECTION_CLOSED); |
201 | 201 |
202 ASSERT_TRUE(host_socket_.get() == nullptr); | 202 ASSERT_TRUE(host_socket_.get() == nullptr); |
203 } | 203 } |
204 | 204 |
205 } // namespace protocol | 205 } // namespace protocol |
206 } // namespace remoting | 206 } // namespace remoting |
OLD | NEW |