| 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 4907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4918 ConstructSpdyConnect(kAuthCredentials, arraysize(kAuthCredentials)/2, 3)); | 4918 ConstructSpdyConnect(kAuthCredentials, arraysize(kAuthCredentials)/2, 3)); |
| 4919 // fetch https://www.google.com/ via HTTP | 4919 // fetch https://www.google.com/ via HTTP |
| 4920 const char get[] = "GET / HTTP/1.1\r\n" | 4920 const char get[] = "GET / HTTP/1.1\r\n" |
| 4921 "Host: www.google.com\r\n" | 4921 "Host: www.google.com\r\n" |
| 4922 "Connection: keep-alive\r\n\r\n"; | 4922 "Connection: keep-alive\r\n\r\n"; |
| 4923 scoped_ptr<SpdyFrame> wrapped_get( | 4923 scoped_ptr<SpdyFrame> wrapped_get( |
| 4924 ConstructSpdyBodyFrame(3, get, strlen(get), false)); | 4924 ConstructSpdyBodyFrame(3, get, strlen(get), false)); |
| 4925 | 4925 |
| 4926 MockWrite spdy_writes[] = { | 4926 MockWrite spdy_writes[] = { |
| 4927 CreateMockWrite(*req, 0, ASYNC), | 4927 CreateMockWrite(*req, 0, ASYNC), |
| 4928 CreateMockWrite(*connect2, 2), | 4928 CreateMockWrite(*rst, 2, ASYNC), |
| 4929 CreateMockWrite(*rst, 3, ASYNC), | 4929 CreateMockWrite(*connect2, 3), |
| 4930 CreateMockWrite(*wrapped_get, 5) | 4930 CreateMockWrite(*wrapped_get, 5) |
| 4931 }; | 4931 }; |
| 4932 | 4932 |
| 4933 // The proxy responds to the connect with a 407, using a persistent | 4933 // The proxy responds to the connect with a 407, using a persistent |
| 4934 // connection. | 4934 // connection. |
| 4935 const char* const kAuthChallenge[] = { | 4935 const char* const kAuthChallenge[] = { |
| 4936 ":status", "407 Proxy Authentication Required", | 4936 ":status", "407 Proxy Authentication Required", |
| 4937 ":version", "HTTP/1.1", | 4937 ":version", "HTTP/1.1", |
| 4938 "proxy-authenticate", "Basic realm=\"MyRealm1\"", | 4938 "proxy-authenticate", "Basic realm=\"MyRealm1\"", |
| 4939 }; | 4939 }; |
| (...skipping 4775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9715 StaticSocketDataProvider* data[] = { &data1, &data2 }; | 9715 StaticSocketDataProvider* data[] = { &data1, &data2 }; |
| 9716 | 9716 |
| 9717 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); | 9717 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); |
| 9718 | 9718 |
| 9719 EXPECT_EQ(OK, out.rv); | 9719 EXPECT_EQ(OK, out.rv); |
| 9720 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); | 9720 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); |
| 9721 EXPECT_EQ("hello world", out.response_data); | 9721 EXPECT_EQ("hello world", out.response_data); |
| 9722 } | 9722 } |
| 9723 | 9723 |
| 9724 } // namespace net | 9724 } // namespace net |
| OLD | NEW |