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

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

Issue 2026593002: Remove limit on individual hpack string literals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused include. 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/spdy/hpack/hpack_decoder.cc ('k') | net/spdy/hpack/hpack_huffman_decoder.h » ('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 9f4c5fb8554b32a3f92deb09462cf584aa72240a..92f3515a810d2a7dca6bc7c6b69afd3519eaf622 100644
--- a/net/spdy/hpack/hpack_decoder_test.cc
+++ b/net/spdy/hpack/hpack_decoder_test.cc
@@ -61,8 +61,6 @@ using test::a2b_hex;
using testing::ElementsAre;
using testing::Pair;
-const size_t kLiteralBound = 1024;
-
class HpackDecoderTest : public ::testing::TestWithParam<bool> {
protected:
HpackDecoderTest() : decoder_(), decoder_peer_(&decoder_) {}
@@ -198,7 +196,7 @@ TEST_P(HpackDecoderTest, HandleHeaderRepresentation) {
// Decoding an encoded name with a valid string literal should work.
TEST_P(HpackDecoderTest, DecodeNextNameLiteral) {
- HpackInputStream input_stream(kLiteralBound, StringPiece("\x00\x04name", 6));
+ HpackInputStream input_stream(StringPiece("\x00\x04name", 6));
StringPiece string_piece;
EXPECT_TRUE(decoder_peer_.DecodeNextName(&input_stream, &string_piece));
@@ -211,8 +209,7 @@ TEST_P(HpackDecoderTest, DecodeNextNameLiteral) {
// Decoding an encoded name with an incomplete string literal.
TEST_P(HpackDecoderTest, DecodeNextNameLiteralWithIncompleteHeader) {
- HpackInputStream input_stream(kLiteralBound,
- StringPiece("\x00\x04name\x00\x02g", 9));
+ HpackInputStream input_stream(StringPiece("\x00\x04name\x00\x02g", 9));
StringPiece string_piece;
EXPECT_TRUE(decoder_peer_.DecodeNextName(&input_stream, &string_piece));
@@ -228,7 +225,7 @@ TEST_P(HpackDecoderTest, DecodeNextNameLiteralWithIncompleteHeader) {
TEST_P(HpackDecoderTest, DecodeNextNameLiteralWithHuffmanEncoding) {
string input = a2b_hex("008825a849e95ba97d7f");
- HpackInputStream input_stream(kLiteralBound, input);
+ HpackInputStream input_stream(input);
StringPiece string_piece;
EXPECT_TRUE(decoder_peer_.DecodeNextName(&input_stream, &string_piece));
@@ -246,7 +243,7 @@ TEST_P(HpackDecoderTest, DecodeNextNameLiteralWithIncompleteHuffmanEncoding) {
// Put two copies of the same huffman encoding into input.
string input = a2b_hex("008825a849e95ba97d7f008825a849e95ba97d7f");
input.resize(input.size() - 1); // Remove the last byte.
- HpackInputStream input_stream(kLiteralBound, input);
+ HpackInputStream input_stream(input);
StringPiece string_piece;
EXPECT_TRUE(decoder_peer_.DecodeNextName(&input_stream, &string_piece));
@@ -262,7 +259,7 @@ TEST_P(HpackDecoderTest, DecodeNextNameLiteralWithIncompleteHuffmanEncoding) {
// Decoding an encoded name with a valid index should work.
TEST_P(HpackDecoderTest, DecodeNextNameIndexed) {
- HpackInputStream input_stream(kLiteralBound, "\x01");
+ HpackInputStream input_stream("\x01");
StringPiece string_piece;
EXPECT_TRUE(decoder_peer_.DecodeNextName(&input_stream, &string_piece));
@@ -276,7 +273,7 @@ TEST_P(HpackDecoderTest, DecodeNextNameIndexed) {
// Decoding an encoded name with an invalid index should fail.
TEST_P(HpackDecoderTest, DecodeNextNameInvalidIndex) {
// One more than the number of static table entries.
- HpackInputStream input_stream(kLiteralBound, "\x3e");
+ HpackInputStream input_stream("\x3e");
StringPiece string_piece;
EXPECT_FALSE(decoder_peer_.DecodeNextName(&input_stream, &string_piece));
@@ -524,7 +521,7 @@ TEST_P(HpackDecoderTest, LiteralHeaderNeverIndexedInvalidNameIndex) {
// Decode with incomplete string literal.
TEST_P(HpackDecoderTest, StringLiteralIncomplete) {
const char input[] = "\x0c/sample/path\x06:path2\x0e/sample/path/";
- HpackInputStream input_stream(kLiteralBound, input);
+ HpackInputStream input_stream(input);
StringPiece str;
EXPECT_TRUE(
decoder_peer_.DecodeNextStringLiteral(&input_stream, false, &str));
« no previous file with comments | « net/spdy/hpack/hpack_decoder.cc ('k') | net/spdy/hpack/hpack_huffman_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698