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

Unified Diff: net/tools/quic/quic_spdy_server_stream_test.cc

Issue 1036643003: Change the QuicInMemoryCache to store a SpdyHeaderBlock instead of BalsaHeaders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
Index: net/tools/quic/quic_spdy_server_stream_test.cc
diff --git a/net/tools/quic/quic_spdy_server_stream_test.cc b/net/tools/quic/quic_spdy_server_stream_test.cc
index 0691f113360cebf24d6e529364c24e746907718a..5e57820a13018d4b199f44e29827889d361f4dc5 100644
--- a/net/tools/quic/quic_spdy_server_stream_test.cc
+++ b/net/tools/quic/quic_spdy_server_stream_test.cc
@@ -98,31 +98,13 @@ class QuicSpdyServerStreamTest : public ::testing::TestWithParam<QuicVersion> {
}
void SetUp() override {
- QuicInMemoryCache* cache = QuicInMemoryCache::GetInstance();
-
- BalsaHeaders response_headers;
- StringPiece body("Yum");
- response_headers.SetRequestFirstlineFromStringPieces("HTTP/1.1",
- "200",
- "OK");
- response_headers.AppendHeader("content-length",
- base::IntToString(body.length()));
-
+ QuicInMemoryCachePeer::ResetForTests();
string host = "";
string path = "/foo";
- // Check if response already exists and matches.
- const QuicInMemoryCache::Response* cached_response =
- cache->GetResponse(host, path);
- if (cached_response != nullptr) {
- string cached_response_headers_str, response_headers_str;
- cached_response->headers().DumpToString(&cached_response_headers_str);
- response_headers.DumpToString(&response_headers_str);
- CHECK_EQ(cached_response_headers_str, response_headers_str);
- CHECK_EQ(cached_response->body(), body);
- return;
- }
-
- cache->AddResponse(host, path, response_headers, body);
+ SpdyHeaderBlock response_headers;
+ StringPiece body("Yum");
+ QuicInMemoryCache::GetInstance()->AddResponse(host, path, response_headers,
+ body);
}
const string& StreamBody() {
« net/tools/quic/quic_spdy_server_stream.h ('K') | « net/tools/quic/quic_spdy_server_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698