OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/spdy/spdy_network_transaction.h" | 5 #include "net/spdy/spdy_network_transaction.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 scoped_refptr<SpdySessionPool> spdy_session_pool; | 80 scoped_refptr<SpdySessionPool> spdy_session_pool; |
81 }; | 81 }; |
82 | 82 |
83 HttpNetworkSession* CreateSession(SessionDependencies* session_deps) { | 83 HttpNetworkSession* CreateSession(SessionDependencies* session_deps) { |
84 return new HttpNetworkSession(NULL, | 84 return new HttpNetworkSession(NULL, |
85 session_deps->host_resolver, | 85 session_deps->host_resolver, |
86 session_deps->proxy_service, | 86 session_deps->proxy_service, |
87 &session_deps->socket_factory, | 87 &session_deps->socket_factory, |
88 session_deps->ssl_config_service, | 88 session_deps->ssl_config_service, |
89 session_deps->spdy_session_pool, | 89 session_deps->spdy_session_pool, |
90 session_deps->http_auth_handler_factory.get()); | 90 session_deps->http_auth_handler_factory.get(), |
| 91 NULL); |
91 } | 92 } |
92 | 93 |
93 // Chop a frame into an array of MockWrites. | 94 // Chop a frame into an array of MockWrites. |
94 // |data| is the frame to chop. | 95 // |data| is the frame to chop. |
95 // |length| is the length of the frame to chop. | 96 // |length| is the length of the frame to chop. |
96 // |num_chunks| is the number of chunks to create. | 97 // |num_chunks| is the number of chunks to create. |
97 MockWrite* ChopFrame(const char* data, int length, int num_chunks) { | 98 MockWrite* ChopFrame(const char* data, int length, int num_chunks) { |
98 MockWrite* chunks = new MockWrite[num_chunks]; | 99 MockWrite* chunks = new MockWrite[num_chunks]; |
99 int chunk_size = length / num_chunks; | 100 int chunk_size = length / num_chunks; |
100 for (int index = 0; index < num_chunks; index++) { | 101 for (int index = 0; index < num_chunks; index++) { |
(...skipping 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2449 EXPECT_TRUE(response->was_fetched_via_spdy); | 2450 EXPECT_TRUE(response->was_fetched_via_spdy); |
2450 out.rv = ReadTransaction(trans.get(), &out.response_data); | 2451 out.rv = ReadTransaction(trans.get(), &out.response_data); |
2451 EXPECT_EQ(ERR_CONNECTION_CLOSED, out.rv); | 2452 EXPECT_EQ(ERR_CONNECTION_CLOSED, out.rv); |
2452 | 2453 |
2453 // Verify that we consumed all test data. | 2454 // Verify that we consumed all test data. |
2454 EXPECT_TRUE(data->at_read_eof()); | 2455 EXPECT_TRUE(data->at_read_eof()); |
2455 EXPECT_TRUE(data->at_write_eof()); | 2456 EXPECT_TRUE(data->at_write_eof()); |
2456 } | 2457 } |
2457 | 2458 |
2458 } // namespace net | 2459 } // namespace net |
OLD | NEW |