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 9907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9918 scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, true)); | 9918 scoped_ptr<SpdyFrame> body2(ConstructSpdyBodyFrame(3, true)); |
9919 MockRead reads1[] = { | 9919 MockRead reads1[] = { |
9920 CreateMockRead(*conn_resp, 1), | 9920 CreateMockRead(*conn_resp, 1), |
9921 CreateMockRead(*wrapped_resp1, 3), | 9921 CreateMockRead(*wrapped_resp1, 3), |
9922 CreateMockRead(*wrapped_body1, 4), | 9922 CreateMockRead(*wrapped_body1, 4), |
9923 CreateMockRead(*resp2, 6), | 9923 CreateMockRead(*resp2, 6), |
9924 CreateMockRead(*body2, 7), | 9924 CreateMockRead(*body2, 7), |
9925 MockRead(ASYNC, ERR_IO_PENDING, 8) | 9925 MockRead(ASYNC, ERR_IO_PENDING, 8) |
9926 }; | 9926 }; |
9927 | 9927 |
9928 scoped_refptr<DeterministicSocketData> data1( | 9928 scoped_ptr<DeterministicSocketData> data1( |
9929 new DeterministicSocketData(reads1, arraysize(reads1), | 9929 new DeterministicSocketData(reads1, arraysize(reads1), |
9930 writes1, arraysize(writes1))); | 9930 writes1, arraysize(writes1))); |
9931 MockConnect connect_data1(ASYNC, OK); | 9931 MockConnect connect_data1(ASYNC, OK); |
9932 data1->set_connect_data(connect_data1); | 9932 data1->set_connect_data(connect_data1); |
9933 | 9933 |
9934 SpdySessionDependencies session_deps(ProxyService::CreateFixed( | 9934 SpdySessionDependencies session_deps(ProxyService::CreateFixed( |
9935 "https://proxy:70")); | 9935 "https://proxy:70")); |
9936 SSLSocketDataProvider ssl1(ASYNC, OK); // to the proxy | 9936 SSLSocketDataProvider ssl1(ASYNC, OK); // to the proxy |
9937 ssl1.SetNextProto(kProtoSPDY3); | 9937 ssl1.SetNextProto(kProtoSPDY3); |
9938 session_deps.deterministic_socket_factory->AddSSLSocketDataProvider(&ssl1); | 9938 session_deps.deterministic_socket_factory->AddSSLSocketDataProvider(&ssl1); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10043 TestCompletionCallback callback2; | 10043 TestCompletionCallback callback2; |
10044 EXPECT_EQ(ERR_IO_PENDING, | 10044 EXPECT_EQ(ERR_IO_PENDING, |
10045 trans2.Start(&request2, callback2.callback(), BoundNetLog())); | 10045 trans2.Start(&request2, callback2.callback(), BoundNetLog())); |
10046 MessageLoop::current()->RunAllPending(); | 10046 MessageLoop::current()->RunAllPending(); |
10047 | 10047 |
10048 EXPECT_EQ(OK, callback2.WaitForResult()); | 10048 EXPECT_EQ(OK, callback2.WaitForResult()); |
10049 EXPECT_TRUE(trans2.GetResponseInfo()->was_fetched_via_spdy); | 10049 EXPECT_TRUE(trans2.GetResponseInfo()->was_fetched_via_spdy); |
10050 } | 10050 } |
10051 | 10051 |
10052 } // namespace net | 10052 } // namespace net |
OLD | NEW |