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/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
8 #include <stdarg.h> | 8 #include <stdarg.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 13782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13793 | 13793 |
13794 scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); | 13794 scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); |
13795 | 13795 |
13796 MockWrite data_writes[] = { | 13796 MockWrite data_writes[] = { |
13797 // Try to establish a tunnel for the WebSocket connection, with | 13797 // Try to establish a tunnel for the WebSocket connection, with |
13798 // credentials. Because WebSockets have a separate set of socket pools, | 13798 // credentials. Because WebSockets have a separate set of socket pools, |
13799 // they cannot and will not use the same TCP/IP connection as the | 13799 // they cannot and will not use the same TCP/IP connection as the |
13800 // preflight HTTP request. | 13800 // preflight HTTP request. |
13801 MockWrite( | 13801 MockWrite( |
13802 "CONNECT www.google.com:80 HTTP/1.1\r\n" | 13802 "CONNECT www.google.com:80 HTTP/1.1\r\n" |
13803 "Host: www.google.com\r\n" | 13803 "Host: www.google.com:80\r\n" |
13804 "Proxy-Connection: keep-alive\r\n" | 13804 "Proxy-Connection: keep-alive\r\n" |
13805 "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), | 13805 "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), |
13806 | 13806 |
13807 MockWrite( | 13807 MockWrite( |
13808 "GET / HTTP/1.1\r\n" | 13808 "GET / HTTP/1.1\r\n" |
13809 "Host: www.google.com\r\n" | 13809 "Host: www.google.com\r\n" |
13810 "Connection: Upgrade\r\n" | 13810 "Connection: Upgrade\r\n" |
13811 "Upgrade: websocket\r\n" | 13811 "Upgrade: websocket\r\n" |
13812 "Origin: http://www.google.com\r\n" | 13812 "Origin: http://www.google.com\r\n" |
13813 "Sec-WebSocket-Version: 13\r\n" | 13813 "Sec-WebSocket-Version: 13\r\n" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13851 ASSERT_TRUE(response); | 13851 ASSERT_TRUE(response); |
13852 ASSERT_TRUE(response->headers.get()); | 13852 ASSERT_TRUE(response->headers.get()); |
13853 | 13853 |
13854 EXPECT_EQ(101, response->headers->response_code()); | 13854 EXPECT_EQ(101, response->headers->response_code()); |
13855 | 13855 |
13856 trans.reset(); | 13856 trans.reset(); |
13857 session->CloseAllConnections(); | 13857 session->CloseAllConnections(); |
13858 } | 13858 } |
13859 | 13859 |
13860 } // namespace net | 13860 } // namespace net |
OLD | NEW |