| 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_stream.h" | 5 #include "net/websockets/websocket_stream.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 NoSubProtocols(), LocalhostOrigin(), LocalhostUrl(), | 330 NoSubProtocols(), LocalhostOrigin(), LocalhostUrl(), |
| 331 "", "", ""); | 331 "", "", ""); |
| 332 EXPECT_FALSE(request_info_); | 332 EXPECT_FALSE(request_info_); |
| 333 EXPECT_FALSE(response_info_); | 333 EXPECT_FALSE(response_info_); |
| 334 EXPECT_TRUE(url_request_); | 334 EXPECT_TRUE(url_request_); |
| 335 WaitUntilConnectDone(); | 335 WaitUntilConnectDone(); |
| 336 EXPECT_FALSE(has_failed()); | 336 EXPECT_FALSE(has_failed()); |
| 337 EXPECT_TRUE(stream_); | 337 EXPECT_TRUE(stream_); |
| 338 EXPECT_TRUE(request_info_); | 338 EXPECT_TRUE(request_info_); |
| 339 EXPECT_TRUE(response_info_); | 339 EXPECT_TRUE(response_info_); |
| 340 EXPECT_EQ(ERR_WEBSOCKET_HANDSHAKE_SUCCESS, | 340 EXPECT_EQ(ERR_WS_UPGRADE, |
| 341 url_request_context_host_.network_delegate().last_error()); | 341 url_request_context_host_.network_delegate().last_error()); |
| 342 } | 342 } |
| 343 | 343 |
| 344 TEST_F(WebSocketStreamCreateTest, HandshakeInfo) { | 344 TEST_F(WebSocketStreamCreateTest, HandshakeInfo) { |
| 345 static const char kResponse[] = | 345 static const char kResponse[] = |
| 346 "HTTP/1.1 101 Switching Protocols\r\n" | 346 "HTTP/1.1 101 Switching Protocols\r\n" |
| 347 "Upgrade: websocket\r\n" | 347 "Upgrade: websocket\r\n" |
| 348 "Connection: Upgrade\r\n" | 348 "Connection: Upgrade\r\n" |
| 349 "Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\n" | 349 "Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\n" |
| 350 "foo: bar, baz\r\n" | 350 "foo: bar, baz\r\n" |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 LocalhostOrigin(), LocalhostUrl(), "", | 1263 LocalhostOrigin(), LocalhostUrl(), "", |
| 1264 std::move(socket_data)); | 1264 std::move(socket_data)); |
| 1265 WaitUntilConnectDone(); | 1265 WaitUntilConnectDone(); |
| 1266 EXPECT_TRUE(has_failed()); | 1266 EXPECT_TRUE(has_failed()); |
| 1267 EXPECT_EQ("Establishing a tunnel via proxy server failed.", | 1267 EXPECT_EQ("Establishing a tunnel via proxy server failed.", |
| 1268 failure_message()); | 1268 failure_message()); |
| 1269 } | 1269 } |
| 1270 | 1270 |
| 1271 } // namespace | 1271 } // namespace |
| 1272 } // namespace net | 1272 } // namespace net |
| OLD | NEW |