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/socket/transport_client_socket_pool.h" | 5 #include "net/socket/transport_client_socket_pool.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 | 1273 |
1274 MockClientSocketFactory::ClientSocketType case_types[] = { | 1274 MockClientSocketFactory::ClientSocketType case_types[] = { |
1275 // This is the IPv6 socket. | 1275 // This is the IPv6 socket. |
1276 MockClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET, | 1276 MockClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET, |
1277 // This is the IPv4 socket. | 1277 // This is the IPv4 socket. |
1278 MockClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET | 1278 MockClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET |
1279 }; | 1279 }; |
1280 | 1280 |
1281 client_socket_factory_.set_client_socket_types(case_types, 2); | 1281 client_socket_factory_.set_client_socket_types(case_types, 2); |
1282 client_socket_factory_.set_delay(base::TimeDelta::FromMilliseconds( | 1282 client_socket_factory_.set_delay(base::TimeDelta::FromMilliseconds( |
1283 TransportConnectJob::kIPv6FallbackTimerInMs + 50)); | 1283 TransportConnectJobCommon::kIPv6FallbackTimerInMs + 50)); |
1284 | 1284 |
1285 // Resolve an AddressList with a IPv6 address first and then a IPv4 address. | 1285 // Resolve an AddressList with a IPv6 address first and then a IPv4 address. |
1286 host_resolver_->rules() | 1286 host_resolver_->rules() |
1287 ->AddIPLiteralRule("*", "2:abcd::3:4:ff,2.2.2.2", std::string()); | 1287 ->AddIPLiteralRule("*", "2:abcd::3:4:ff,2.2.2.2", std::string()); |
1288 | 1288 |
1289 TestCompletionCallback callback; | 1289 TestCompletionCallback callback; |
1290 ClientSocketHandle handle; | 1290 ClientSocketHandle handle; |
1291 int rv = handle.Init("a", params_, LOW, callback.callback(), &pool, | 1291 int rv = handle.Init("a", params_, LOW, callback.callback(), &pool, |
1292 BoundNetLog()); | 1292 BoundNetLog()); |
1293 EXPECT_EQ(ERR_IO_PENDING, rv); | 1293 EXPECT_EQ(ERR_IO_PENDING, rv); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1366 EXPECT_TRUE(handle.socket()); | 1366 EXPECT_TRUE(handle.socket()); |
1367 IPEndPoint endpoint; | 1367 IPEndPoint endpoint; |
1368 handle.socket()->GetLocalAddress(&endpoint); | 1368 handle.socket()->GetLocalAddress(&endpoint); |
1369 EXPECT_EQ(kIPv4AddressSize, endpoint.address().size()); | 1369 EXPECT_EQ(kIPv4AddressSize, endpoint.address().size()); |
1370 EXPECT_EQ(1, client_socket_factory_.allocation_count()); | 1370 EXPECT_EQ(1, client_socket_factory_.allocation_count()); |
1371 } | 1371 } |
1372 | 1372 |
1373 } // namespace | 1373 } // namespace |
1374 | 1374 |
1375 } // namespace net | 1375 } // namespace net |
OLD | NEW |