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

Side by Side Diff: net/spdy/spdy_websocket_test_util_spdy3.cc

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_websocket_test_util_spdy2.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/spdy_websocket_test_util_spdy3.h" 5 #include "net/spdy/spdy_websocket_test_util_spdy3.h"
6 6
7 #include "net/spdy/buffered_spdy_framer.h" 7 #include "net/spdy/buffered_spdy_framer.h"
8 #include "net/spdy/spdy_http_utils.h" 8 #include "net/spdy/spdy_http_utils.h"
9 #include "net/spdy/spdy_test_util_spdy3.h" 9 #include "net/spdy/spdy_test_util_spdy3.h"
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 kDefaultCredentialSlot, 78 kDefaultCredentialSlot,
79 CONTROL_FLAG_NONE, 79 CONTROL_FLAG_NONE,
80 kDefaultCompressed, 80 kDefaultCompressed,
81 RST_STREAM_INVALID, 81 RST_STREAM_INVALID,
82 kDefaultDataPointer, 82 kDefaultDataPointer,
83 kDefaultDataLength, 83 kDefaultDataLength,
84 DATA_FLAG_NONE 84 DATA_FLAG_NONE
85 }; 85 };
86 86
87 // Construct SPDY SYN_STREAM control frame. 87 // Construct SPDY SYN_STREAM control frame.
88 return ConstructSpdyPacket( 88 return ConstructSpdyFrame(
89 kSynStreamHeader, 89 kSynStreamHeader,
90 kDefaultExtraHeaders, 90 kDefaultExtraHeaders,
91 kDefaultExtraHeaderCount, 91 kDefaultExtraHeaderCount,
92 headers, 92 headers,
93 header_count); 93 header_count);
94 } 94 }
95 95
96 SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( 96 SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame(
97 const char* const headers[], 97 const char* const headers[],
98 int header_count, 98 int header_count,
99 SpdyStreamId stream_id, 99 SpdyStreamId stream_id,
100 RequestPriority request_priority) { 100 RequestPriority request_priority) {
101 101
102 // SPDY SYN_REPLY control frame header. 102 // SPDY SYN_REPLY control frame header.
103 const SpdyHeaderInfo kSynReplyHeader = { 103 const SpdyHeaderInfo kSynReplyHeader = {
104 SYN_REPLY, 104 SYN_REPLY,
105 stream_id, 105 stream_id,
106 kDefaultAssociatedStreamId, 106 kDefaultAssociatedStreamId,
107 ConvertRequestPriorityToSpdyPriority(request_priority, 3), 107 ConvertRequestPriorityToSpdyPriority(request_priority, 3),
108 kDefaultCredentialSlot, 108 kDefaultCredentialSlot,
109 CONTROL_FLAG_NONE, 109 CONTROL_FLAG_NONE,
110 kDefaultCompressed, 110 kDefaultCompressed,
111 RST_STREAM_INVALID, 111 RST_STREAM_INVALID,
112 kDefaultDataPointer, 112 kDefaultDataPointer,
113 kDefaultDataLength, 113 kDefaultDataLength,
114 DATA_FLAG_NONE 114 DATA_FLAG_NONE
115 }; 115 };
116 116
117 // Construct SPDY SYN_REPLY control frame. 117 // Construct SPDY SYN_REPLY control frame.
118 return ConstructSpdyPacket( 118 return ConstructSpdyFrame(
119 kSynReplyHeader, 119 kSynReplyHeader,
120 kDefaultExtraHeaders, 120 kDefaultExtraHeaders,
121 kDefaultExtraHeaderCount, 121 kDefaultExtraHeaderCount,
122 headers, 122 headers,
123 header_count); 123 header_count);
124 } 124 }
125 125
126 SpdyFrame* ConstructSpdyWebSocketHeadersFrame(int stream_id, 126 SpdyFrame* ConstructSpdyWebSocketHeadersFrame(int stream_id,
127 const char* length, 127 const char* length,
128 bool fin) { 128 bool fin) {
(...skipping 27 matching lines...) Expand all
156 return framer.CreateDataFrame( 156 return framer.CreateDataFrame(
157 stream_id, 157 stream_id,
158 data, 158 data,
159 len, 159 len,
160 fin ? DATA_FLAG_FIN : DATA_FLAG_NONE); 160 fin ? DATA_FLAG_FIN : DATA_FLAG_NONE);
161 } 161 }
162 162
163 } // namespace test_spdy3 163 } // namespace test_spdy3
164 164
165 } // namespace net 165 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_websocket_test_util_spdy2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698