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/hpack_encoder.h" | 5 #include "net/spdy/hpack_encoder.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 class HpackEncoderTest : public ::testing::Test { | 95 class HpackEncoderTest : public ::testing::Test { |
96 protected: | 96 protected: |
97 typedef test::HpackEncoderPeer::Representations Representations; | 97 typedef test::HpackEncoderPeer::Representations Representations; |
98 | 98 |
99 HpackEncoderTest() | 99 HpackEncoderTest() |
100 : encoder_(ObtainHpackHuffmanTable()), | 100 : encoder_(ObtainHpackHuffmanTable()), |
101 peer_(&encoder_), | 101 peer_(&encoder_), |
102 static_(peer_.table()->GetByIndex(1)) {} | 102 static_(peer_.table()->GetByIndex(1)) {} |
103 | 103 |
104 virtual void SetUp() { | 104 void SetUp() override { |
105 // Populate dynamic entries into the table fixture. For simplicity each | 105 // Populate dynamic entries into the table fixture. For simplicity each |
106 // entry has name.size() + value.size() == 10. | 106 // entry has name.size() + value.size() == 10. |
107 key_1_ = peer_.table()->TryAddEntry("key1", "value1"); | 107 key_1_ = peer_.table()->TryAddEntry("key1", "value1"); |
108 key_2_ = peer_.table()->TryAddEntry("key2", "value2"); | 108 key_2_ = peer_.table()->TryAddEntry("key2", "value2"); |
109 cookie_a_ = peer_.table()->TryAddEntry("cookie", "a=bb"); | 109 cookie_a_ = peer_.table()->TryAddEntry("cookie", "a=bb"); |
110 cookie_c_ = peer_.table()->TryAddEntry("cookie", "c=dd"); | 110 cookie_c_ = peer_.table()->TryAddEntry("cookie", "c=dd"); |
111 | 111 |
112 // No further insertions may occur without evictions. | 112 // No further insertions may occur without evictions. |
113 peer_.table()->SetMaxSize(peer_.table()->size()); | 113 peer_.table()->SetMaxSize(peer_.table()->size()); |
114 | 114 |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 expected_.AppendUint32(62); | 461 expected_.AppendUint32(62); |
462 expected_.AppendPrefix(kStringLiteralIdentityEncoded); | 462 expected_.AppendPrefix(kStringLiteralIdentityEncoded); |
463 expected_.AppendUint32(3); | 463 expected_.AppendUint32(3); |
464 expected_.AppendBytes("bar"); | 464 expected_.AppendBytes("bar"); |
465 CompareWithExpectedEncoding(headers); | 465 CompareWithExpectedEncoding(headers); |
466 } | 466 } |
467 | 467 |
468 } // namespace | 468 } // namespace |
469 | 469 |
470 } // namespace net | 470 } // namespace net |
OLD | NEW |