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

Unified Diff: net/quic/test_tools/quic_test_packet_maker.cc

Issue 1142523004: Custom hosts in QuicTestPacketMaker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add QuicTestPacketMaker::set_hostname() method. Created 5 years, 7 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/quic/test_tools/quic_test_packet_maker.cc
diff --git a/net/quic/test_tools/quic_test_packet_maker.cc b/net/quic/test_tools/quic_test_packet_maker.cc
index cd0ac58d5bdff89c2e821aba1f02298c1fad1692..2ac6b405d271b04aff8dfce0d3a9753b554db28c 100644
--- a/net/quic/test_tools/quic_test_packet_maker.cc
+++ b/net/quic/test_tools/quic_test_packet_maker.cc
@@ -18,10 +18,12 @@ namespace test {
QuicTestPacketMaker::QuicTestPacketMaker(QuicVersion version,
QuicConnectionId connection_id,
- MockClock* clock)
+ MockClock* clock,
+ const std::string& host)
: version_(version),
connection_id_(connection_id),
clock_(clock),
+ host_(host),
spdy_request_framer_(SPDY4),
spdy_response_framer_(SPDY4) {
}
@@ -29,6 +31,10 @@ QuicTestPacketMaker::QuicTestPacketMaker(QuicVersion version,
QuicTestPacketMaker::~QuicTestPacketMaker() {
}
+void QuicTestPacketMaker::set_hostname(const std::string& host) {
+ host_.assign(host);
+}
+
scoped_ptr<QuicEncryptedPacket> QuicTestPacketMaker::MakeRstPacket(
QuicPacketSequenceNumber num,
bool include_version,
@@ -226,9 +232,9 @@ SpdyHeaderBlock QuicTestPacketMaker::GetRequestHeaders(
SpdyHeaderBlock headers;
headers[":method"] = method;
if (version_ <= QUIC_VERSION_24) {
- headers[":host"] = "www.google.com";
+ headers[":host"] = host_;
} else {
- headers[":authority"] = "www.google.com";
+ headers[":authority"] = host_;
}
headers[":path"] = path;
headers[":scheme"] = scheme;
« net/quic/quic_network_transaction_unittest.cc ('K') | « net/quic/test_tools/quic_test_packet_maker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698