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

Unified Diff: net/http/http_stream_parser_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: placate clang Created 4 years, 6 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
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..a10da6800a06f1c631ec01f60d0af6ceec4796b4 100644
--- a/net/http/http_stream_parser_unittest.cc
+++ b/net/http/http_stream_parser_unittest.cc
@@ -1126,6 +1126,8 @@ 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,
@@ -1147,6 +1149,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,
+ get_runner.response_info()->connection_info);
}
// Test that bytes that represent "next" response are not counted
@@ -1173,6 +1177,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,
+ get_runner.response_info()->connection_info);
}
// Test that "received_bytes" calculation works fine when last read

Powered by Google App Engine
This is Rietveld 408576698