OLD | NEW |
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 #ifndef NET_SPDY_SPDY_TEST_UTIL_H_ | 5 #ifndef NET_SPDY_SPDY_TEST_UTIL_H_ |
6 #define NET_SPDY_SPDY_TEST_UTIL_H_ | 6 #define NET_SPDY_SPDY_TEST_UTIL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "net/base/cert_verifier.h" | 10 #include "net/base/cert_verifier.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 bool compressed, | 227 bool compressed, |
228 int stream_id, | 228 int stream_id, |
229 RequestPriority request_priority, | 229 RequestPriority request_priority, |
230 bool direct); | 230 bool direct); |
231 | 231 |
232 // Constructs a standard SPDY SYN_STREAM frame for a CONNECT request. | 232 // Constructs a standard SPDY SYN_STREAM frame for a CONNECT request. |
233 SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], | 233 SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], |
234 int extra_header_count, | 234 int extra_header_count, |
235 int stream_id); | 235 int stream_id); |
236 | 236 |
237 // Constructs a standard SPDY SYN_STREAM frame for WebSocket over SPDY | |
238 // opening handshake. | |
239 SpdyFrame* ConstructSpdyWebSocket(int stream_id, | |
240 const char* path, | |
241 const char* host, | |
242 const char* origin); | |
243 | |
244 // Constructs a standard SPDY push SYN packet. | 237 // Constructs a standard SPDY push SYN packet. |
245 // |extra_headers| are the extra header-value pairs, which typically | 238 // |extra_headers| are the extra header-value pairs, which typically |
246 // will vary the most between calls. | 239 // will vary the most between calls. |
247 // Returns a SpdyFrame. | 240 // Returns a SpdyFrame. |
248 SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], | 241 SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], |
249 int extra_header_count, | 242 int extra_header_count, |
250 int stream_id, | 243 int stream_id, |
251 int associated_stream_id); | 244 int associated_stream_id); |
252 SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], | 245 SpdyFrame* ConstructSpdyPush(const char* const extra_headers[], |
253 int extra_header_count, | 246 int extra_header_count, |
(...skipping 22 matching lines...) Expand all Loading... |
276 SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], | 269 SpdyFrame* ConstructSpdyGetSynReply(const char* const extra_headers[], |
277 int extra_header_count, | 270 int extra_header_count, |
278 int stream_id); | 271 int stream_id); |
279 | 272 |
280 // Constructs a standard SPDY SYN_REPLY packet to match the SPDY GET. | 273 // Constructs a standard SPDY SYN_REPLY packet to match the SPDY GET. |
281 // |extra_headers| are the extra header-value pairs, which typically | 274 // |extra_headers| are the extra header-value pairs, which typically |
282 // will vary the most between calls. | 275 // will vary the most between calls. |
283 // Returns a SpdyFrame. | 276 // Returns a SpdyFrame. |
284 SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id); | 277 SpdyFrame* ConstructSpdyGetSynReplyRedirect(int stream_id); |
285 | 278 |
286 // Constructs a standard SPDY SYN_REPLY packet to match the WebSocket over SPDY | |
287 // opening handshake. | |
288 // Returns a SpdyFrame. | |
289 SpdyFrame* ConstructSpdyWebSocketSynReply(int stream_id); | |
290 | |
291 // Constructs a standard SPDY SYN_REPLY packet with an Internal Server | 279 // Constructs a standard SPDY SYN_REPLY packet with an Internal Server |
292 // Error status code. | 280 // Error status code. |
293 // Returns a SpdyFrame. | 281 // Returns a SpdyFrame. |
294 SpdyFrame* ConstructSpdySynReplyError(int stream_id); | 282 SpdyFrame* ConstructSpdySynReplyError(int stream_id); |
295 | 283 |
296 // Constructs a standard SPDY SYN_REPLY packet with the specified status code. | 284 // Constructs a standard SPDY SYN_REPLY packet with the specified status code. |
297 // Returns a SpdyFrame. | 285 // Returns a SpdyFrame. |
298 SpdyFrame* ConstructSpdySynReplyError(const char* const status, | 286 SpdyFrame* ConstructSpdySynReplyError(const char* const status, |
299 const char* const* const extra_headers, | 287 const char* const* const extra_headers, |
300 int extra_header_count, | 288 int extra_header_count, |
(...skipping 22 matching lines...) Expand all Loading... |
323 int extra_header_count); | 311 int extra_header_count); |
324 | 312 |
325 // Constructs a single SPDY data frame with the contents "hello!" | 313 // Constructs a single SPDY data frame with the contents "hello!" |
326 SpdyFrame* ConstructSpdyBodyFrame(int stream_id, | 314 SpdyFrame* ConstructSpdyBodyFrame(int stream_id, |
327 bool fin); | 315 bool fin); |
328 | 316 |
329 // Constructs a single SPDY data frame with the given content. | 317 // Constructs a single SPDY data frame with the given content. |
330 SpdyFrame* ConstructSpdyBodyFrame(int stream_id, const char* data, | 318 SpdyFrame* ConstructSpdyBodyFrame(int stream_id, const char* data, |
331 uint32 len, bool fin); | 319 uint32 len, bool fin); |
332 | 320 |
333 // Constructs a SPDY HEADERS frame for a WebSocket frame over SPDY. | |
334 SpdyFrame* ConstructSpdyWebSocketHeadersFrame(int stream_id, | |
335 const char* length, | |
336 bool fin); | |
337 | |
338 // Wraps |frame| in the payload of a data frame in stream |stream_id|. | 321 // Wraps |frame| in the payload of a data frame in stream |stream_id|. |
339 SpdyFrame* ConstructWrappedSpdyFrame(const scoped_ptr<SpdyFrame>& frame, | 322 SpdyFrame* ConstructWrappedSpdyFrame(const scoped_ptr<SpdyFrame>& frame, |
340 int stream_id); | 323 int stream_id); |
341 | 324 |
342 // Create an async MockWrite from the given SpdyFrame. | 325 // Create an async MockWrite from the given SpdyFrame. |
343 MockWrite CreateMockWrite(const SpdyFrame& req); | 326 MockWrite CreateMockWrite(const SpdyFrame& req); |
344 | 327 |
345 // Create an async MockWrite from the given SpdyFrame and sequence number. | 328 // Create an async MockWrite from the given SpdyFrame and sequence number. |
346 MockWrite CreateMockWrite(const SpdyFrame& req, int seq); | 329 MockWrite CreateMockWrite(const SpdyFrame& req, int seq); |
347 | 330 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 scoped_ptr<crypto::ECSignatureCreatorFactory> ec_signature_creator_factory_; | 430 scoped_ptr<crypto::ECSignatureCreatorFactory> ec_signature_creator_factory_; |
448 | 431 |
449 DISALLOW_COPY_AND_ASSIGN(SpdyTestStateHelper); | 432 DISALLOW_COPY_AND_ASSIGN(SpdyTestStateHelper); |
450 }; | 433 }; |
451 | 434 |
452 } // namespace test_spdy3 | 435 } // namespace test_spdy3 |
453 | 436 |
454 } // namespace net | 437 } // namespace net |
455 | 438 |
456 #endif // NET_SPDY_SPDY_TEST_UTIL_H_ | 439 #endif // NET_SPDY_SPDY_TEST_UTIL_H_ |
OLD | NEW |