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

Unified Diff: net/spdy/spdy_test_util_spdy3.h

Issue 12743006: [SPDY] Refactor tests in preparation for a fix for a session flow control bug (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 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
« no previous file with comments | « net/spdy/spdy_test_util_spdy2.cc ('k') | net/spdy/spdy_test_util_spdy3.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_test_util_spdy3.h
diff --git a/net/spdy/spdy_test_util_spdy3.h b/net/spdy/spdy_test_util_spdy3.h
index a59b5e9b4058fe8f590c9f335379138825e3b6de..dec5c0543c73b855858ad1aa90679c79fc708bb1 100644
--- a/net/spdy/spdy_test_util_spdy3.h
+++ b/net/spdy/spdy_test_util_spdy3.h
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "base/string_piece.h"
#include "crypto/ec_private_key.h"
#include "crypto/ec_signature_creator.h"
#include "net/base/cert_verifier.h"
@@ -115,9 +116,16 @@ MockRead* ChopReadFrame(const SpdyFrame& frame, int num_chunks);
// where the even entries are the header names, and the odd entries are the
// header values.
// |headers| gets filled in from |extra_headers|.
-void AppendHeadersToSpdyFrame(const char* const extra_headers[],
- int extra_header_count,
- SpdyHeaderBlock* headers);
+void AppendHeadersToBlock(const char* const extra_headers[],
+ int extra_header_count,
+ SpdyHeaderBlock* headers);
+
+// Constructs a HeaderBlock for the given URL.
+scoped_ptr<SpdyHeaderBlock> ConstructGetHeaderBlock(base::StringPiece url);
+
+// Constructs a HeaderBlock for a POST request for the given URL.
+scoped_ptr<SpdyHeaderBlock> ConstructPostHeaderBlock(base::StringPiece url,
+ int64 content_length);
// Writes |str| of the given |len| to the buffer pointed to by |buffer_handle|.
// Uses a template so buffer_handle can be a char* or an unsigned char*.
@@ -149,19 +157,20 @@ int AppendToBuffer(int val,
unsigned char** buffer_handle,
int* buffer_len_remaining);
-// Construct a SPDY packet.
-// |head| is the start of the packet, up to but not including
-// the header value pairs.
+// Construct a SPDY frame.
+SpdyFrame* ConstructSpdyFrame(const SpdyHeaderInfo& header_info,
+ scoped_ptr<SpdyHeaderBlock> headers);
+
+// Construct a SPDY frame.
// |extra_headers| are the extra header-value pairs, which typically
// will vary the most between calls.
// |tail| is any (relatively constant) header-value pairs to add.
-// |buffer| is the buffer we're filling in.
// Returns a SpdyFrame.
-SpdyFrame* ConstructSpdyPacket(const SpdyHeaderInfo& header_info,
- const char* const extra_headers[],
- int extra_header_count,
- const char* const tail[],
- int tail_header_count);
+SpdyFrame* ConstructSpdyFrame(const SpdyHeaderInfo& header_info,
+ const char* const extra_headers[],
+ int extra_header_count,
+ const char* const tail[],
+ int tail_header_count);
// Construct a generic SpdyControlFrame.
SpdyFrame* ConstructSpdyControlFrame(const char* const extra_headers[],
@@ -232,7 +241,7 @@ int ConstructSpdyHeader(const char* const extra_headers[],
int buffer_length,
int index);
-// Constructs a standard SPDY GET SYN packet, optionally compressed
+// Constructs a standard SPDY GET SYN frame, optionally compressed
// for the url |url|.
// |extra_headers| are the extra header-value pairs, which typically
// will vary the most between calls.
@@ -242,7 +251,7 @@ SpdyFrame* ConstructSpdyGet(const char* const url,
SpdyStreamId stream_id,
RequestPriority request_priority);
-// Constructs a standard SPDY GET SYN packet, optionally compressed.
+// Constructs a standard SPDY GET SYN frame, optionally compressed.
// |extra_headers| are the extra header-value pairs, which typically
// will vary the most between calls.
// Returns a SpdyFrame.
@@ -252,7 +261,7 @@ SpdyFrame* ConstructSpdyGet(const char* const extra_headers[],
int stream_id,
RequestPriority request_priority);
-// Constructs a standard SPDY GET SYN packet, optionally compressed.
+// Constructs a standard SPDY GET SYN frame, optionally compressed.
// |extra_headers| are the extra header-value pairs, which typically
// will vary the most between calls. If |direct| is false, the
// the full url will be used instead of simply the path.
@@ -269,7 +278,7 @@ SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[],
int extra_header_count,
int stream_id);
-// Constructs a standard SPDY push SYN packet.
+// Constructs a standard SPDY push SYN frame.
// |extra_headers| are the extra header-value pairs, which typically
// will vary the most between calls.
// Returns a SpdyFrame.
@@ -297,7 +306,7 @@ SpdyFrame* ConstructSpdyPushHeaders(int stream_id,
const char* const extra_headers[],
int extra_header_count);
-// Constructs a standard SPDY SYN_REPLY packet to match the SPDY GET.
+// Constructs a standard SPDY SYN_REPLY frame to match the SPDY GET.
// |extra_headers| are the extra header-value pairs, which typically
// will vary the most between calls.
// Returns a SpdyFrame.
@@ -305,40 +314,43 @@ SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[],
int extra_header_count,
int stream_id);
-// Constructs a standard SPDY SYN_REPLY packet to match the SPDY GET.
+// Constructs a standard SPDY SYN_REPLY frame to match the SPDY GET.
// |extra_headers| are the extra header-value pairs, which typically
// will vary the most between calls.
// Returns a SpdyFrame.
SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id);
-// Constructs a standard SPDY SYN_REPLY packet with an Internal Server
+// Constructs a standard SPDY SYN_REPLY frame with an Internal Server
// Error status code.
// Returns a SpdyFrame.
SpdyFrame* ConstructSpdySynReplyError(int stream_id);
-// Constructs a standard SPDY SYN_REPLY packet with the specified status code.
+// Constructs a standard SPDY SYN_REPLY frame with the specified status code.
// Returns a SpdyFrame.
SpdyFrame* ConstructSpdySynReplyError(const char* const status,
const char* const* const extra_headers,
int extra_header_count,
int stream_id);
-// Constructs a standard SPDY POST SYN packet.
+// Constructs a standard SPDY POST SYN frame.
// |extra_headers| are the extra header-value pairs, which typically
// will vary the most between calls.
// Returns a SpdyFrame.
-SpdyFrame* ConstructSpdyPost(int64 content_length,
+SpdyFrame* ConstructSpdyPost(const char* url,
+ SpdyStreamId stream_id,
+ int64 content_length,
+ RequestPriority priority,
const char* const extra_headers[],
int extra_header_count);
-// Constructs a chunked transfer SPDY POST SYN packet.
+// Constructs a chunked transfer SPDY POST SYN frame.
// |extra_headers| are the extra header-value pairs, which typically
// will vary the most between calls.
// Returns a SpdyFrame.
SpdyFrame* ConstructChunkedSpdyPost(const char* const extra_headers[],
int extra_header_count);
-// Constructs a standard SPDY SYN_REPLY packet to match the SPDY POST.
+// Constructs a standard SPDY SYN_REPLY frame to match the SPDY POST.
// |extra_headers| are the extra header-value pairs, which typically
// will vary the most between calls.
// Returns a SpdyFrame.
« no previous file with comments | « net/spdy/spdy_test_util_spdy2.cc ('k') | net/spdy/spdy_test_util_spdy3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698