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

Unified Diff: net/quic/spdy_utils_test.cc

Issue 2081713006: gfe-relnote: Fix an error in QUIC's SpdyUtils where content-length was (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a bug in QUIC's SpdyUtils where >4GB content-lengths failed to parse. 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
« no previous file with comments | « net/quic/spdy_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/spdy_utils_test.cc
diff --git a/net/quic/spdy_utils_test.cc b/net/quic/spdy_utils_test.cc
index 55ec43c837b8a62da5175eeb0a1ec223d54d1cea..35093af511a86ba9fa41a8f2ecf49452bb65cff4 100644
--- a/net/quic/spdy_utils_test.cc
+++ b/net/quic/spdy_utils_test.cc
@@ -230,6 +230,22 @@ TEST(SpdyUtilsTest, CopyAndValidateHeadersInconsistentContentLengths) {
SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block));
}
+TEST(SpdyUtilsTest, CopyAndValidateHeadersLargeContentLength) {
+ auto headers = FromList({{"content-length", "9000000000"},
+ {"foo", "foovalue"},
+ {"bar", "barvalue"},
+ {"baz", ""}});
+ int64_t content_length = -1;
+ SpdyHeaderBlock block;
+ ASSERT_TRUE(
+ SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block));
+ EXPECT_THAT(block, UnorderedElementsAre(
+ Pair("foo", "foovalue"), Pair("bar", "barvalue"),
+ Pair("content-length", StringPiece("9000000000")),
+ Pair("baz", "")));
+ EXPECT_EQ(9000000000, content_length);
+}
+
TEST(SpdyUtilsTest, CopyAndValidateHeadersMultipleValues) {
auto headers = FromList({{"foo", "foovalue"},
{"bar", "barvalue"},
« no previous file with comments | « net/quic/spdy_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698