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

Unified Diff: net/spdy/hpack/hpack_decoder_test.cc

Issue 1357953002: Replace the existing SpdyHeaderBlock typedef with a class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add NET_EXPORT to fix compile error on win_chromium_compile_dbg_ng. Created 5 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/hpack_decoder.cc ('k') | net/spdy/hpack/hpack_encoder_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/hpack/hpack_decoder_test.cc
diff --git a/net/spdy/hpack/hpack_decoder_test.cc b/net/spdy/hpack/hpack_decoder_test.cc
index 37daac6b9fd59c21abefd069a5d5b1e8086e48ff..948aae244b532157529fe7410c9d2f988018e3f2 100644
--- a/net/spdy/hpack/hpack_decoder_test.cc
+++ b/net/spdy/hpack/hpack_decoder_test.cc
@@ -136,13 +136,14 @@ TEST_F(HpackDecoderTest, HandleHeaderRepresentation) {
// Finish and emit all headers.
decoder_.HandleControlFrameHeadersComplete(0, nullptr);
+ // Resulting decoded headers are in the same order as input.
EXPECT_THAT(decoded_block(),
ElementsAre(Pair("cookie", " part 1; part 2 ; part3; fin!"),
- Pair("empty", ""),
- Pair("empty-joined", string("\0foo\0\0", 6)),
- Pair("joineD", string("value 1\0value 2", 15)),
+ Pair("passed-through", StringPiece("foo\0baz", 7)),
Pair("joined", "not joined"),
- Pair("passed-through", string("foo\0baz", 7))));
+ Pair("joineD", StringPiece("value 1\0value 2", 15)),
+ Pair("empty", ""),
+ Pair("empty-joined", StringPiece("\0foo\0\0", 6))));
}
// Decoding an encoded name with a valid string literal should work.
@@ -387,8 +388,8 @@ TEST_F(HpackDecoderTest, SectionD4RequestHuffmanExamples) {
EXPECT_THAT(
header_set,
- ElementsAre(Pair(":authority", "www.example.com"), Pair(":method", "GET"),
- Pair(":path", "/"), Pair(":scheme", "http")));
+ ElementsAre(Pair(":method", "GET"), Pair(":scheme", "http"),
+ Pair(":path", "/"), Pair(":authority", "www.example.com")));
expectEntry(62, 57, ":authority", "www.example.com");
EXPECT_EQ(57u, decoder_peer_.header_table()->size());
@@ -420,8 +421,8 @@ TEST_F(HpackDecoderTest, SectionD4RequestHuffmanExamples) {
EXPECT_THAT(
header_set,
- ElementsAre(Pair(":authority", "www.example.com"), Pair(":method", "GET"),
- Pair(":path", "/"), Pair(":scheme", "http"),
+ ElementsAre(Pair(":method", "GET"), Pair(":scheme", "http"),
+ Pair(":path", "/"), Pair(":authority", "www.example.com"),
Pair("cache-control", "no-cache")));
expectEntry(62, 53, "cache-control", "no-cache");
@@ -457,11 +458,11 @@ TEST_F(HpackDecoderTest, SectionD4RequestHuffmanExamples) {
"25a849e95bb8e8b4bf");
header_set = DecodeBlockExpectingSuccess(third);
- EXPECT_THAT(
- header_set,
- ElementsAre(Pair(":authority", "www.example.com"), Pair(":method", "GET"),
- Pair(":path", "/index.html"), Pair(":scheme", "https"),
- Pair("custom-key", "custom-value")));
+ EXPECT_THAT(header_set,
+ ElementsAre(Pair(":method", "GET"), Pair(":scheme", "https"),
+ Pair(":path", "/index.html"),
+ Pair(":authority", "www.example.com"),
+ Pair("custom-key", "custom-value")));
expectEntry(62, 54, "custom-key", "custom-value");
expectEntry(63, 53, "cache-control", "no-cache");
@@ -634,9 +635,9 @@ TEST_F(HpackDecoderTest, SectionD6ResponseHuffmanExamples) {
EXPECT_THAT(
header_set,
ElementsAre(Pair(":status", "200"), Pair("cache-control", "private"),
- Pair("content-encoding", "gzip"),
Pair("date", "Mon, 21 Oct 2013 20:13:22 GMT"),
Pair("location", "https://www.example.com"),
+ Pair("content-encoding", "gzip"),
Pair("set-cookie",
"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU;"
" max-age=3600; version=1")));
« no previous file with comments | « net/spdy/hpack/hpack_decoder.cc ('k') | net/spdy/hpack/hpack_encoder_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698