src/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc
TEST_F(HpackWholeEntryBufferTest, NameHuffmanError) {
  const char data[] = "\xff\xff\xff";
  entry_buffer_.OnStartLiteralHeader(HpackEntryType::kUnindexedLiteralHeader,
                                     0);
  entry_buffer_.OnNameStart(true, 4);
  entry_buffer_.OnNameData(data, 3);

  EXPECT_CALL(listener_,
              OnHpackDecodeError(HpackDecodingError::kNameHuffmanError, _));

  entry_buffer_.OnNameData(data, 1);

  // After an error is reported, the listener is not called again.
  EXPECT_CALL(listener_, OnDynamicTableSizeUpdate(8096)).Times(0);
  entry_buffer_.OnDynamicTableSizeUpdate(8096);
}
// Verify that a Huffman encoded name with an explicit EOS generates an error
// for an explicit EOS.
Verify that a Huffman encoded name with an explicit EOS generates an error
for an explicit EOS.
Verify that a Huffman encoded name with an explicit EOS generates an error for an explicit EOS .
TEST_F(HpackWholeEntryBufferTest, NameHuffmanError) {
  const char data[] = "\xff\xff\xff";
  entry_buffer_.OnStartLiteralHeader(HpackEntryType::kUnindexedLiteralHeader,
                                     0);
  entry_buffer_.OnNameStart(true, 4);
  entry_buffer_.OnNameData(data, 3);
  EXPECT_CALL(listener_,
              OnHpackDecodeError(HpackDecodingError::kNameHuffmanError, _));
  entry_buffer_.OnNameData(data, 1);
  EXPECT_CALL(listener_, OnDynamicTableSizeUpdate(8096)).Times(0);
  entry_buffer_.OnDynamicTableSizeUpdate(8096);
}
TEST_F ( HpackWholeEntryBufferTest , NameHuffmanError ) { const char data [ ] = " \xff \xff \xff " ; entry_buffer_ . OnStartLiteralHeader ( HpackEntryType :: kUnindexedLiteralHeader , 0 ) ; entry_buffer_ . OnNameStart ( true , 4 ) ; entry_buffer_ . OnNameData ( data , 3 ) ; EXPECT_CALL ( listener_ , OnHpackDecodeError ( HpackDecodingError :: kNameHuffmanError , _ ) ) ; entry_buffer_ . OnNameData ( data , 1 ) ; EXPECT_CALL ( listener_ , OnDynamicTableSizeUpdate ( 8096 ) ) . Times ( 0 ) ; entry_buffer_ . OnDynamicTableSizeUpdate ( 8096 ) ; }
Verify that a Huffman encoded name with an explicit EOS generates an error
for an explicit EOS.
Verify that a Huffman encoded name with an explicit EOS generates an error for an explicit EOS .
// After an error is reported, the listener is not called again.