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

Unified Diff: net/http/http_stream_parser_unittest.cc

Issue 2140253002: Add metrics to track HTTP/0.9 usage for main frames and subresources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_stream_parser.cc ('k') | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_parser_unittest.cc
diff --git a/net/http/http_stream_parser_unittest.cc b/net/http/http_stream_parser_unittest.cc
index 00119b3c5147ef0c3f3d4b62e7c7a97c4984a6de..8a1fc9acf731571d803e1b6786a824ebd7f70277 100644
--- a/net/http/http_stream_parser_unittest.cc
+++ b/net/http/http_stream_parser_unittest.cc
@@ -1126,12 +1126,15 @@ TEST(HttpStreamParser, ReceivedBytesNoHeaders) {
int read_lengths[] = {response_size, 0};
get_runner.ReadBody(response_size, read_lengths);
EXPECT_EQ(response_size, get_runner.parser()->received_bytes());
+ EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP0_9,
+ get_runner.response_info()->connection_info);
}
// Test basic case where there is no keep-alive or extra data from the socket,
// and the entire response is received in a single read.
TEST(HttpStreamParser, ReceivedBytesNormal) {
- std::string headers = "HTTP/1.1 200 OK\r\n"
+ std::string headers =
+ "HTTP/1.0 200 OK\r\n"
"Content-Length: 7\r\n\r\n";
std::string body = "content";
std::string response = headers + body;
@@ -1147,6 +1150,8 @@ TEST(HttpStreamParser, ReceivedBytesNormal) {
get_runner.ReadBody(body_size, read_lengths);
int64_t response_size = response.size();
EXPECT_EQ(response_size, get_runner.parser()->received_bytes());
+ EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1_0,
+ get_runner.response_info()->connection_info);
}
// Test that bytes that represent "next" response are not counted
@@ -1173,6 +1178,8 @@ TEST(HttpStreamParser, ReceivedBytesExcludesNextResponse) {
EXPECT_EQ(response_size, get_runner.parser()->received_bytes());
int64_t next_response_size = next_response.size();
EXPECT_EQ(next_response_size, get_runner.read_buffer()->offset());
+ EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1_1,
+ get_runner.response_info()->connection_info);
}
// Test that "received_bytes" calculation works fine when last read
« no previous file with comments | « net/http/http_stream_parser.cc ('k') | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698