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 <cmath> | 5 #include <cmath> |
6 #include <memory> | 6 #include <memory> |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // Verify responses. | 210 // Verify responses. |
211 const HttpResponseInfo* response = trans_->GetResponseInfo(); | 211 const HttpResponseInfo* response = trans_->GetResponseInfo(); |
212 ASSERT_TRUE(response); | 212 ASSERT_TRUE(response); |
213 ASSERT_TRUE(response->headers); | 213 ASSERT_TRUE(response->headers); |
214 if (HttpStreamFactory::spdy_enabled()) { | 214 if (HttpStreamFactory::spdy_enabled()) { |
215 EXPECT_EQ( | 215 EXPECT_EQ( |
216 HttpResponseInfo::ConnectionInfoFromNextProto( | 216 HttpResponseInfo::ConnectionInfoFromNextProto( |
217 test_params_.protocol), | 217 test_params_.protocol), |
218 response->connection_info); | 218 response->connection_info); |
219 } else { | 219 } else { |
220 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1, | 220 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1_1, |
221 response->connection_info); | 221 response->connection_info); |
222 } | 222 } |
223 if (spdy_enabled_) { | 223 if (spdy_enabled_) { |
224 EXPECT_EQ("HTTP/1.1 200", response->headers->GetStatusLine()); | 224 EXPECT_EQ("HTTP/1.1 200", response->headers->GetStatusLine()); |
225 EXPECT_TRUE(response->was_fetched_via_spdy); | 225 EXPECT_TRUE(response->was_fetched_via_spdy); |
226 EXPECT_TRUE(response->was_npn_negotiated); | 226 EXPECT_TRUE(response->was_npn_negotiated); |
227 } else { | 227 } else { |
228 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); | 228 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); |
229 EXPECT_FALSE(response->was_fetched_via_spdy); | 229 EXPECT_FALSE(response->was_fetched_via_spdy); |
230 // If SPDY is disabled, an HTTP request should not be diverted | 230 // If SPDY is disabled, an HTTP request should not be diverted |
(...skipping 4281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4512 helper.StartDefaultTest(); | 4512 helper.StartDefaultTest(); |
4513 helper.FinishDefaultTestWithoutVerification(); | 4513 helper.FinishDefaultTestWithoutVerification(); |
4514 helper.VerifyDataConsumed(); | 4514 helper.VerifyDataConsumed(); |
4515 EXPECT_TRUE(http_server_properties->RequiresHTTP11(host_port_pair_)); | 4515 EXPECT_TRUE(http_server_properties->RequiresHTTP11(host_port_pair_)); |
4516 | 4516 |
4517 const HttpResponseInfo* response = helper.trans()->GetResponseInfo(); | 4517 const HttpResponseInfo* response = helper.trans()->GetResponseInfo(); |
4518 ASSERT_TRUE(response); | 4518 ASSERT_TRUE(response); |
4519 ASSERT_TRUE(response->headers); | 4519 ASSERT_TRUE(response->headers); |
4520 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); | 4520 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); |
4521 EXPECT_FALSE(response->was_fetched_via_spdy); | 4521 EXPECT_FALSE(response->was_fetched_via_spdy); |
4522 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1, response->connection_info); | 4522 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1_1, |
| 4523 response->connection_info); |
4523 EXPECT_TRUE(response->was_npn_negotiated); | 4524 EXPECT_TRUE(response->was_npn_negotiated); |
4524 EXPECT_TRUE(request.url.SchemeIs("https")); | 4525 EXPECT_TRUE(request.url.SchemeIs("https")); |
4525 EXPECT_EQ("127.0.0.1", response->socket_address.host()); | 4526 EXPECT_EQ("127.0.0.1", response->socket_address.host()); |
4526 EXPECT_EQ(443, response->socket_address.port()); | 4527 EXPECT_EQ(443, response->socket_address.port()); |
4527 std::string response_data; | 4528 std::string response_data; |
4528 ASSERT_EQ(OK, ReadTransaction(helper.trans(), &response_data)); | 4529 ASSERT_EQ(OK, ReadTransaction(helper.trans(), &response_data)); |
4529 EXPECT_EQ("hello", response_data); | 4530 EXPECT_EQ("hello", response_data); |
4530 } | 4531 } |
4531 | 4532 |
4532 // Retry with HTTP/1.1 to the proxy when receiving HTTP_1_1_REQUIRED from the | 4533 // Retry with HTTP/1.1 to the proxy when receiving HTTP_1_1_REQUIRED from the |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4613 helper.StartDefaultTest(); | 4614 helper.StartDefaultTest(); |
4614 helper.FinishDefaultTestWithoutVerification(); | 4615 helper.FinishDefaultTestWithoutVerification(); |
4615 helper.VerifyDataConsumed(); | 4616 helper.VerifyDataConsumed(); |
4616 EXPECT_TRUE(http_server_properties->RequiresHTTP11(proxy_host_port_pair)); | 4617 EXPECT_TRUE(http_server_properties->RequiresHTTP11(proxy_host_port_pair)); |
4617 | 4618 |
4618 const HttpResponseInfo* response = helper.trans()->GetResponseInfo(); | 4619 const HttpResponseInfo* response = helper.trans()->GetResponseInfo(); |
4619 ASSERT_TRUE(response); | 4620 ASSERT_TRUE(response); |
4620 ASSERT_TRUE(response->headers); | 4621 ASSERT_TRUE(response->headers); |
4621 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); | 4622 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); |
4622 EXPECT_FALSE(response->was_fetched_via_spdy); | 4623 EXPECT_FALSE(response->was_fetched_via_spdy); |
4623 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1, response->connection_info); | 4624 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1_1, |
| 4625 response->connection_info); |
4624 EXPECT_FALSE(response->was_npn_negotiated); | 4626 EXPECT_FALSE(response->was_npn_negotiated); |
4625 EXPECT_TRUE(request.url.SchemeIs("https")); | 4627 EXPECT_TRUE(request.url.SchemeIs("https")); |
4626 EXPECT_EQ("127.0.0.1", response->socket_address.host()); | 4628 EXPECT_EQ("127.0.0.1", response->socket_address.host()); |
4627 EXPECT_EQ(70, response->socket_address.port()); | 4629 EXPECT_EQ(70, response->socket_address.port()); |
4628 std::string response_data; | 4630 std::string response_data; |
4629 ASSERT_EQ(OK, ReadTransaction(helper.trans(), &response_data)); | 4631 ASSERT_EQ(OK, ReadTransaction(helper.trans(), &response_data)); |
4630 EXPECT_EQ("hello", response_data); | 4632 EXPECT_EQ("hello", response_data); |
4631 } | 4633 } |
4632 | 4634 |
4633 // Test to make sure we can correctly connect through a proxy. | 4635 // Test to make sure we can correctly connect through a proxy. |
(...skipping 2515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7149 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 7151 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
7150 std::unique_ptr<SSLSocketDataProvider> ssl_provider( | 7152 std::unique_ptr<SSLSocketDataProvider> ssl_provider( |
7151 new SSLSocketDataProvider(ASYNC, OK)); | 7153 new SSLSocketDataProvider(ASYNC, OK)); |
7152 // Set to TLS_RSA_WITH_NULL_MD5 | 7154 // Set to TLS_RSA_WITH_NULL_MD5 |
7153 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 7155 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
7154 | 7156 |
7155 RunTLSUsageCheckTest(std::move(ssl_provider)); | 7157 RunTLSUsageCheckTest(std::move(ssl_provider)); |
7156 } | 7158 } |
7157 | 7159 |
7158 } // namespace net | 7160 } // namespace net |
OLD | NEW |