| 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(kProtoDeprecatedSPDY2, | 31 testing::Values(kProtoSPDY31, kProtoSPDY4)); |
| 32 kProtoSPDY3, kProtoSPDY31, kProtoSPDY4)); | |
| 33 | 32 |
| 34 TEST_P(WebSocketHandshakeHandlerSpdyTest, RequestResponse) { | 33 TEST_P(WebSocketHandshakeHandlerSpdyTest, RequestResponse) { |
| 35 WebSocketHandshakeRequestHandler request_handler; | 34 WebSocketHandshakeRequestHandler request_handler; |
| 36 | 35 |
| 37 static const char kHandshakeRequestMessage[] = | 36 static const char kHandshakeRequestMessage[] = |
| 38 "GET /demo HTTP/1.1\r\n" | 37 "GET /demo HTTP/1.1\r\n" |
| 39 "Host: example.com\r\n" | 38 "Host: example.com\r\n" |
| 40 "Upgrade: websocket\r\n" | 39 "Upgrade: websocket\r\n" |
| 41 "Connection: Upgrade\r\n" | 40 "Connection: Upgrade\r\n" |
| 42 "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n" | 41 "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 "set-cookie: WK-websocket-test=1\r\n" | 177 "set-cookie: WK-websocket-test=1\r\n" |
| 179 "set-cookie: WK-websocket-test-httponly=1; HttpOnly\r\n" | 178 "set-cookie: WK-websocket-test-httponly=1; HttpOnly\r\n" |
| 180 "\r\n"; | 179 "\r\n"; |
| 181 | 180 |
| 182 EXPECT_EQ(kHandshakeResponseExpectedMessage, response_handler.GetResponse()); | 181 EXPECT_EQ(kHandshakeResponseExpectedMessage, response_handler.GetResponse()); |
| 183 } | 182 } |
| 184 | 183 |
| 185 } // namespace | 184 } // namespace |
| 186 | 185 |
| 187 } // namespace net | 186 } // namespace net |
| OLD | NEW |