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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 StaticSocketDataProvider data3(NULL, 0, NULL, 0); | 131 StaticSocketDataProvider data3(NULL, 0, NULL, 0); |
132 mock_socket_factory_.AddSocketDataProvider(&data3); | 132 mock_socket_factory_.AddSocketDataProvider(&data3); |
133 | 133 |
134 scoped_refptr<HttpNetworkSession> session( | 134 scoped_refptr<HttpNetworkSession> session( |
135 new HttpNetworkSession(session_params_)); | 135 new HttpNetworkSession(session_params_)); |
136 scoped_ptr<HttpNetworkTransaction> trans( | 136 scoped_ptr<HttpNetworkTransaction> trans( |
137 new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); | 137 new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); |
138 | 138 |
139 TestCompletionCallback callback; | 139 TestCompletionCallback callback; |
140 // This will consume |ssl_data1|, |ssl_data2| and |ssl_data3|. | 140 // This will consume |ssl_data1|, |ssl_data2| and |ssl_data3|. |
141 int rv = callback.GetResult( | 141 int rv = |
142 trans->Start(GetRequestInfo("https://www.paypal.com/"), | 142 callback.GetResult(trans->Start(GetRequestInfo("https://www.paypal.com/"), |
143 callback.callback(), BoundNetLog())); | 143 callback.callback(), |
| 144 BoundNetLog())); |
144 EXPECT_EQ(ERR_SSL_PROTOCOL_ERROR, rv); | 145 EXPECT_EQ(ERR_SSL_PROTOCOL_ERROR, rv); |
145 | 146 |
146 SocketDataProviderArray<SocketDataProvider>& mock_data = | 147 SocketDataProviderArray<SocketDataProvider>& mock_data = |
147 mock_socket_factory_.mock_data(); | 148 mock_socket_factory_.mock_data(); |
148 // Confirms that |ssl_data1|, |ssl_data2| and |ssl_data3| are consumed. | 149 // Confirms that |ssl_data1|, |ssl_data2| and |ssl_data3| are consumed. |
149 EXPECT_EQ(3u, mock_data.next_index()); | 150 EXPECT_EQ(3u, mock_data.next_index()); |
150 | 151 |
151 SSLConfig& ssl_config = GetServerSSLConfig(trans.get()); | 152 SSLConfig& ssl_config = GetServerSSLConfig(trans.get()); |
152 // |version_max| fallbacks to SSL 3.0. | 153 // |version_max| fallbacks to SSL 3.0. |
153 EXPECT_EQ(SSL_PROTOCOL_VERSION_SSL3, ssl_config.version_max); | 154 EXPECT_EQ(SSL_PROTOCOL_VERSION_SSL3, ssl_config.version_max); |
154 EXPECT_TRUE(ssl_config.version_fallback); | 155 EXPECT_TRUE(ssl_config.version_fallback); |
155 } | 156 } |
156 | 157 |
157 } // namespace net | 158 } // namespace net |
158 | |
OLD | NEW |