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

Side by Side Diff: net/spdy/spdy_websocket_test_util_spdy2.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_test_util_spdy3.cc ('k') | net/spdy/spdy_websocket_test_util_spdy3.cc » ('j') | 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_spdy2.h" 5 #include "net/spdy/spdy_websocket_test_util_spdy2.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_spdy2.h" 9 #include "net/spdy/spdy_test_util_spdy2.h"
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 ConvertRequestPriorityToSpdyPriority(request_priority, 2), 76 ConvertRequestPriorityToSpdyPriority(request_priority, 2),
77 CONTROL_FLAG_NONE, 77 CONTROL_FLAG_NONE,
78 kDefaultCompressed, 78 kDefaultCompressed,
79 RST_STREAM_INVALID, 79 RST_STREAM_INVALID,
80 kDefaultDataPointer, 80 kDefaultDataPointer,
81 kDefaultDataLength, 81 kDefaultDataLength,
82 DATA_FLAG_NONE 82 DATA_FLAG_NONE
83 }; 83 };
84 84
85 // Construct SPDY SYN_STREAM control frame. 85 // Construct SPDY SYN_STREAM control frame.
86 return ConstructSpdyPacket( 86 return ConstructSpdyFrame(
87 kSynStreamHeader, 87 kSynStreamHeader,
88 kDefaultExtraHeaders, 88 kDefaultExtraHeaders,
89 kDefaultExtraHeaderCount, 89 kDefaultExtraHeaderCount,
90 headers, 90 headers,
91 header_count); 91 header_count);
92 } 92 }
93 93
94 SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( 94 SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame(
95 const char* const headers[], 95 const char* const headers[],
96 int header_count, 96 int header_count,
97 SpdyStreamId stream_id, 97 SpdyStreamId stream_id,
98 RequestPriority request_priority) { 98 RequestPriority request_priority) {
99 99
100 // SPDY SYN_REPLY control frame header. 100 // SPDY SYN_REPLY control frame header.
101 const SpdyHeaderInfo kSynReplyHeader = { 101 const SpdyHeaderInfo kSynReplyHeader = {
102 SYN_REPLY, 102 SYN_REPLY,
103 stream_id, 103 stream_id,
104 kDefaultAssociatedStreamId, 104 kDefaultAssociatedStreamId,
105 ConvertRequestPriorityToSpdyPriority(request_priority, 2), 105 ConvertRequestPriorityToSpdyPriority(request_priority, 2),
106 CONTROL_FLAG_NONE, 106 CONTROL_FLAG_NONE,
107 kDefaultCompressed, 107 kDefaultCompressed,
108 RST_STREAM_INVALID, 108 RST_STREAM_INVALID,
109 kDefaultDataPointer, 109 kDefaultDataPointer,
110 kDefaultDataLength, 110 kDefaultDataLength,
111 DATA_FLAG_NONE 111 DATA_FLAG_NONE
112 }; 112 };
113 113
114 // Construct SPDY SYN_REPLY control frame. 114 // Construct SPDY SYN_REPLY control frame.
115 return ConstructSpdyPacket( 115 return ConstructSpdyFrame(
116 kSynReplyHeader, 116 kSynReplyHeader,
117 kDefaultExtraHeaders, 117 kDefaultExtraHeaders,
118 kDefaultExtraHeaderCount, 118 kDefaultExtraHeaderCount,
119 headers, 119 headers,
120 header_count); 120 header_count);
121 } 121 }
122 122
123 SpdyFrame* ConstructSpdyWebSocketHeadersFrame(int stream_id, 123 SpdyFrame* ConstructSpdyWebSocketHeadersFrame(int stream_id,
124 const char* length, 124 const char* length,
125 bool fin) { 125 bool fin) {
(...skipping 27 matching lines...) Expand all
153 return framer.CreateDataFrame( 153 return framer.CreateDataFrame(
154 stream_id, 154 stream_id,
155 data, 155 data,
156 len, 156 len,
157 fin ? DATA_FLAG_FIN : DATA_FLAG_NONE); 157 fin ? DATA_FLAG_FIN : DATA_FLAG_NONE);
158 } 158 }
159 159
160 } // namespace test_spdy2 160 } // namespace test_spdy2
161 161
162 } // namespace net 162 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_test_util_spdy3.cc ('k') | net/spdy/spdy_websocket_test_util_spdy3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698