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

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

Issue 1357953002: Replace the existing SpdyHeaderBlock typedef with a class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add NET_EXPORT to fix compile error on win_chromium_compile_dbg_ng. Created 5 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/tools/quic/quic_spdy_client_stream.cc ('k') | net/tools/quic/spdy_balsa_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c49da6947afd82a69a6760a8db16c31f19784867..0a128e1804241f23a6bfbc06a7ef19abea6036e3 100644
--- a/net/tools/quic/quic_spdy_server_stream_test.cc
+++ b/net/tools/quic/quic_spdy_server_stream_test.cc
@@ -117,7 +117,7 @@ class QuicSpdyServerStreamTest : public ::testing::TestWithParam<QuicVersion> {
return QuicSpdyServerStreamPeer::body(stream_.get());
}
- const string& StreamHeadersValue(const string& key) {
+ StringPiece StreamHeadersValue(const string& key) {
return (*stream_->mutable_headers())[key];
}
@@ -227,9 +227,8 @@ TEST_P(QuicSpdyServerStreamTest, TestSendErrorResponse) {
TEST_P(QuicSpdyServerStreamTest, InvalidMultipleContentLength) {
SpdyHeaderBlock request_headers;
- request_headers["content-length"] = "11";
- request_headers["content-length"].push_back('\0');
- request_headers["content-length"].append("12");
+ // \000 is a way to write the null byte when followed by a literal digit.
+ request_headers["content-length"] = StringPiece("11\00012", 5);
headers_string_ =
SpdyUtils::SerializeUncompressedHeaders(request_headers, GetParam());
@@ -247,8 +246,8 @@ TEST_P(QuicSpdyServerStreamTest, InvalidMultipleContentLength) {
TEST_P(QuicSpdyServerStreamTest, InvalidLeadingNullContentLength) {
SpdyHeaderBlock request_headers;
- request_headers["content-length"] = '\0';
- request_headers["content-length"].append("12");
+ // \000 is a way to write the null byte when followed by a literal digit.
+ request_headers["content-length"] = StringPiece("\00012", 3);
headers_string_ =
SpdyUtils::SerializeUncompressedHeaders(request_headers, GetParam());
@@ -266,9 +265,8 @@ TEST_P(QuicSpdyServerStreamTest, InvalidLeadingNullContentLength) {
TEST_P(QuicSpdyServerStreamTest, ValidMultipleContentLength) {
SpdyHeaderBlock request_headers;
- request_headers["content-length"] = "11";
- request_headers["content-length"].push_back('\0');
- request_headers["content-length"].append("11");
+ // \000 is a way to write the null byte when followed by a literal digit.
+ request_headers["content-length"] = StringPiece("11\00011", 5);
headers_string_ =
SpdyUtils::SerializeUncompressedHeaders(request_headers, GetParam());
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream.cc ('k') | net/tools/quic/spdy_balsa_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698