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 9227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9238 // MockClientSocket::GetPeerAddress but that returns 192.0.2.33 whereas | 9238 // MockClientSocket::GetPeerAddress but that returns 192.0.2.33 whereas |
9239 // MockHostResolver returns 127.0.0.1 (MockHostResolverBase::Reset). So we use | 9239 // MockHostResolver returns 127.0.0.1 (MockHostResolverBase::Reset). So we use |
9240 // the first address (127.0.0.1) returned by MockHostResolver as an alias for | 9240 // the first address (127.0.0.1) returned by MockHostResolver as an alias for |
9241 // the |pair|. | 9241 // the |pair|. |
9242 const addrinfo* address = addresses.head(); | 9242 const addrinfo* address = addresses.head(); |
9243 pool_peer->AddAlias(address, pair); | 9243 pool_peer->AddAlias(address, pair); |
9244 } | 9244 } |
9245 | 9245 |
9246 } // namespace | 9246 } // namespace |
9247 | 9247 |
9248 TEST_F(HttpNetworkTransactionSpdy2Test, UseIPConnectionPooling) { | 9248 TEST_F(HttpNetworkTransactionSpdy2Test, FLAKY_UseIPConnectionPooling) { |
9249 HttpStreamFactory::set_use_alternate_protocols(true); | 9249 HttpStreamFactory::set_use_alternate_protocols(true); |
9250 HttpStreamFactory::SetNextProtos(SpdyNextProtos()); | 9250 HttpStreamFactory::SetNextProtos(SpdyNextProtos()); |
9251 | 9251 |
9252 // Set up a special HttpNetworkSession with a MockCachingHostResolver. | 9252 // Set up a special HttpNetworkSession with a MockCachingHostResolver. |
9253 SessionDependencies session_deps; | 9253 SessionDependencies session_deps; |
9254 MockCachingHostResolver host_resolver; | 9254 MockCachingHostResolver host_resolver; |
9255 net::HttpNetworkSession::Params params; | 9255 net::HttpNetworkSession::Params params; |
9256 params.client_socket_factory = &session_deps.socket_factory; | 9256 params.client_socket_factory = &session_deps.socket_factory; |
9257 params.host_resolver = &host_resolver; | 9257 params.host_resolver = &host_resolver; |
9258 params.cert_verifier = session_deps.cert_verifier.get(); | 9258 params.cert_verifier = session_deps.cert_verifier.get(); |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9546 StaticSocketDataProvider* data[] = { &data1, &data2 }; | 9546 StaticSocketDataProvider* data[] = { &data1, &data2 }; |
9547 | 9547 |
9548 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); | 9548 SimpleGetHelperResult out = SimpleGetHelperForData(data, arraysize(data)); |
9549 | 9549 |
9550 EXPECT_EQ(OK, out.rv); | 9550 EXPECT_EQ(OK, out.rv); |
9551 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); | 9551 EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); |
9552 EXPECT_EQ("hello world", out.response_data); | 9552 EXPECT_EQ("hello world", out.response_data); |
9553 } | 9553 } |
9554 | 9554 |
9555 } // namespace net | 9555 } // namespace net |
OLD | NEW |