| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/spdy/core/hpack/hpack_huffman_table.h" | 5 #include "net/spdy/core/hpack/hpack_huffman_table.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <bitset> | 9 #include <bitset> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 // First decode with HpackHuffmanTable. | 340 // First decode with HpackHuffmanTable. |
| 341 { | 341 { |
| 342 HpackInputStream input_stream(encoded); | 342 HpackInputStream input_stream(encoded); |
| 343 EXPECT_TRUE(table_.GenericDecodeString(&input_stream, out)); | 343 EXPECT_TRUE(table_.GenericDecodeString(&input_stream, out)); |
| 344 } | 344 } |
| 345 // And decode again with the fixed decoder, confirming that the result is | 345 // And decode again with the fixed decoder, confirming that the result is |
| 346 // the same. | 346 // the same. |
| 347 { | 347 { |
| 348 HpackInputStream input_stream(encoded); | 348 HpackInputStream input_stream(encoded); |
| 349 SpdyString buf; | 349 SpdyString buf; |
| 350 EXPECT_TRUE(HpackHuffmanDecoder::DecodeString(&input_stream, &buf)); | 350 EXPECT_TRUE(SpdyHpackHuffmanDecoder::DecodeString(&input_stream, &buf)); |
| 351 EXPECT_EQ(*out, buf); | 351 EXPECT_EQ(*out, buf); |
| 352 } | 352 } |
| 353 } | 353 } |
| 354 }; | 354 }; |
| 355 | 355 |
| 356 TEST_F(HpackHuffmanTableTest, InitializeHpackCode) { | 356 TEST_F(HpackHuffmanTableTest, InitializeHpackCode) { |
| 357 EXPECT_EQ(peer_.pad_bits(), '\xFF'); // First 8 bits of EOS. | 357 EXPECT_EQ(peer_.pad_bits(), '\xFF'); // First 8 bits of EOS. |
| 358 } | 358 } |
| 359 | 359 |
| 360 TEST_F(HpackHuffmanTableTest, SpecRequestExamples) { | 360 TEST_F(HpackHuffmanTableTest, SpecRequestExamples) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 output_stream.TakeString(&encoding); | 457 output_stream.TakeString(&encoding); |
| 458 EXPECT_EQ(encoding.size(), table_.EncodedSize(test_table[i])); | 458 EXPECT_EQ(encoding.size(), table_.EncodedSize(test_table[i])); |
| 459 } | 459 } |
| 460 } | 460 } |
| 461 | 461 |
| 462 } // namespace | 462 } // namespace |
| 463 | 463 |
| 464 } // namespace test | 464 } // namespace test |
| 465 | 465 |
| 466 } // namespace net | 466 } // namespace net |
| OLD | NEW |