OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/websockets/websocket_handshake_handler.h" | 5 #include "net/websockets/websocket_handshake_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "net/socket/next_proto.h" | 9 #include "net/socket/next_proto.h" |
10 #include "net/spdy/spdy_header_block.h" | 10 #include "net/spdy/spdy_header_block.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 public ::testing::WithParamInterface<NextProto> { | 21 public ::testing::WithParamInterface<NextProto> { |
22 protected: | 22 protected: |
23 WebSocketHandshakeHandlerSpdyTest() : spdy_util_(GetParam()) {} | 23 WebSocketHandshakeHandlerSpdyTest() : spdy_util_(GetParam()) {} |
24 | 24 |
25 SpdyWebSocketTestUtil spdy_util_; | 25 SpdyWebSocketTestUtil spdy_util_; |
26 }; | 26 }; |
27 | 27 |
28 INSTANTIATE_TEST_CASE_P( | 28 INSTANTIATE_TEST_CASE_P( |
29 NextProto, | 29 NextProto, |
30 WebSocketHandshakeHandlerSpdyTest, | 30 WebSocketHandshakeHandlerSpdyTest, |
31 testing::Values(kProtoSPDY2, kProtoSPDY3, kProtoSPDY31, kProtoSPDY4a2, | 31 testing::Values(kProtoDeprecatedSPDY2, |
| 32 kProtoSPDY3, kProtoSPDY31, kProtoSPDY4a2, |
32 kProtoHTTP2Draft04)); | 33 kProtoHTTP2Draft04)); |
33 | 34 |
34 TEST_P(WebSocketHandshakeHandlerSpdyTest, RequestResponse) { | 35 TEST_P(WebSocketHandshakeHandlerSpdyTest, RequestResponse) { |
35 WebSocketHandshakeRequestHandler request_handler; | 36 WebSocketHandshakeRequestHandler request_handler; |
36 | 37 |
37 static const char kHandshakeRequestMessage[] = | 38 static const char kHandshakeRequestMessage[] = |
38 "GET /demo HTTP/1.1\r\n" | 39 "GET /demo HTTP/1.1\r\n" |
39 "Host: example.com\r\n" | 40 "Host: example.com\r\n" |
40 "Upgrade: websocket\r\n" | 41 "Upgrade: websocket\r\n" |
41 "Connection: Upgrade\r\n" | 42 "Connection: Upgrade\r\n" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 "set-cookie: WK-websocket-test=1\r\n" | 183 "set-cookie: WK-websocket-test=1\r\n" |
183 "set-cookie: WK-websocket-test-httponly=1; HttpOnly\r\n" | 184 "set-cookie: WK-websocket-test-httponly=1; HttpOnly\r\n" |
184 "\r\n"; | 185 "\r\n"; |
185 | 186 |
186 EXPECT_EQ(kHandshakeResponseExpectedMessage, response_handler.GetResponse()); | 187 EXPECT_EQ(kHandshakeResponseExpectedMessage, response_handler.GetResponse()); |
187 } | 188 } |
188 | 189 |
189 } // namespace | 190 } // namespace |
190 | 191 |
191 } // namespace net | 192 } // namespace net |
OLD | NEW |