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_WEBSOCKET_TEST_UTIL_H_ | 5 #ifndef NET_SPDY_SPDY_WEBSOCKET_TEST_UTIL_H_ |
6 #define NET_SPDY_SPDY_WEBSOCKET_TEST_UTIL_H_ | 6 #define NET_SPDY_SPDY_WEBSOCKET_TEST_UTIL_H_ |
7 | 7 |
8 #include "net/base/request_priority.h" | 8 #include "net/base/request_priority.h" |
9 #include "net/spdy/spdy_protocol.h" | 9 #include "net/spdy/spdy_protocol.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 | 12 |
13 namespace test_spdy3 { | 13 namespace test_spdy3 { |
14 | 14 |
15 // Construct a WebSocket over SPDY handshake request packet. | 15 // Constructs a standard SPDY SYN_STREAM frame for WebSocket over SPDY opening |
| 16 // handshake. |
| 17 SpdyFrame* ConstructSpdyWebSocketSynStream(int stream_id, |
| 18 const char* path, |
| 19 const char* host, |
| 20 const char* origin); |
| 21 |
| 22 // Constructs a standard SPDY SYN_REPLY packet to match the WebSocket over SPDY |
| 23 // opening handshake. |
| 24 SpdyFrame* ConstructSpdyWebSocketSynReply(int stream_id); |
| 25 |
| 26 // Constructs a WebSocket over SPDY handshake request packet. |
16 SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( | 27 SpdyFrame* ConstructSpdyWebSocketHandshakeRequestFrame( |
17 const char* const headers[], | 28 const char* const headers[], |
18 int header_count, | 29 int header_count, |
19 SpdyStreamId stream_id, | 30 SpdyStreamId stream_id, |
20 RequestPriority request_priority); | 31 RequestPriority request_priority); |
21 | 32 |
22 // Construct a WebSocket over SPDY handshake response packet. | 33 // Constructs a WebSocket over SPDY handshake response packet. |
23 SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( | 34 SpdyFrame* ConstructSpdyWebSocketHandshakeResponseFrame( |
24 const char* const headers[], | 35 const char* const headers[], |
25 int header_count, | 36 int header_count, |
26 SpdyStreamId stream_id, | 37 SpdyStreamId stream_id, |
27 RequestPriority request_priority); | 38 RequestPriority request_priority); |
28 | 39 |
29 // Construct a WebSocket over SPDY data packet. | 40 // Constructs a SPDY HEADERS frame for a WebSocket frame over SPDY. |
30 SpdyFrame* ConstructSpdyWebSocketDataFrame( | 41 SpdyFrame* ConstructSpdyWebSocketHeadersFrame(int stream_id, |
31 const char* data, | 42 const char* length, |
32 int len, | 43 bool fin); |
33 SpdyStreamId stream_id, | 44 |
34 bool fin); | 45 // Constructs a WebSocket over SPDY data packet. |
| 46 SpdyFrame* ConstructSpdyWebSocketDataFrame(const char* data, |
| 47 int len, |
| 48 SpdyStreamId stream_id, |
| 49 bool fin); |
35 | 50 |
36 } // namespace test_spdy3 | 51 } // namespace test_spdy3 |
37 | 52 |
38 } // namespace net | 53 } // namespace net |
39 | 54 |
40 #endif // NET_SPDY_SPDY_WEBSOCKET_TEST_UTIL_H_ | 55 #endif // NET_SPDY_SPDY_WEBSOCKET_TEST_UTIL_H_ |
OLD | NEW |