Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: net/spdy/spdy_network_transaction_unittest.cc

Issue 2119623002: Add metrics to track HTTP/0.9 usage for main frames and subresources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // Verify responses. 244 // Verify responses.
245 const HttpResponseInfo* response = trans_->GetResponseInfo(); 245 const HttpResponseInfo* response = trans_->GetResponseInfo();
246 ASSERT_TRUE(response); 246 ASSERT_TRUE(response);
247 ASSERT_TRUE(response->headers); 247 ASSERT_TRUE(response->headers);
248 if (HttpStreamFactory::spdy_enabled()) { 248 if (HttpStreamFactory::spdy_enabled()) {
249 EXPECT_EQ( 249 EXPECT_EQ(
250 HttpResponseInfo::ConnectionInfoFromNextProto( 250 HttpResponseInfo::ConnectionInfoFromNextProto(
251 test_params_.protocol), 251 test_params_.protocol),
252 response->connection_info); 252 response->connection_info);
253 } else { 253 } else {
254 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1, 254 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1_1,
255 response->connection_info); 255 response->connection_info);
256 } 256 }
257 if (spdy_enabled_) { 257 if (spdy_enabled_) {
258 EXPECT_EQ("HTTP/1.1 200", response->headers->GetStatusLine()); 258 EXPECT_EQ("HTTP/1.1 200", response->headers->GetStatusLine());
259 EXPECT_TRUE(response->was_fetched_via_spdy); 259 EXPECT_TRUE(response->was_fetched_via_spdy);
260 EXPECT_TRUE(response->was_npn_negotiated); 260 EXPECT_TRUE(response->was_npn_negotiated);
261 } else { 261 } else {
262 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); 262 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine());
263 EXPECT_FALSE(response->was_fetched_via_spdy); 263 EXPECT_FALSE(response->was_fetched_via_spdy);
264 // If SPDY is disabled, an HTTP request should not be diverted 264 // If SPDY is disabled, an HTTP request should not be diverted
(...skipping 4331 matching lines...) Expand 10 before | Expand all | Expand 10 after
4596 helper.StartDefaultTest(); 4596 helper.StartDefaultTest();
4597 helper.FinishDefaultTestWithoutVerification(); 4597 helper.FinishDefaultTestWithoutVerification();
4598 helper.VerifyDataConsumed(); 4598 helper.VerifyDataConsumed();
4599 EXPECT_TRUE(http_server_properties->RequiresHTTP11(host_port_pair)); 4599 EXPECT_TRUE(http_server_properties->RequiresHTTP11(host_port_pair));
4600 4600
4601 const HttpResponseInfo* response = helper.trans()->GetResponseInfo(); 4601 const HttpResponseInfo* response = helper.trans()->GetResponseInfo();
4602 ASSERT_TRUE(response); 4602 ASSERT_TRUE(response);
4603 ASSERT_TRUE(response->headers); 4603 ASSERT_TRUE(response->headers);
4604 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); 4604 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine());
4605 EXPECT_FALSE(response->was_fetched_via_spdy); 4605 EXPECT_FALSE(response->was_fetched_via_spdy);
4606 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1, response->connection_info); 4606 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1_1,
4607 response->connection_info);
4607 EXPECT_TRUE(response->was_npn_negotiated); 4608 EXPECT_TRUE(response->was_npn_negotiated);
4608 EXPECT_TRUE(request.url.SchemeIs("https")); 4609 EXPECT_TRUE(request.url.SchemeIs("https"));
4609 EXPECT_EQ("127.0.0.1", response->socket_address.host()); 4610 EXPECT_EQ("127.0.0.1", response->socket_address.host());
4610 EXPECT_EQ(443, response->socket_address.port()); 4611 EXPECT_EQ(443, response->socket_address.port());
4611 std::string response_data; 4612 std::string response_data;
4612 ASSERT_EQ(OK, ReadTransaction(helper.trans(), &response_data)); 4613 ASSERT_EQ(OK, ReadTransaction(helper.trans(), &response_data));
4613 EXPECT_EQ("hello", response_data); 4614 EXPECT_EQ("hello", response_data);
4614 } 4615 }
4615 4616
4616 // Retry with HTTP/1.1 to the proxy when receiving HTTP_1_1_REQUIRED from the 4617 // Retry with HTTP/1.1 to the proxy when receiving HTTP_1_1_REQUIRED from the
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
4701 helper.StartDefaultTest(); 4702 helper.StartDefaultTest();
4702 helper.FinishDefaultTestWithoutVerification(); 4703 helper.FinishDefaultTestWithoutVerification();
4703 helper.VerifyDataConsumed(); 4704 helper.VerifyDataConsumed();
4704 EXPECT_TRUE(http_server_properties->RequiresHTTP11(proxy_host_port_pair)); 4705 EXPECT_TRUE(http_server_properties->RequiresHTTP11(proxy_host_port_pair));
4705 4706
4706 const HttpResponseInfo* response = helper.trans()->GetResponseInfo(); 4707 const HttpResponseInfo* response = helper.trans()->GetResponseInfo();
4707 ASSERT_TRUE(response); 4708 ASSERT_TRUE(response);
4708 ASSERT_TRUE(response->headers); 4709 ASSERT_TRUE(response->headers);
4709 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); 4710 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine());
4710 EXPECT_FALSE(response->was_fetched_via_spdy); 4711 EXPECT_FALSE(response->was_fetched_via_spdy);
4711 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1, response->connection_info); 4712 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1_1,
4713 response->connection_info);
4712 EXPECT_FALSE(response->was_npn_negotiated); 4714 EXPECT_FALSE(response->was_npn_negotiated);
4713 EXPECT_TRUE(request.url.SchemeIs("https")); 4715 EXPECT_TRUE(request.url.SchemeIs("https"));
4714 EXPECT_EQ("127.0.0.1", response->socket_address.host()); 4716 EXPECT_EQ("127.0.0.1", response->socket_address.host());
4715 EXPECT_EQ(70, response->socket_address.port()); 4717 EXPECT_EQ(70, response->socket_address.port());
4716 std::string response_data; 4718 std::string response_data;
4717 ASSERT_EQ(OK, ReadTransaction(helper.trans(), &response_data)); 4719 ASSERT_EQ(OK, ReadTransaction(helper.trans(), &response_data));
4718 EXPECT_EQ("hello", response_data); 4720 EXPECT_EQ("hello", response_data);
4719 } 4721 }
4720 4722
4721 // Test to make sure we can correctly connect through a proxy. 4723 // Test to make sure we can correctly connect through a proxy.
(...skipping 2538 matching lines...) Expand 10 before | Expand all | Expand 10 after
7260 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { 7262 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) {
7261 std::unique_ptr<SSLSocketDataProvider> ssl_provider( 7263 std::unique_ptr<SSLSocketDataProvider> ssl_provider(
7262 new SSLSocketDataProvider(ASYNC, OK)); 7264 new SSLSocketDataProvider(ASYNC, OK));
7263 // Set to TLS_RSA_WITH_NULL_MD5 7265 // Set to TLS_RSA_WITH_NULL_MD5
7264 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); 7266 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status);
7265 7267
7266 RunTLSUsageCheckTest(std::move(ssl_provider)); 7268 RunTLSUsageCheckTest(std::move(ssl_provider));
7267 } 7269 }
7268 7270
7269 } // namespace net 7271 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698