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 #ifndef REMOTING_PROTOCOL_AUTHENTICATOR_TEST_BASE_H_ | 5 #ifndef REMOTING_PROTOCOL_AUTHENTICATOR_TEST_BASE_H_ |
6 #define REMOTING_PROTOCOL_AUTHENTICATOR_TEST_BASE_H_ | 6 #define REMOTING_PROTOCOL_AUTHENTICATOR_TEST_BASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 protected: | 32 protected: |
33 class MockChannelDoneCallback { | 33 class MockChannelDoneCallback { |
34 public: | 34 public: |
35 MockChannelDoneCallback(); | 35 MockChannelDoneCallback(); |
36 ~MockChannelDoneCallback(); | 36 ~MockChannelDoneCallback(); |
37 MOCK_METHOD1(OnDone, void(net::Error error)); | 37 MOCK_METHOD1(OnDone, void(net::Error error)); |
38 }; | 38 }; |
39 | 39 |
40 virtual void SetUp() OVERRIDE; | 40 virtual void SetUp() OVERRIDE; |
| 41 // Starts the auth exchange, the first message is from client to host. |
41 void RunAuthExchange(); | 42 void RunAuthExchange(); |
| 43 // Continues an interrupted authentication exchange (starting with a message |
| 44 // from host to client if skip_client_to_host is true). |
| 45 void ContinueAuthExchange(bool skip_client_to_host); |
42 void RunChannelAuth(bool expected_fail); | 46 void RunChannelAuth(bool expected_fail); |
43 | 47 |
44 void OnHostConnected(net::Error error, | 48 void OnHostConnected(net::Error error, |
45 scoped_ptr<net::StreamSocket> socket); | 49 scoped_ptr<net::StreamSocket> socket); |
46 void OnClientConnected(net::Error error, | 50 void OnClientConnected(net::Error error, |
47 scoped_ptr<net::StreamSocket> socket); | 51 scoped_ptr<net::StreamSocket> socket); |
48 | 52 |
49 MessageLoop message_loop_; | 53 MessageLoop message_loop_; |
50 | 54 |
51 scoped_ptr<KeyPair> key_pair_; | 55 scoped_ptr<KeyPair> key_pair_; |
| 56 std::string host_public_key_; |
52 std::string host_cert_; | 57 std::string host_cert_; |
53 scoped_ptr<Authenticator> host_; | 58 scoped_ptr<Authenticator> host_; |
54 scoped_ptr<Authenticator> client_; | 59 scoped_ptr<Authenticator> client_; |
55 scoped_ptr<FakeSocket> client_fake_socket_; | 60 scoped_ptr<FakeSocket> client_fake_socket_; |
56 scoped_ptr<FakeSocket> host_fake_socket_; | 61 scoped_ptr<FakeSocket> host_fake_socket_; |
57 scoped_ptr<ChannelAuthenticator> client_auth_; | 62 scoped_ptr<ChannelAuthenticator> client_auth_; |
58 scoped_ptr<ChannelAuthenticator> host_auth_; | 63 scoped_ptr<ChannelAuthenticator> host_auth_; |
59 MockChannelDoneCallback client_callback_; | 64 MockChannelDoneCallback client_callback_; |
60 MockChannelDoneCallback host_callback_; | 65 MockChannelDoneCallback host_callback_; |
61 scoped_ptr<net::StreamSocket> client_socket_; | 66 scoped_ptr<net::StreamSocket> client_socket_; |
62 scoped_ptr<net::StreamSocket> host_socket_; | 67 scoped_ptr<net::StreamSocket> host_socket_; |
63 | 68 |
| 69 private: |
64 DISALLOW_COPY_AND_ASSIGN(AuthenticatorTestBase); | 70 DISALLOW_COPY_AND_ASSIGN(AuthenticatorTestBase); |
65 }; | 71 }; |
66 | 72 |
67 } // namespace protocol | 73 } // namespace protocol |
68 } // namespace remoting | 74 } // namespace remoting |
69 | 75 |
70 #endif // REMOTING_PROTOCOL_AUTHENTICATOR_TEST_BASE_H_ | 76 #endif // REMOTING_PROTOCOL_AUTHENTICATOR_TEST_BASE_H_ |
OLD | NEW |