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

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

Powered by Google App Engine
This is Rietveld 408576698