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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 private: | 55 private: |
56 const HpackHuffmanTable& table_; | 56 const HpackHuffmanTable& table_; |
57 }; | 57 }; |
58 | 58 |
59 namespace { | 59 namespace { |
60 | 60 |
61 // Tests of the ability to decode some canonical Huffman code, | 61 // Tests of the ability to decode some canonical Huffman code, |
62 // not just the one defined in the RFC 7541. | 62 // not just the one defined in the RFC 7541. |
63 class GenericHuffmanTableTest : public ::testing::TestWithParam<bool> { | 63 class GenericHuffmanTableTest : public ::testing::Test { |
64 protected: | 64 protected: |
65 GenericHuffmanTableTest() : table_(), peer_(table_) {} | 65 GenericHuffmanTableTest() : table_(), peer_(table_) {} |
66 | 66 |
67 SpdyString EncodeString(SpdyStringPiece input) { | 67 SpdyString EncodeString(SpdyStringPiece input) { |
68 SpdyString result; | 68 SpdyString result; |
69 HpackOutputStream output_stream; | 69 HpackOutputStream output_stream; |
70 table_.EncodeString(input, &output_stream); | 70 table_.EncodeString(input, &output_stream); |
71 | 71 |
72 output_stream.TakeString(&result); | 72 output_stream.TakeString(&result); |
73 // Verify EncodedSize() agrees with EncodeString(). | 73 // Verify EncodedSize() agrees with EncodeString(). |
(...skipping 383 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 |