| 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_static_table.h" | 5 #include "net/spdy/hpack/hpack_static_table.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 HpackHeaderTable::EntryTable static_entries = table_.GetStaticEntries(); | 34 HpackHeaderTable::EntryTable static_entries = table_.GetStaticEntries(); |
| 35 EXPECT_EQ(static_table.size(), static_entries.size()); | 35 EXPECT_EQ(static_table.size(), static_entries.size()); |
| 36 | 36 |
| 37 HpackHeaderTable::UnorderedEntrySet static_index = table_.GetStaticIndex(); | 37 HpackHeaderTable::UnorderedEntrySet static_index = table_.GetStaticIndex(); |
| 38 EXPECT_EQ(static_table.size(), static_index.size()); | 38 EXPECT_EQ(static_table.size(), static_index.size()); |
| 39 | 39 |
| 40 HpackHeaderTable::NameToEntryMap static_name_index = | 40 HpackHeaderTable::NameToEntryMap static_name_index = |
| 41 table_.GetStaticNameIndex(); | 41 table_.GetStaticNameIndex(); |
| 42 std::set<base::StringPiece> names; | 42 std::set<base::StringPiece> names; |
| 43 for (auto entry : static_index) { | 43 for (auto* entry : static_index) { |
| 44 names.insert(entry->name()); | 44 names.insert(entry->name()); |
| 45 } | 45 } |
| 46 EXPECT_EQ(names.size(), static_name_index.size()); | 46 EXPECT_EQ(names.size(), static_name_index.size()); |
| 47 } | 47 } |
| 48 | 48 |
| 49 // Test that ObtainHpackStaticTable returns the same instance every time. | 49 // Test that ObtainHpackStaticTable returns the same instance every time. |
| 50 TEST_F(HpackStaticTableTest, IsSingleton) { | 50 TEST_F(HpackStaticTableTest, IsSingleton) { |
| 51 const HpackStaticTable* static_table_one = &ObtainHpackStaticTable(); | 51 const HpackStaticTable* static_table_one = &ObtainHpackStaticTable(); |
| 52 const HpackStaticTable* static_table_two = &ObtainHpackStaticTable(); | 52 const HpackStaticTable* static_table_two = &ObtainHpackStaticTable(); |
| 53 EXPECT_EQ(static_table_one, static_table_two); | 53 EXPECT_EQ(static_table_one, static_table_two); |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace | 56 } // namespace |
| 57 | 57 |
| 58 } // namespace test | 58 } // namespace test |
| 59 | 59 |
| 60 } // namespace net | 60 } // namespace net |
| OLD | NEW |