Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: net/socket/transport_client_socket_pool_unittest.cc

Issue 1376473003: Notify NQE of TCP RTT values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More plumbing Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/macros.h" 10 #include "base/macros.h"
(...skipping 20 matching lines...) Expand all
31 31
32 const int kMaxSockets = 32; 32 const int kMaxSockets = 32;
33 const int kMaxSocketsPerGroup = 6; 33 const int kMaxSocketsPerGroup = 6;
34 const RequestPriority kDefaultPriority = LOW; 34 const RequestPriority kDefaultPriority = LOW;
35 35
36 class TransportClientSocketPoolTest : public testing::Test { 36 class TransportClientSocketPoolTest : public testing::Test {
37 protected: 37 protected:
38 TransportClientSocketPoolTest() 38 TransportClientSocketPoolTest()
39 : connect_backup_jobs_enabled_( 39 : connect_backup_jobs_enabled_(
40 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(true)), 40 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(true)),
41 params_( 41 params_(new TransportSocketParams(
42 new TransportSocketParams( 42 HostPortPair("www.google.com", 80),
43 HostPortPair("www.google.com", 80), 43 false,
44 false, 44 OnHostResolutionCallback(),
45 OnHostResolutionCallback(), 45 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DEFAULT)),
46 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DEFAULT)),
47 host_resolver_(new MockHostResolver), 46 host_resolver_(new MockHostResolver),
48 client_socket_factory_(&net_log_), 47 client_socket_factory_(&net_log_),
49 pool_(kMaxSockets, 48 pool_(kMaxSockets,
50 kMaxSocketsPerGroup, 49 kMaxSocketsPerGroup,
51 host_resolver_.get(), 50 host_resolver_.get(),
52 &client_socket_factory_, 51 &client_socket_factory_,
53 NULL) { 52 NULL,
54 } 53 NULL) {}
55 54
56 ~TransportClientSocketPoolTest() override { 55 ~TransportClientSocketPoolTest() override {
57 internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled( 56 internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(
58 connect_backup_jobs_enabled_); 57 connect_backup_jobs_enabled_);
59 } 58 }
60 59
61 scoped_refptr<TransportSocketParams> CreateParamsForTCPFastOpen() { 60 scoped_refptr<TransportSocketParams> CreateParamsForTCPFastOpen() {
62 return new TransportSocketParams( 61 return new TransportSocketParams(
63 HostPortPair("www.google.com", 80), false, OnHostResolutionCallback(), 62 HostPortPair("www.google.com", 80), false, OnHostResolutionCallback(),
64 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DESIRED); 63 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DESIRED);
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 848
850 // Reset for the next case. 849 // Reset for the next case.
851 host_resolver_->set_synchronous_mode(false); 850 host_resolver_->set_synchronous_mode(false);
852 } 851 }
853 852
854 // Test the case of the IPv6 address stalling, and falling back to the IPv4 853 // Test the case of the IPv6 address stalling, and falling back to the IPv4
855 // socket which finishes first. 854 // socket which finishes first.
856 TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv4FinishesFirst) { 855 TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv4FinishesFirst) {
857 // Create a pool without backup jobs. 856 // Create a pool without backup jobs.
858 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 857 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
859 TransportClientSocketPool pool(kMaxSockets, 858 TransportClientSocketPool pool(kMaxSockets, kMaxSocketsPerGroup,
860 kMaxSocketsPerGroup, 859 host_resolver_.get(), &client_socket_factory_,
861 host_resolver_.get(), 860 NULL, NULL);
862 &client_socket_factory_,
863 NULL);
864 861
865 MockTransportClientSocketFactory::ClientSocketType case_types[] = { 862 MockTransportClientSocketFactory::ClientSocketType case_types[] = {
866 // This is the IPv6 socket. It stalls, but presents one failed connection 863 // This is the IPv6 socket. It stalls, but presents one failed connection
867 // attempt on GetConnectionAttempts. 864 // attempt on GetConnectionAttempts.
868 MockTransportClientSocketFactory::MOCK_STALLED_FAILING_CLIENT_SOCKET, 865 MockTransportClientSocketFactory::MOCK_STALLED_FAILING_CLIENT_SOCKET,
869 // This is the IPv4 socket. 866 // This is the IPv4 socket.
870 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET}; 867 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET};
871 868
872 client_socket_factory_.set_client_socket_types(case_types, 2); 869 client_socket_factory_.set_client_socket_types(case_types, 2);
873 870
(...skipping 26 matching lines...) Expand all
900 897
901 EXPECT_EQ(2, client_socket_factory_.allocation_count()); 898 EXPECT_EQ(2, client_socket_factory_.allocation_count());
902 } 899 }
903 900
904 // Test the case of the IPv6 address being slow, thus falling back to trying to 901 // Test the case of the IPv6 address being slow, thus falling back to trying to
905 // connect to the IPv4 address, but having the connect to the IPv6 address 902 // connect to the IPv4 address, but having the connect to the IPv6 address
906 // finish first. 903 // finish first.
907 TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv6FinishesFirst) { 904 TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv6FinishesFirst) {
908 // Create a pool without backup jobs. 905 // Create a pool without backup jobs.
909 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 906 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
910 TransportClientSocketPool pool(kMaxSockets, 907 TransportClientSocketPool pool(kMaxSockets, kMaxSocketsPerGroup,
911 kMaxSocketsPerGroup, 908 host_resolver_.get(), &client_socket_factory_,
912 host_resolver_.get(), 909 NULL, NULL);
913 &client_socket_factory_,
914 NULL);
915 910
916 MockTransportClientSocketFactory::ClientSocketType case_types[] = { 911 MockTransportClientSocketFactory::ClientSocketType case_types[] = {
917 // This is the IPv6 socket. 912 // This is the IPv6 socket.
918 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET, 913 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET,
919 // This is the IPv4 socket. It stalls, but presents one failed connection 914 // This is the IPv4 socket. It stalls, but presents one failed connection
920 // attempt on GetConnectionATtempts. 915 // attempt on GetConnectionATtempts.
921 MockTransportClientSocketFactory::MOCK_STALLED_FAILING_CLIENT_SOCKET}; 916 MockTransportClientSocketFactory::MOCK_STALLED_FAILING_CLIENT_SOCKET};
922 917
923 client_socket_factory_.set_client_socket_types(case_types, 2); 918 client_socket_factory_.set_client_socket_types(case_types, 2);
924 client_socket_factory_.set_delay(base::TimeDelta::FromMilliseconds( 919 client_socket_factory_.set_delay(base::TimeDelta::FromMilliseconds(
(...skipping 26 matching lines...) Expand all
951 ASSERT_EQ(1u, attempts.size()); 946 ASSERT_EQ(1u, attempts.size());
952 EXPECT_EQ(ERR_CONNECTION_FAILED, attempts[0].result); 947 EXPECT_EQ(ERR_CONNECTION_FAILED, attempts[0].result);
953 EXPECT_EQ(kIPv4AddressSize, attempts[0].endpoint.address().size()); 948 EXPECT_EQ(kIPv4AddressSize, attempts[0].endpoint.address().size());
954 949
955 EXPECT_EQ(2, client_socket_factory_.allocation_count()); 950 EXPECT_EQ(2, client_socket_factory_.allocation_count());
956 } 951 }
957 952
958 TEST_F(TransportClientSocketPoolTest, IPv6NoIPv4AddressesToFallbackTo) { 953 TEST_F(TransportClientSocketPoolTest, IPv6NoIPv4AddressesToFallbackTo) {
959 // Create a pool without backup jobs. 954 // Create a pool without backup jobs.
960 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 955 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
961 TransportClientSocketPool pool(kMaxSockets, 956 TransportClientSocketPool pool(kMaxSockets, kMaxSocketsPerGroup,
962 kMaxSocketsPerGroup, 957 host_resolver_.get(), &client_socket_factory_,
963 host_resolver_.get(), 958 NULL, NULL);
964 &client_socket_factory_,
965 NULL);
966 959
967 client_socket_factory_.set_default_client_socket_type( 960 client_socket_factory_.set_default_client_socket_type(
968 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); 961 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
969 962
970 // Resolve an AddressList with only IPv6 addresses. 963 // Resolve an AddressList with only IPv6 addresses.
971 host_resolver_->rules() 964 host_resolver_->rules()
972 ->AddIPLiteralRule("*", "2:abcd::3:4:ff,3:abcd::3:4:ff", std::string()); 965 ->AddIPLiteralRule("*", "2:abcd::3:4:ff,3:abcd::3:4:ff", std::string());
973 966
974 TestCompletionCallback callback; 967 TestCompletionCallback callback;
975 ClientSocketHandle handle; 968 ClientSocketHandle handle;
(...skipping 10 matching lines...) Expand all
986 IPEndPoint endpoint; 979 IPEndPoint endpoint;
987 handle.socket()->GetLocalAddress(&endpoint); 980 handle.socket()->GetLocalAddress(&endpoint);
988 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size()); 981 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size());
989 EXPECT_EQ(0u, handle.connection_attempts().size()); 982 EXPECT_EQ(0u, handle.connection_attempts().size());
990 EXPECT_EQ(1, client_socket_factory_.allocation_count()); 983 EXPECT_EQ(1, client_socket_factory_.allocation_count());
991 } 984 }
992 985
993 TEST_F(TransportClientSocketPoolTest, IPv4HasNoFallback) { 986 TEST_F(TransportClientSocketPoolTest, IPv4HasNoFallback) {
994 // Create a pool without backup jobs. 987 // Create a pool without backup jobs.
995 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 988 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
996 TransportClientSocketPool pool(kMaxSockets, 989 TransportClientSocketPool pool(kMaxSockets, kMaxSocketsPerGroup,
997 kMaxSocketsPerGroup, 990 host_resolver_.get(), &client_socket_factory_,
998 host_resolver_.get(), 991 NULL, NULL);
999 &client_socket_factory_,
1000 NULL);
1001 992
1002 client_socket_factory_.set_default_client_socket_type( 993 client_socket_factory_.set_default_client_socket_type(
1003 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); 994 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
1004 995
1005 // Resolve an AddressList with only IPv4 addresses. 996 // Resolve an AddressList with only IPv4 addresses.
1006 host_resolver_->rules()->AddIPLiteralRule("*", "1.1.1.1", std::string()); 997 host_resolver_->rules()->AddIPLiteralRule("*", "1.1.1.1", std::string());
1007 998
1008 TestCompletionCallback callback; 999 TestCompletionCallback callback;
1009 ClientSocketHandle handle; 1000 ClientSocketHandle handle;
1010 int rv = 1001 int rv =
(...skipping 11 matching lines...) Expand all
1022 EXPECT_EQ(kIPv4AddressSize, endpoint.address().size()); 1013 EXPECT_EQ(kIPv4AddressSize, endpoint.address().size());
1023 EXPECT_EQ(0u, handle.connection_attempts().size()); 1014 EXPECT_EQ(0u, handle.connection_attempts().size());
1024 EXPECT_EQ(1, client_socket_factory_.allocation_count()); 1015 EXPECT_EQ(1, client_socket_factory_.allocation_count());
1025 } 1016 }
1026 1017
1027 // Test that if TCP FastOpen is enabled, it is set on the socket 1018 // Test that if TCP FastOpen is enabled, it is set on the socket
1028 // when we have only an IPv4 address. 1019 // when we have only an IPv4 address.
1029 TEST_F(TransportClientSocketPoolTest, TCPFastOpenOnIPv4WithNoFallback) { 1020 TEST_F(TransportClientSocketPoolTest, TCPFastOpenOnIPv4WithNoFallback) {
1030 // Create a pool without backup jobs. 1021 // Create a pool without backup jobs.
1031 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 1022 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
1032 TransportClientSocketPool pool(kMaxSockets, 1023 TransportClientSocketPool pool(kMaxSockets, kMaxSocketsPerGroup,
1033 kMaxSocketsPerGroup, 1024 host_resolver_.get(), &client_socket_factory_,
1034 host_resolver_.get(), 1025 NULL, NULL);
1035 &client_socket_factory_,
1036 NULL);
1037 client_socket_factory_.set_default_client_socket_type( 1026 client_socket_factory_.set_default_client_socket_type(
1038 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); 1027 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
1039 // Resolve an AddressList with only IPv4 addresses. 1028 // Resolve an AddressList with only IPv4 addresses.
1040 host_resolver_->rules()->AddIPLiteralRule("*", "1.1.1.1", std::string()); 1029 host_resolver_->rules()->AddIPLiteralRule("*", "1.1.1.1", std::string());
1041 1030
1042 TestCompletionCallback callback; 1031 TestCompletionCallback callback;
1043 ClientSocketHandle handle; 1032 ClientSocketHandle handle;
1044 // Enable TCP FastOpen in TransportSocketParams. 1033 // Enable TCP FastOpen in TransportSocketParams.
1045 scoped_refptr<TransportSocketParams> params = CreateParamsForTCPFastOpen(); 1034 scoped_refptr<TransportSocketParams> params = CreateParamsForTCPFastOpen();
1046 handle.Init("a", params, LOW, ClientSocketPool::RespectLimits::ENABLED, 1035 handle.Init("a", params, LOW, ClientSocketPool::RespectLimits::ENABLED,
1047 callback.callback(), &pool, BoundNetLog()); 1036 callback.callback(), &pool, BoundNetLog());
1048 EXPECT_EQ(OK, callback.WaitForResult()); 1037 EXPECT_EQ(OK, callback.WaitForResult());
1049 EXPECT_TRUE(handle.socket()->UsingTCPFastOpen()); 1038 EXPECT_TRUE(handle.socket()->UsingTCPFastOpen());
1050 } 1039 }
1051 1040
1052 // Test that if TCP FastOpen is enabled, it is set on the socket 1041 // Test that if TCP FastOpen is enabled, it is set on the socket
1053 // when we have only IPv6 addresses. 1042 // when we have only IPv6 addresses.
1054 TEST_F(TransportClientSocketPoolTest, TCPFastOpenOnIPv6WithNoFallback) { 1043 TEST_F(TransportClientSocketPoolTest, TCPFastOpenOnIPv6WithNoFallback) {
1055 // Create a pool without backup jobs. 1044 // Create a pool without backup jobs.
1056 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 1045 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
1057 TransportClientSocketPool pool(kMaxSockets, 1046 TransportClientSocketPool pool(kMaxSockets, kMaxSocketsPerGroup,
1058 kMaxSocketsPerGroup, 1047 host_resolver_.get(), &client_socket_factory_,
1059 host_resolver_.get(), 1048 NULL, NULL);
1060 &client_socket_factory_,
1061 NULL);
1062 client_socket_factory_.set_default_client_socket_type( 1049 client_socket_factory_.set_default_client_socket_type(
1063 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); 1050 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
1064 // Resolve an AddressList with only IPv6 addresses. 1051 // Resolve an AddressList with only IPv6 addresses.
1065 host_resolver_->rules() 1052 host_resolver_->rules()
1066 ->AddIPLiteralRule("*", "2:abcd::3:4:ff,3:abcd::3:4:ff", std::string()); 1053 ->AddIPLiteralRule("*", "2:abcd::3:4:ff,3:abcd::3:4:ff", std::string());
1067 1054
1068 TestCompletionCallback callback; 1055 TestCompletionCallback callback;
1069 ClientSocketHandle handle; 1056 ClientSocketHandle handle;
1070 // Enable TCP FastOpen in TransportSocketParams. 1057 // Enable TCP FastOpen in TransportSocketParams.
1071 scoped_refptr<TransportSocketParams> params = CreateParamsForTCPFastOpen(); 1058 scoped_refptr<TransportSocketParams> params = CreateParamsForTCPFastOpen();
1072 handle.Init("a", params, LOW, ClientSocketPool::RespectLimits::ENABLED, 1059 handle.Init("a", params, LOW, ClientSocketPool::RespectLimits::ENABLED,
1073 callback.callback(), &pool, BoundNetLog()); 1060 callback.callback(), &pool, BoundNetLog());
1074 EXPECT_EQ(OK, callback.WaitForResult()); 1061 EXPECT_EQ(OK, callback.WaitForResult());
1075 EXPECT_TRUE(handle.socket()->UsingTCPFastOpen()); 1062 EXPECT_TRUE(handle.socket()->UsingTCPFastOpen());
1076 } 1063 }
1077 1064
1078 // Test that if TCP FastOpen is enabled, it does not do anything when there 1065 // Test that if TCP FastOpen is enabled, it does not do anything when there
1079 // is a IPv6 address with fallback to an IPv4 address. This test tests the case 1066 // is a IPv6 address with fallback to an IPv4 address. This test tests the case
1080 // when the IPv6 connect fails and the IPv4 one succeeds. 1067 // when the IPv6 connect fails and the IPv4 one succeeds.
1081 TEST_F(TransportClientSocketPoolTest, 1068 TEST_F(TransportClientSocketPoolTest,
1082 NoTCPFastOpenOnIPv6FailureWithIPv4Fallback) { 1069 NoTCPFastOpenOnIPv6FailureWithIPv4Fallback) {
1083 // Create a pool without backup jobs. 1070 // Create a pool without backup jobs.
1084 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 1071 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
1085 TransportClientSocketPool pool(kMaxSockets, 1072 TransportClientSocketPool pool(kMaxSockets, kMaxSocketsPerGroup,
1086 kMaxSocketsPerGroup, 1073 host_resolver_.get(), &client_socket_factory_,
1087 host_resolver_.get(), 1074 NULL, NULL);
1088 &client_socket_factory_,
1089 NULL);
1090 1075
1091 MockTransportClientSocketFactory::ClientSocketType case_types[] = { 1076 MockTransportClientSocketFactory::ClientSocketType case_types[] = {
1092 // This is the IPv6 socket. 1077 // This is the IPv6 socket.
1093 MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET, 1078 MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET,
1094 // This is the IPv4 socket. 1079 // This is the IPv4 socket.
1095 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET 1080 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET
1096 }; 1081 };
1097 client_socket_factory_.set_client_socket_types(case_types, 2); 1082 client_socket_factory_.set_client_socket_types(case_types, 2);
1098 // Resolve an AddressList with a IPv6 address first and then a IPv4 address. 1083 // Resolve an AddressList with a IPv6 address first and then a IPv4 address.
1099 host_resolver_->rules() 1084 host_resolver_->rules()
(...skipping 15 matching lines...) Expand all
1115 EXPECT_FALSE(handle.socket()->UsingTCPFastOpen()); 1100 EXPECT_FALSE(handle.socket()->UsingTCPFastOpen());
1116 } 1101 }
1117 1102
1118 // Test that if TCP FastOpen is enabled, it does not do anything when there 1103 // Test that if TCP FastOpen is enabled, it does not do anything when there
1119 // is a IPv6 address with fallback to an IPv4 address. This test tests the case 1104 // is a IPv6 address with fallback to an IPv4 address. This test tests the case
1120 // when the IPv6 connect succeeds. 1105 // when the IPv6 connect succeeds.
1121 TEST_F(TransportClientSocketPoolTest, 1106 TEST_F(TransportClientSocketPoolTest,
1122 NoTCPFastOpenOnIPv6SuccessWithIPv4Fallback) { 1107 NoTCPFastOpenOnIPv6SuccessWithIPv4Fallback) {
1123 // Create a pool without backup jobs. 1108 // Create a pool without backup jobs.
1124 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 1109 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
1125 TransportClientSocketPool pool(kMaxSockets, 1110 TransportClientSocketPool pool(kMaxSockets, kMaxSocketsPerGroup,
1126 kMaxSocketsPerGroup, 1111 host_resolver_.get(), &client_socket_factory_,
1127 host_resolver_.get(), 1112 NULL, NULL);
1128 &client_socket_factory_,
1129 NULL);
1130 1113
1131 MockTransportClientSocketFactory::ClientSocketType case_types[] = { 1114 MockTransportClientSocketFactory::ClientSocketType case_types[] = {
1132 // This is the IPv6 socket. 1115 // This is the IPv6 socket.
1133 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET, 1116 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET,
1134 // This is the IPv4 socket. 1117 // This is the IPv4 socket.
1135 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET 1118 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET
1136 }; 1119 };
1137 client_socket_factory_.set_client_socket_types(case_types, 2); 1120 client_socket_factory_.set_client_socket_types(case_types, 2);
1138 // Resolve an AddressList with a IPv6 address first and then a IPv4 address. 1121 // Resolve an AddressList with a IPv6 address first and then a IPv4 address.
1139 host_resolver_->rules() 1122 host_resolver_->rules()
(...skipping 11 matching lines...) Expand all
1151 handle.socket()->GetLocalAddress(&endpoint); 1134 handle.socket()->GetLocalAddress(&endpoint);
1152 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size()); 1135 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size());
1153 EXPECT_EQ(1, client_socket_factory_.allocation_count()); 1136 EXPECT_EQ(1, client_socket_factory_.allocation_count());
1154 // Verify that TCP FastOpen was not turned on for the socket. 1137 // Verify that TCP FastOpen was not turned on for the socket.
1155 EXPECT_FALSE(handle.socket()->UsingTCPFastOpen()); 1138 EXPECT_FALSE(handle.socket()->UsingTCPFastOpen());
1156 } 1139 }
1157 1140
1158 } // namespace 1141 } // namespace
1159 1142
1160 } // namespace net 1143 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698