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

Unified Diff: net/spdy/hpack_encoder_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/hpack_encoder.cc ('k') | net/spdy/hpack_header_table.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/hpack_encoder_test.cc
diff --git a/net/spdy/hpack_encoder_test.cc b/net/spdy/hpack_encoder_test.cc
index 1667e0b4204c9f05243e8723db884865a52bdc07..fa3df4e0684b4569078bd172a3190b33888955f0 100644
--- a/net/spdy/hpack_encoder_test.cc
+++ b/net/spdy/hpack_encoder_test.cc
@@ -88,10 +88,10 @@ class HpackEncoderTest : public ::testing::Test {
HpackEncoderTest()
: encoder_(ObtainHpackHuffmanTable()),
- peer_(&encoder_) {}
+ peer_(&encoder_),
+ static_(peer_.table()->GetByIndex(1)) {}
virtual void SetUp() {
- static_ = peer_.table()->GetByIndex(1);
// Populate dynamic entries into the table fixture. For simplicity each
// entry has name.size() + value.size() == 10.
key_1_ = peer_.table()->TryAddEntry("key1", "value1");
@@ -110,7 +110,7 @@ class HpackEncoderTest : public ::testing::Test {
expected_.AppendPrefix(kIndexedOpcode);
expected_.AppendUint32(index);
}
- void ExpectIndexedLiteral(HpackEntry* key_entry, StringPiece value) {
+ void ExpectIndexedLiteral(const HpackEntry* key_entry, StringPiece value) {
expected_.AppendPrefix(kLiteralIncrementalIndexOpcode);
expected_.AppendUint32(IndexOf(key_entry));
expected_.AppendPrefix(kStringLiteralIdentityEncoded);
@@ -146,15 +146,18 @@ class HpackEncoderTest : public ::testing::Test {
size_t IndexOf(HpackEntry* entry) {
return peer_.table()->IndexOf(entry);
}
+ size_t IndexOf(const HpackEntry* entry) {
+ return peer_.table()->IndexOf(entry);
+ }
HpackEncoder encoder_;
test::HpackEncoderPeer peer_;
- HpackEntry* static_;
- HpackEntry* key_1_;
- HpackEntry* key_2_;
- HpackEntry* cookie_a_;
- HpackEntry* cookie_c_;
+ const HpackEntry* static_;
+ const HpackEntry* key_1_;
+ const HpackEntry* key_2_;
+ const HpackEntry* cookie_a_;
+ const HpackEntry* cookie_c_;
HpackOutputStream expected_;
};
« no previous file with comments | « net/spdy/hpack_encoder.cc ('k') | net/spdy/hpack_header_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698