summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_test_util.cc
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-29 18:41:40 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-29 18:41:40 +0000
commitc638a85ae6661dde9397c17fb17c2d48eb2fe147 (patch)
tree11157aa6f25057a265cf2c3c91f7d724fbd782f3 /net/spdy/spdy_test_util.cc
parent524ff896f45f1a36409d32ac024a6db343d3c685 (diff)
downloadchromium_src-c638a85ae6661dde9397c17fb17c2d48eb2fe147.zip
chromium_src-c638a85ae6661dde9397c17fb17c2d48eb2fe147.tar.gz
chromium_src-c638a85ae6661dde9397c17fb17c2d48eb2fe147.tar.bz2
I've refactored HttpStream, SpdyHttpStream and HttpBasicStream so that
SpdyHttpStream now implements (a slightly wider) HttpStream interface. BUG=50268 TEST=none Review URL: http://codereview.chromium.org/3079002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54154 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_test_util.cc')
-rw-r--r--net/spdy/spdy_test_util.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/net/spdy/spdy_test_util.cc b/net/spdy/spdy_test_util.cc
index 99af4f8..291f2cd 100644
--- a/net/spdy/spdy_test_util.cc
+++ b/net/spdy/spdy_test_util.cc
@@ -248,6 +248,43 @@ int ConstructSpdyHeader(const char* const extra_headers[],
return n;
}
+// Constructs a standard SPDY GET SYN packet, optionally compressed
+// for the url |url|.
+// |extra_headers| are the extra header-value pairs, which typically
+// will vary the most between calls.
+// Returns a SpdyFrame.
+spdy::SpdyFrame* ConstructSpdyGet(const char* const url,
+ bool compressed,
+ int stream_id,
+ RequestPriority request_priority) {
+ const SpdyHeaderInfo kSynStartHeader = {
+ spdy::SYN_STREAM, // Kind = Syn
+ stream_id, // Stream ID
+ 0, // Associated stream ID
+ request_priority, // Priority
+ spdy::CONTROL_FLAG_FIN, // Control Flags
+ compressed, // Compressed
+ spdy::INVALID, // Status
+ NULL, // Data
+ 0, // Length
+ spdy::DATA_FLAG_NONE // Data Flags
+ };
+ const char* const headers[] = {
+ "method",
+ "GET",
+ "url",
+ url,
+ "version",
+ "HTTP/1.1"
+ };
+ return ConstructSpdyPacket(
+ kSynStartHeader,
+ NULL,
+ 0,
+ headers,
+ arraysize(headers) / 2);
+}
+
// Constructs a standard SPDY GET SYN packet, optionally compressed.
// |extra_headers| are the extra header-value pairs, which typically
// will vary the most between calls.