| 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/hpack_header_table.h" | 5 #include "net/spdy/hpack/hpack_header_table.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 protected: | 72 protected: |
| 73 typedef std::vector<HpackEntry> HpackEntryVector; | 73 typedef std::vector<HpackEntry> HpackEntryVector; |
| 74 | 74 |
| 75 HpackHeaderTableTest() : table_(), peer_(&table_) {} | 75 HpackHeaderTableTest() : table_(), peer_(&table_) {} |
| 76 | 76 |
| 77 // Returns an entry whose Size() is equal to the given one. | 77 // Returns an entry whose Size() is equal to the given one. |
| 78 static HpackEntry MakeEntryOfSize(uint32 size) { | 78 static HpackEntry MakeEntryOfSize(uint32 size) { |
| 79 EXPECT_GE(size, HpackEntry::kSizeOverhead); | 79 EXPECT_GE(size, HpackEntry::kSizeOverhead); |
| 80 string name((size - HpackEntry::kSizeOverhead) / 2, 'n'); | 80 string name((size - HpackEntry::kSizeOverhead) / 2, 'n'); |
| 81 string value(size - HpackEntry::kSizeOverhead - name.size(), 'v'); | 81 string value(size - HpackEntry::kSizeOverhead - name.size(), 'v'); |
| 82 HpackEntry entry(name, value); | 82 HpackEntry entry(name, value, false, 0); |
| 83 EXPECT_EQ(size, entry.Size()); | 83 EXPECT_EQ(size, entry.Size()); |
| 84 return entry; | 84 return entry; |
| 85 } | 85 } |
| 86 | 86 |
| 87 // Returns a vector of entries whose total size is equal to the given | 87 // Returns a vector of entries whose total size is equal to the given |
| 88 // one. | 88 // one. |
| 89 static HpackEntryVector MakeEntriesOfTotalSize(uint32 total_size) { | 89 static HpackEntryVector MakeEntriesOfTotalSize(uint32 total_size) { |
| 90 EXPECT_GE(total_size, HpackEntry::kSizeOverhead); | 90 EXPECT_GE(total_size, HpackEntry::kSizeOverhead); |
| 91 uint32 entry_size = HpackEntry::kSizeOverhead; | 91 uint32 entry_size = HpackEntry::kSizeOverhead; |
| 92 uint32 remaining_size = total_size; | 92 uint32 remaining_size = total_size; |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 HpackEntry entry2(DynamicEntry("name", "value")); | 435 HpackEntry entry2(DynamicEntry("name", "value")); |
| 436 | 436 |
| 437 HpackHeaderTable::EntryComparator comparator; | 437 HpackHeaderTable::EntryComparator comparator; |
| 438 EXPECT_FALSE(comparator(&entry1, &entry1)); | 438 EXPECT_FALSE(comparator(&entry1, &entry1)); |
| 439 EXPECT_FALSE(comparator(&entry2, &entry2)); | 439 EXPECT_FALSE(comparator(&entry2, &entry2)); |
| 440 } | 440 } |
| 441 | 441 |
| 442 } // namespace | 442 } // namespace |
| 443 | 443 |
| 444 } // namespace net | 444 } // namespace net |
| OLD | NEW |