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 #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 4926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4937 ConstructSpdyConnect(kAuthCredentials, arraysize(kAuthCredentials)/2, 3)); | 4937 ConstructSpdyConnect(kAuthCredentials, arraysize(kAuthCredentials)/2, 3)); |
4938 // fetch https://www.google.com/ via HTTP | 4938 // fetch https://www.google.com/ via HTTP |
4939 const char get[] = "GET / HTTP/1.1\r\n" | 4939 const char get[] = "GET / HTTP/1.1\r\n" |
4940 "Host: www.google.com\r\n" | 4940 "Host: www.google.com\r\n" |
4941 "Connection: keep-alive\r\n\r\n"; | 4941 "Connection: keep-alive\r\n\r\n"; |
4942 scoped_ptr<SpdyFrame> wrapped_get( | 4942 scoped_ptr<SpdyFrame> wrapped_get( |
4943 ConstructSpdyBodyFrame(3, get, strlen(get), false)); | 4943 ConstructSpdyBodyFrame(3, get, strlen(get), false)); |
4944 | 4944 |
4945 MockWrite spdy_writes[] = { | 4945 MockWrite spdy_writes[] = { |
4946 CreateMockWrite(*req, 0, ASYNC), | 4946 CreateMockWrite(*req, 0, ASYNC), |
4947 CreateMockWrite(*connect2, 2), | 4947 CreateMockWrite(*rst, 2, ASYNC), |
4948 CreateMockWrite(*rst, 3, ASYNC), | 4948 CreateMockWrite(*connect2, 3), |
4949 CreateMockWrite(*wrapped_get, 5), | 4949 CreateMockWrite(*wrapped_get, 5), |
4950 }; | 4950 }; |
4951 | 4951 |
4952 // The proxy responds to the connect with a 407, using a persistent | 4952 // The proxy responds to the connect with a 407, using a persistent |
4953 // connection. | 4953 // connection. |
4954 const char* const kAuthChallenge[] = { | 4954 const char* const kAuthChallenge[] = { |
4955 "status", "407 Proxy Authentication Required", | 4955 "status", "407 Proxy Authentication Required", |
4956 "version", "HTTP/1.1", | 4956 "version", "HTTP/1.1", |
4957 "proxy-authenticate", "Basic realm=\"MyRealm1\"", | 4957 "proxy-authenticate", "Basic realm=\"MyRealm1\"", |
4958 }; | 4958 }; |
(...skipping 4857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9816 StaticSocketDataProvider* data[] = { &data1, &data2 }; | 9816 StaticSocketDataProvider* data[] = { &data1, &data2 }; |
9817 | 9817 |
9818 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); | 9818 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); |
9819 | 9819 |
9820 EXPECT_EQ(OK, out.rv); | 9820 EXPECT_EQ(OK, out.rv); |
9821 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); | 9821 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); |
9822 EXPECT_EQ("hello world", out.response_data); | 9822 EXPECT_EQ("hello world", out.response_data); |
9823 } | 9823 } |
9824 | 9824 |
9825 } // namespace net | 9825 } // namespace net |
OLD | NEW |