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

Unified Diff: net/spdy/spdy_test_util.cc

Issue 2919011: Implement MAX_CONCURRENT_STREAMS SETTINGS header (Closed)
Patch Set: landing soon on a repo near you Created 10 years, 5 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/spdy_test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_test_util.cc
diff --git a/net/spdy/spdy_test_util.cc b/net/spdy/spdy_test_util.cc
index 697a3a6dd37cb36f5deef83ee7e1dfbfce330db5..89e3343eb5986922e1bd1e222fd891ad43fb9cf3 100644
--- a/net/spdy/spdy_test_util.cc
+++ b/net/spdy/spdy_test_util.cc
@@ -4,6 +4,8 @@
#include "net/spdy/spdy_test_util.h"
+#include <string>
+
#include "base/basictypes.h"
#include "base/string_util.h"
@@ -235,12 +237,15 @@ int ConstructSpdyHeader(const char* const extra_headers[],
// will vary the most between calls.
// Returns a SpdyFrame.
spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[],
- int extra_header_count, bool compressed) {
+ int extra_header_count,
+ bool compressed,
+ int stream_id,
+ RequestPriority request_priority) {
const SpdyHeaderInfo kSynStartHeader = {
spdy::SYN_STREAM, // Kind = Syn
- 1, // Stream ID
+ stream_id, // Stream ID
0, // Associated stream ID
- SPDY_PRIORITY_LOWEST, // Priority
+ request_priority, // Priority
spdy::CONTROL_FLAG_FIN, // Control Flags
compressed, // Compressed
spdy::INVALID, // Status
@@ -264,24 +269,16 @@ spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[],
arraysize(kStandardGetHeaders) / 2);
}
-// Constructs a standard SPDY GET SYN packet, not compressed.
-// |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 extra_headers[],
- int extra_header_count) {
- return ConstructSpdyGet(extra_headers, extra_header_count, false);
-}
-
// Constructs a standard SPDY SYN_REPLY packet to match the SPDY GET.
// |extra_headers| are the extra header-value pairs, which typically
// will vary the most between calls.
// Returns a SpdyFrame.
spdy::SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[],
- int extra_header_count) {
+ int extra_header_count,
+ int stream_id) {
const SpdyHeaderInfo kSynStartHeader = {
spdy::SYN_REPLY, // Kind = SynReply
- 1, // Stream ID
+ stream_id, // Stream ID
0, // Associated stream ID
SPDY_PRIORITY_LOWEST, // Priority
spdy::CONTROL_FLAG_NONE, // Control Flags
@@ -380,9 +377,11 @@ spdy::SpdyFrame* ConstructSpdyPostSynReply(const char* const extra_headers[],
}
// Constructs a single SPDY data frame with the contents "hello!"
-spdy::SpdyFrame* ConstructSpdyBodyFrame() {
+spdy::SpdyFrame* ConstructSpdyBodyFrame(int stream_id, bool fin) {
spdy::SpdyFramer framer;
- return framer.CreateDataFrame(1, "hello!", 6, spdy::DATA_FLAG_FIN);
+ return
+ framer.CreateDataFrame(stream_id, "hello!", 6,
+ fin ? spdy::DATA_FLAG_FIN : spdy::DATA_FLAG_NONE);
}
// Construct an expected SPDY reply string.
« no previous file with comments | « net/spdy/spdy_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698