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 4770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4781 MockWrite spdy_writes[] = { | 4781 MockWrite spdy_writes[] = { |
4782 CreateMockWrite(*req, 0, ASYNC), | 4782 CreateMockWrite(*req, 0, ASYNC), |
4783 CreateMockWrite(*rst, 2, ASYNC), | 4783 CreateMockWrite(*rst, 2, ASYNC), |
4784 CreateMockWrite(*connect2, 3), | 4784 CreateMockWrite(*connect2, 3), |
4785 CreateMockWrite(*wrapped_get, 5) | 4785 CreateMockWrite(*wrapped_get, 5) |
4786 }; | 4786 }; |
4787 | 4787 |
4788 // The proxy responds to the connect with a 407, using a persistent | 4788 // The proxy responds to the connect with a 407, using a persistent |
4789 // connection. | 4789 // connection. |
4790 const char* const kAuthChallenge[] = { | 4790 const char* const kAuthChallenge[] = { |
4791 "status", "407 Proxy Authentication Required", | 4791 ":status", "407 Proxy Authentication Required", |
4792 "version", "HTTP/1.1", | 4792 ":version", "HTTP/1.1", |
4793 "proxy-authenticate", "Basic realm=\"MyRealm1\"", | 4793 "proxy-authenticate", "Basic realm=\"MyRealm1\"", |
4794 }; | 4794 }; |
4795 | 4795 |
4796 scoped_ptr<SpdyFrame> conn_auth_resp( | 4796 scoped_ptr<SpdyFrame> conn_auth_resp( |
4797 ConstructSpdyControlFrame(NULL, | 4797 ConstructSpdyControlFrame(NULL, |
4798 0, | 4798 0, |
4799 false, | 4799 false, |
4800 1, | 4800 1, |
4801 LOWEST, | 4801 LOWEST, |
4802 SYN_REPLY, | 4802 SYN_REPLY, |
(...skipping 4566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9369 StaticSocketDataProvider* data[] = { &data1, &data2 }; | 9369 StaticSocketDataProvider* data[] = { &data1, &data2 }; |
9370 | 9370 |
9371 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); | 9371 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); |
9372 | 9372 |
9373 EXPECT_EQ(OK, out.rv); | 9373 EXPECT_EQ(OK, out.rv); |
9374 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); | 9374 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); |
9375 EXPECT_EQ("hello world", out.response_data); | 9375 EXPECT_EQ("hello world", out.response_data); |
9376 } | 9376 } |
9377 | 9377 |
9378 } // namespace net | 9378 } // namespace net |
OLD | NEW |