Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: net/spdy/hpack_decoder_test.cc

Issue 549583003: Make HPACK static table static and immutable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/spdy/hpack_decoder.cc ('k') | net/spdy/hpack_encoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_decoder.h" 5 #include "net/spdy/hpack_decoder.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 return decoder_peer_.decoded_block(); 85 return decoder_peer_.decoded_block();
86 } 86 }
87 87
88 const std::map<string, string>& DecodeBlockExpectingSuccess(StringPiece str) { 88 const std::map<string, string>& DecodeBlockExpectingSuccess(StringPiece str) {
89 EXPECT_TRUE(DecodeHeaderBlock(str)); 89 EXPECT_TRUE(DecodeHeaderBlock(str));
90 return decoded_block(); 90 return decoded_block();
91 } 91 }
92 92
93 void expectEntry(size_t index, size_t size, const string& name, 93 void expectEntry(size_t index, size_t size, const string& name,
94 const string& value) { 94 const string& value) {
95 HpackEntry* entry = decoder_peer_.header_table()->GetByIndex(index); 95 const HpackEntry* entry = decoder_peer_.header_table()->GetByIndex(index);
96 EXPECT_EQ(name, entry->name()) << "index " << index; 96 EXPECT_EQ(name, entry->name()) << "index " << index;
97 EXPECT_EQ(value, entry->value()); 97 EXPECT_EQ(value, entry->value());
98 EXPECT_EQ(size, entry->Size()); 98 EXPECT_EQ(size, entry->Size());
99 EXPECT_EQ(index, decoder_peer_.header_table()->IndexOf(entry)); 99 EXPECT_EQ(index, decoder_peer_.header_table()->IndexOf(entry));
100 } 100 }
101 101
102 HpackDecoder decoder_; 102 HpackDecoder decoder_;
103 test::HpackDecoderPeer decoder_peer_; 103 test::HpackDecoderPeer decoder_peer_;
104 }; 104 };
105 105
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 expectEntry(62, 98, "set-cookie", "foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU;" 647 expectEntry(62, 98, "set-cookie", "foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU;"
648 " max-age=3600; version=1"); 648 " max-age=3600; version=1");
649 expectEntry(63, 52, "content-encoding", "gzip"); 649 expectEntry(63, 52, "content-encoding", "gzip");
650 expectEntry(64, 65, "date", "Mon, 21 Oct 2013 20:13:22 GMT"); 650 expectEntry(64, 65, "date", "Mon, 21 Oct 2013 20:13:22 GMT");
651 EXPECT_EQ(215u, decoder_peer_.header_table()->size()); 651 EXPECT_EQ(215u, decoder_peer_.header_table()->size());
652 } 652 }
653 653
654 } // namespace 654 } // namespace
655 655
656 } // namespace net 656 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/hpack_decoder.cc ('k') | net/spdy/hpack_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698