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

Unified Diff: net/quic/spdy_utils_test.cc

Issue 2107923002: m[52] relnote: Fix an error in QUIC's SpdyUtils where content-length was being parsed as an int in … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: 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 c4f094379747b668cf361d54b147db4fc4674745..a465260ad5696aa2edc2c0a2e24a2723be2e2cd4 100644
--- a/net/quic/spdy_utils_test.cc
+++ b/net/quic/spdy_utils_test.cc
@@ -185,6 +185,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