| 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 9223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9234 BoundNetLog()); | 9234 BoundNetLog()); |
| 9235 if (rv == ERR_IO_PENDING) | 9235 if (rv == ERR_IO_PENDING) |
| 9236 rv = callback.WaitForResult(); | 9236 rv = callback.WaitForResult(); |
| 9237 DCHECK_EQ(OK, rv); | 9237 DCHECK_EQ(OK, rv); |
| 9238 | 9238 |
| 9239 // Add the first address as an alias. It would have been better to call | 9239 // Add the first address as an alias. It would have been better to call |
| 9240 // MockClientSocket::GetPeerAddress but that returns 192.0.2.33 whereas | 9240 // MockClientSocket::GetPeerAddress but that returns 192.0.2.33 whereas |
| 9241 // MockHostResolver returns 127.0.0.1 (MockHostResolverBase::Reset). So we use | 9241 // MockHostResolver returns 127.0.0.1 (MockHostResolverBase::Reset). So we use |
| 9242 // the first address (127.0.0.1) returned by MockHostResolver as an alias for | 9242 // the first address (127.0.0.1) returned by MockHostResolver as an alias for |
| 9243 // the |pair|. | 9243 // the |pair|. |
| 9244 const addrinfo* address = addresses.head(); | 9244 pool_peer->AddAlias(addresses.front(), pair); |
| 9245 pool_peer->AddAlias(address, pair); | |
| 9246 } | 9245 } |
| 9247 | 9246 |
| 9248 } // namespace | 9247 } // namespace |
| 9249 | 9248 |
| 9250 TEST_F(HttpNetworkTransactionSpdy3Test, UseIPConnectionPooling) { | 9249 TEST_F(HttpNetworkTransactionSpdy3Test, UseIPConnectionPooling) { |
| 9251 HttpStreamFactory::set_use_alternate_protocols(true); | 9250 HttpStreamFactory::set_use_alternate_protocols(true); |
| 9252 HttpStreamFactory::SetNextProtos(SpdyNextProtos()); | 9251 HttpStreamFactory::SetNextProtos(SpdyNextProtos()); |
| 9253 | 9252 |
| 9254 // Set up a special HttpNetworkSession with a MockCachingHostResolver. | 9253 // Set up a special HttpNetworkSession with a MockCachingHostResolver. |
| 9255 SessionDependencies session_deps; | 9254 SessionDependencies session_deps; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9548 StaticSocketDataProvider* data[] = { &data1, &data2 }; | 9547 StaticSocketDataProvider* data[] = { &data1, &data2 }; |
| 9549 | 9548 |
| 9550 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); | 9549 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); |
| 9551 | 9550 |
| 9552 EXPECT_EQ(OK, out.rv); | 9551 EXPECT_EQ(OK, out.rv); |
| 9553 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); | 9552 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); |
| 9554 EXPECT_EQ("hello world", out.response_data); | 9553 EXPECT_EQ("hello world", out.response_data); |
| 9555 } | 9554 } |
| 9556 | 9555 |
| 9557 } // namespace net | 9556 } // namespace net |
| OLD | NEW |