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

Unified Diff: net/spdy/hpack_round_trip_test.cc

Issue 533073004: HPACK: Split header fields in encoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/spdy/hpack_encoder_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/hpack_round_trip_test.cc
diff --git a/net/spdy/hpack_round_trip_test.cc b/net/spdy/hpack_round_trip_test.cc
index b374605758c4335b0c2b551755051a2ab2df47ea..f5667b546c7f1efba4b8b6f7950633616afa1bbc 100644
--- a/net/spdy/hpack_round_trip_test.cc
+++ b/net/spdy/hpack_round_trip_test.cc
@@ -81,6 +81,7 @@ TEST_F(HpackRoundTripTest, ResponseFixtures) {
headers["location"] = "https://www.example.com";
headers["set-cookie"] = "foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU;"
" max-age=3600; version=1";
+ headers["multivalue"] = string("foo\0bar", 7);
EXPECT_TRUE(RoundTrip(headers));
}
}
@@ -113,6 +114,7 @@ TEST_F(HpackRoundTripTest, RequestFixtures) {
headers[":scheme"] = "https";
headers["custom-key"] = "custom-value";
headers["cookie"] = "baz=bing; fizzle=fazzle; garbage";
+ headers["multivalue"] = string("foo\0bar", 7);
EXPECT_TRUE(RoundTrip(headers));
}
}
@@ -157,8 +159,14 @@ TEST_F(HpackRoundTripTest, RandomizedExamples) {
name = names[name_index];
}
if (value_index >= values.size()) {
- values.push_back(base::RandBytesAsString(
- 1 + SampleExponential(15, 75)));
+ string newvalue =
+ base::RandBytesAsString(1 + SampleExponential(15, 75));
+ // Currently order is not preserved in the encoder. In particular,
+ // when a value is decomposed at \0 delimiters, its parts might get
+ // encoded out of order if some but not all of them already exist in
+ // the header table. For now, avoid \0 bytes in values.
+ std::replace(newvalue.begin(), newvalue.end(), '\x00', '\x01');
+ values.push_back(newvalue);
value = values.back();
} else {
value = values[value_index];
« no previous file with comments | « net/spdy/hpack_encoder_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698