| 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 <cmath> | 5 #include <cmath> |
| 6 #include <ctime> | 6 #include <ctime> |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 using std::vector; | 21 using std::vector; |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 class HpackRoundTripTest : public ::testing::Test { | 25 class HpackRoundTripTest : public ::testing::Test { |
| 26 protected: | 26 protected: |
| 27 HpackRoundTripTest() | 27 HpackRoundTripTest() |
| 28 : encoder_(ObtainHpackHuffmanTable()), | 28 : encoder_(ObtainHpackHuffmanTable()), |
| 29 decoder_(ObtainHpackHuffmanTable()) {} | 29 decoder_(ObtainHpackHuffmanTable()) {} |
| 30 | 30 |
| 31 virtual void SetUp() { | 31 void SetUp() override { |
| 32 // Use a small table size to tickle eviction handling. | 32 // Use a small table size to tickle eviction handling. |
| 33 encoder_.ApplyHeaderTableSizeSetting(256); | 33 encoder_.ApplyHeaderTableSizeSetting(256); |
| 34 decoder_.ApplyHeaderTableSizeSetting(256); | 34 decoder_.ApplyHeaderTableSizeSetting(256); |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool RoundTrip(const map<string, string>& header_set) { | 37 bool RoundTrip(const map<string, string>& header_set) { |
| 38 string encoded; | 38 string encoded; |
| 39 encoder_.EncodeHeaderSet(header_set, &encoded); | 39 encoder_.EncodeHeaderSet(header_set, &encoded); |
| 40 | 40 |
| 41 bool success = decoder_.HandleControlFrameHeadersData( | 41 bool success = decoder_.HandleControlFrameHeadersData( |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 headers[name] = value; | 174 headers[name] = value; |
| 175 } | 175 } |
| 176 EXPECT_TRUE(RoundTrip(headers)); | 176 EXPECT_TRUE(RoundTrip(headers)); |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace | 180 } // namespace |
| 181 | 181 |
| 182 } // namespace net | 182 } // namespace net |
| OLD | NEW |