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

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

Issue 1027693004: Delete the ClientSocketPoolHistograms class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: small xml fix Created 5 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/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/threading/platform_thread.h" 11 #include "base/threading/platform_thread.h"
12 #include "net/base/capturing_net_log.h" 12 #include "net/base/capturing_net_log.h"
13 #include "net/base/ip_endpoint.h" 13 #include "net/base/ip_endpoint.h"
14 #include "net/base/load_timing_info.h" 14 #include "net/base/load_timing_info.h"
15 #include "net/base/load_timing_info_test_util.h" 15 #include "net/base/load_timing_info_test_util.h"
16 #include "net/base/net_errors.h" 16 #include "net/base/net_errors.h"
17 #include "net/base/net_util.h" 17 #include "net/base/net_util.h"
18 #include "net/base/test_completion_callback.h" 18 #include "net/base/test_completion_callback.h"
19 #include "net/dns/mock_host_resolver.h" 19 #include "net/dns/mock_host_resolver.h"
20 #include "net/socket/client_socket_handle.h" 20 #include "net/socket/client_socket_handle.h"
21 #include "net/socket/client_socket_pool_histograms.h"
22 #include "net/socket/socket_test_util.h" 21 #include "net/socket/socket_test_util.h"
23 #include "net/socket/stream_socket.h" 22 #include "net/socket/stream_socket.h"
24 #include "net/socket/transport_client_socket_pool_test_util.h" 23 #include "net/socket/transport_client_socket_pool_test_util.h"
25 #include "testing/gtest/include/gtest/gtest.h" 24 #include "testing/gtest/include/gtest/gtest.h"
26 25
27 namespace net { 26 namespace net {
28 27
29 using internal::ClientSocketPoolBaseHelper; 28 using internal::ClientSocketPoolBaseHelper;
30 29
31 namespace { 30 namespace {
32 31
33 const int kMaxSockets = 32; 32 const int kMaxSockets = 32;
34 const int kMaxSocketsPerGroup = 6; 33 const int kMaxSocketsPerGroup = 6;
35 const RequestPriority kDefaultPriority = LOW; 34 const RequestPriority kDefaultPriority = LOW;
36 35
37 class TransportClientSocketPoolTest : public testing::Test { 36 class TransportClientSocketPoolTest : public testing::Test {
38 protected: 37 protected:
39 TransportClientSocketPoolTest() 38 TransportClientSocketPoolTest()
40 : connect_backup_jobs_enabled_( 39 : connect_backup_jobs_enabled_(
41 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(true)), 40 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(true)),
42 params_( 41 params_(
43 new TransportSocketParams( 42 new TransportSocketParams(
44 HostPortPair("www.google.com", 80), 43 HostPortPair("www.google.com", 80),
45 false, 44 false,
46 false, 45 false,
47 OnHostResolutionCallback(), 46 OnHostResolutionCallback(),
48 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DEFAULT)), 47 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DEFAULT)),
49 histograms_(new ClientSocketPoolHistograms("TCPUnitTest")),
50 host_resolver_(new MockHostResolver), 48 host_resolver_(new MockHostResolver),
51 client_socket_factory_(&net_log_), 49 client_socket_factory_(&net_log_),
52 pool_(kMaxSockets, 50 pool_(kMaxSockets,
53 kMaxSocketsPerGroup, 51 kMaxSocketsPerGroup,
54 histograms_.get(),
55 host_resolver_.get(), 52 host_resolver_.get(),
56 &client_socket_factory_, 53 &client_socket_factory_,
57 NULL) { 54 NULL) {
58 } 55 }
59 56
60 ~TransportClientSocketPoolTest() override { 57 ~TransportClientSocketPoolTest() override {
61 internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled( 58 internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(
62 connect_backup_jobs_enabled_); 59 connect_backup_jobs_enabled_);
63 } 60 }
64 61
(...skipping 23 matching lines...) Expand all
88 void ReleaseAllConnections(ClientSocketPoolTest::KeepAlive keep_alive) { 85 void ReleaseAllConnections(ClientSocketPoolTest::KeepAlive keep_alive) {
89 test_base_.ReleaseAllConnections(keep_alive); 86 test_base_.ReleaseAllConnections(keep_alive);
90 } 87 }
91 88
92 ScopedVector<TestSocketRequest>* requests() { return test_base_.requests(); } 89 ScopedVector<TestSocketRequest>* requests() { return test_base_.requests(); }
93 size_t completion_count() const { return test_base_.completion_count(); } 90 size_t completion_count() const { return test_base_.completion_count(); }
94 91
95 bool connect_backup_jobs_enabled_; 92 bool connect_backup_jobs_enabled_;
96 CapturingNetLog net_log_; 93 CapturingNetLog net_log_;
97 scoped_refptr<TransportSocketParams> params_; 94 scoped_refptr<TransportSocketParams> params_;
98 scoped_ptr<ClientSocketPoolHistograms> histograms_;
99 scoped_ptr<MockHostResolver> host_resolver_; 95 scoped_ptr<MockHostResolver> host_resolver_;
100 MockTransportClientSocketFactory client_socket_factory_; 96 MockTransportClientSocketFactory client_socket_factory_;
101 TransportClientSocketPool pool_; 97 TransportClientSocketPool pool_;
102 ClientSocketPoolTest test_base_; 98 ClientSocketPoolTest test_base_;
103 99
104 private: 100 private:
105 DISALLOW_COPY_AND_ASSIGN(TransportClientSocketPoolTest); 101 DISALLOW_COPY_AND_ASSIGN(TransportClientSocketPoolTest);
106 }; 102 };
107 103
108 TEST(TransportConnectJobTest, MakeAddrListStartWithIPv4) { 104 TEST(TransportConnectJobTest, MakeAddrListStartWithIPv4) {
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 host_resolver_->set_synchronous_mode(false); 818 host_resolver_->set_synchronous_mode(false);
823 } 819 }
824 820
825 // Test the case of the IPv6 address stalling, and falling back to the IPv4 821 // Test the case of the IPv6 address stalling, and falling back to the IPv4
826 // socket which finishes first. 822 // socket which finishes first.
827 TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv4FinishesFirst) { 823 TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv4FinishesFirst) {
828 // Create a pool without backup jobs. 824 // Create a pool without backup jobs.
829 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 825 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
830 TransportClientSocketPool pool(kMaxSockets, 826 TransportClientSocketPool pool(kMaxSockets,
831 kMaxSocketsPerGroup, 827 kMaxSocketsPerGroup,
832 histograms_.get(),
833 host_resolver_.get(), 828 host_resolver_.get(),
834 &client_socket_factory_, 829 &client_socket_factory_,
835 NULL); 830 NULL);
836 831
837 MockTransportClientSocketFactory::ClientSocketType case_types[] = { 832 MockTransportClientSocketFactory::ClientSocketType case_types[] = {
838 // This is the IPv6 socket. 833 // This is the IPv6 socket.
839 MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET, 834 MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET,
840 // This is the IPv4 socket. 835 // This is the IPv4 socket.
841 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET 836 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET
842 }; 837 };
(...skipping 22 matching lines...) Expand all
865 } 860 }
866 861
867 // Test the case of the IPv6 address being slow, thus falling back to trying to 862 // Test the case of the IPv6 address being slow, thus falling back to trying to
868 // connect to the IPv4 address, but having the connect to the IPv6 address 863 // connect to the IPv4 address, but having the connect to the IPv6 address
869 // finish first. 864 // finish first.
870 TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv6FinishesFirst) { 865 TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv6FinishesFirst) {
871 // Create a pool without backup jobs. 866 // Create a pool without backup jobs.
872 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 867 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
873 TransportClientSocketPool pool(kMaxSockets, 868 TransportClientSocketPool pool(kMaxSockets,
874 kMaxSocketsPerGroup, 869 kMaxSocketsPerGroup,
875 histograms_.get(),
876 host_resolver_.get(), 870 host_resolver_.get(),
877 &client_socket_factory_, 871 &client_socket_factory_,
878 NULL); 872 NULL);
879 873
880 MockTransportClientSocketFactory::ClientSocketType case_types[] = { 874 MockTransportClientSocketFactory::ClientSocketType case_types[] = {
881 // This is the IPv6 socket. 875 // This is the IPv6 socket.
882 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET, 876 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET,
883 // This is the IPv4 socket. 877 // This is the IPv4 socket.
884 MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET 878 MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET
885 }; 879 };
(...skipping 21 matching lines...) Expand all
907 handle.socket()->GetLocalAddress(&endpoint); 901 handle.socket()->GetLocalAddress(&endpoint);
908 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size()); 902 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size());
909 EXPECT_EQ(2, client_socket_factory_.allocation_count()); 903 EXPECT_EQ(2, client_socket_factory_.allocation_count());
910 } 904 }
911 905
912 TEST_F(TransportClientSocketPoolTest, IPv6NoIPv4AddressesToFallbackTo) { 906 TEST_F(TransportClientSocketPoolTest, IPv6NoIPv4AddressesToFallbackTo) {
913 // Create a pool without backup jobs. 907 // Create a pool without backup jobs.
914 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 908 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
915 TransportClientSocketPool pool(kMaxSockets, 909 TransportClientSocketPool pool(kMaxSockets,
916 kMaxSocketsPerGroup, 910 kMaxSocketsPerGroup,
917 histograms_.get(),
918 host_resolver_.get(), 911 host_resolver_.get(),
919 &client_socket_factory_, 912 &client_socket_factory_,
920 NULL); 913 NULL);
921 914
922 client_socket_factory_.set_default_client_socket_type( 915 client_socket_factory_.set_default_client_socket_type(
923 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); 916 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
924 917
925 // Resolve an AddressList with only IPv6 addresses. 918 // Resolve an AddressList with only IPv6 addresses.
926 host_resolver_->rules() 919 host_resolver_->rules()
927 ->AddIPLiteralRule("*", "2:abcd::3:4:ff,3:abcd::3:4:ff", std::string()); 920 ->AddIPLiteralRule("*", "2:abcd::3:4:ff,3:abcd::3:4:ff", std::string());
(...skipping 13 matching lines...) Expand all
941 handle.socket()->GetLocalAddress(&endpoint); 934 handle.socket()->GetLocalAddress(&endpoint);
942 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size()); 935 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size());
943 EXPECT_EQ(1, client_socket_factory_.allocation_count()); 936 EXPECT_EQ(1, client_socket_factory_.allocation_count());
944 } 937 }
945 938
946 TEST_F(TransportClientSocketPoolTest, IPv4HasNoFallback) { 939 TEST_F(TransportClientSocketPoolTest, IPv4HasNoFallback) {
947 // Create a pool without backup jobs. 940 // Create a pool without backup jobs.
948 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 941 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
949 TransportClientSocketPool pool(kMaxSockets, 942 TransportClientSocketPool pool(kMaxSockets,
950 kMaxSocketsPerGroup, 943 kMaxSocketsPerGroup,
951 histograms_.get(),
952 host_resolver_.get(), 944 host_resolver_.get(),
953 &client_socket_factory_, 945 &client_socket_factory_,
954 NULL); 946 NULL);
955 947
956 client_socket_factory_.set_default_client_socket_type( 948 client_socket_factory_.set_default_client_socket_type(
957 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); 949 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
958 950
959 // Resolve an AddressList with only IPv4 addresses. 951 // Resolve an AddressList with only IPv4 addresses.
960 host_resolver_->rules()->AddIPLiteralRule("*", "1.1.1.1", std::string()); 952 host_resolver_->rules()->AddIPLiteralRule("*", "1.1.1.1", std::string());
961 953
(...skipping 14 matching lines...) Expand all
976 EXPECT_EQ(1, client_socket_factory_.allocation_count()); 968 EXPECT_EQ(1, client_socket_factory_.allocation_count());
977 } 969 }
978 970
979 // Test that if TCP FastOpen is enabled, it is set on the socket 971 // Test that if TCP FastOpen is enabled, it is set on the socket
980 // when we have only an IPv4 address. 972 // when we have only an IPv4 address.
981 TEST_F(TransportClientSocketPoolTest, TCPFastOpenOnIPv4WithNoFallback) { 973 TEST_F(TransportClientSocketPoolTest, TCPFastOpenOnIPv4WithNoFallback) {
982 // Create a pool without backup jobs. 974 // Create a pool without backup jobs.
983 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 975 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
984 TransportClientSocketPool pool(kMaxSockets, 976 TransportClientSocketPool pool(kMaxSockets,
985 kMaxSocketsPerGroup, 977 kMaxSocketsPerGroup,
986 histograms_.get(),
987 host_resolver_.get(), 978 host_resolver_.get(),
988 &client_socket_factory_, 979 &client_socket_factory_,
989 NULL); 980 NULL);
990 client_socket_factory_.set_default_client_socket_type( 981 client_socket_factory_.set_default_client_socket_type(
991 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); 982 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
992 // Resolve an AddressList with only IPv4 addresses. 983 // Resolve an AddressList with only IPv4 addresses.
993 host_resolver_->rules()->AddIPLiteralRule("*", "1.1.1.1", std::string()); 984 host_resolver_->rules()->AddIPLiteralRule("*", "1.1.1.1", std::string());
994 985
995 TestCompletionCallback callback; 986 TestCompletionCallback callback;
996 ClientSocketHandle handle; 987 ClientSocketHandle handle;
997 // Enable TCP FastOpen in TransportSocketParams. 988 // Enable TCP FastOpen in TransportSocketParams.
998 scoped_refptr<TransportSocketParams> params = CreateParamsForTCPFastOpen(); 989 scoped_refptr<TransportSocketParams> params = CreateParamsForTCPFastOpen();
999 handle.Init("a", params, LOW, callback.callback(), &pool, BoundNetLog()); 990 handle.Init("a", params, LOW, callback.callback(), &pool, BoundNetLog());
1000 EXPECT_EQ(OK, callback.WaitForResult()); 991 EXPECT_EQ(OK, callback.WaitForResult());
1001 EXPECT_TRUE(handle.socket()->UsingTCPFastOpen()); 992 EXPECT_TRUE(handle.socket()->UsingTCPFastOpen());
1002 } 993 }
1003 994
1004 // Test that if TCP FastOpen is enabled, it is set on the socket 995 // Test that if TCP FastOpen is enabled, it is set on the socket
1005 // when we have only IPv6 addresses. 996 // when we have only IPv6 addresses.
1006 TEST_F(TransportClientSocketPoolTest, TCPFastOpenOnIPv6WithNoFallback) { 997 TEST_F(TransportClientSocketPoolTest, TCPFastOpenOnIPv6WithNoFallback) {
1007 // Create a pool without backup jobs. 998 // Create a pool without backup jobs.
1008 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 999 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
1009 TransportClientSocketPool pool(kMaxSockets, 1000 TransportClientSocketPool pool(kMaxSockets,
1010 kMaxSocketsPerGroup, 1001 kMaxSocketsPerGroup,
1011 histograms_.get(),
1012 host_resolver_.get(), 1002 host_resolver_.get(),
1013 &client_socket_factory_, 1003 &client_socket_factory_,
1014 NULL); 1004 NULL);
1015 client_socket_factory_.set_default_client_socket_type( 1005 client_socket_factory_.set_default_client_socket_type(
1016 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); 1006 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
1017 // Resolve an AddressList with only IPv6 addresses. 1007 // Resolve an AddressList with only IPv6 addresses.
1018 host_resolver_->rules() 1008 host_resolver_->rules()
1019 ->AddIPLiteralRule("*", "2:abcd::3:4:ff,3:abcd::3:4:ff", std::string()); 1009 ->AddIPLiteralRule("*", "2:abcd::3:4:ff,3:abcd::3:4:ff", std::string());
1020 1010
1021 TestCompletionCallback callback; 1011 TestCompletionCallback callback;
1022 ClientSocketHandle handle; 1012 ClientSocketHandle handle;
1023 // Enable TCP FastOpen in TransportSocketParams. 1013 // Enable TCP FastOpen in TransportSocketParams.
1024 scoped_refptr<TransportSocketParams> params = CreateParamsForTCPFastOpen(); 1014 scoped_refptr<TransportSocketParams> params = CreateParamsForTCPFastOpen();
1025 handle.Init("a", params, LOW, callback.callback(), &pool, BoundNetLog()); 1015 handle.Init("a", params, LOW, callback.callback(), &pool, BoundNetLog());
1026 EXPECT_EQ(OK, callback.WaitForResult()); 1016 EXPECT_EQ(OK, callback.WaitForResult());
1027 EXPECT_TRUE(handle.socket()->UsingTCPFastOpen()); 1017 EXPECT_TRUE(handle.socket()->UsingTCPFastOpen());
1028 } 1018 }
1029 1019
1030 // Test that if TCP FastOpen is enabled, it does not do anything when there 1020 // Test that if TCP FastOpen is enabled, it does not do anything when there
1031 // is a IPv6 address with fallback to an IPv4 address. This test tests the case 1021 // is a IPv6 address with fallback to an IPv4 address. This test tests the case
1032 // when the IPv6 connect fails and the IPv4 one succeeds. 1022 // when the IPv6 connect fails and the IPv4 one succeeds.
1033 TEST_F(TransportClientSocketPoolTest, 1023 TEST_F(TransportClientSocketPoolTest,
1034 NoTCPFastOpenOnIPv6FailureWithIPv4Fallback) { 1024 NoTCPFastOpenOnIPv6FailureWithIPv4Fallback) {
1035 // Create a pool without backup jobs. 1025 // Create a pool without backup jobs.
1036 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 1026 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
1037 TransportClientSocketPool pool(kMaxSockets, 1027 TransportClientSocketPool pool(kMaxSockets,
1038 kMaxSocketsPerGroup, 1028 kMaxSocketsPerGroup,
1039 histograms_.get(),
1040 host_resolver_.get(), 1029 host_resolver_.get(),
1041 &client_socket_factory_, 1030 &client_socket_factory_,
1042 NULL); 1031 NULL);
1043 1032
1044 MockTransportClientSocketFactory::ClientSocketType case_types[] = { 1033 MockTransportClientSocketFactory::ClientSocketType case_types[] = {
1045 // This is the IPv6 socket. 1034 // This is the IPv6 socket.
1046 MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET, 1035 MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET,
1047 // This is the IPv4 socket. 1036 // This is the IPv4 socket.
1048 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET 1037 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET
1049 }; 1038 };
(...skipping 19 matching lines...) Expand all
1069 1058
1070 // Test that if TCP FastOpen is enabled, it does not do anything when there 1059 // Test that if TCP FastOpen is enabled, it does not do anything when there
1071 // is a IPv6 address with fallback to an IPv4 address. This test tests the case 1060 // is a IPv6 address with fallback to an IPv4 address. This test tests the case
1072 // when the IPv6 connect succeeds. 1061 // when the IPv6 connect succeeds.
1073 TEST_F(TransportClientSocketPoolTest, 1062 TEST_F(TransportClientSocketPoolTest,
1074 NoTCPFastOpenOnIPv6SuccessWithIPv4Fallback) { 1063 NoTCPFastOpenOnIPv6SuccessWithIPv4Fallback) {
1075 // Create a pool without backup jobs. 1064 // Create a pool without backup jobs.
1076 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 1065 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
1077 TransportClientSocketPool pool(kMaxSockets, 1066 TransportClientSocketPool pool(kMaxSockets,
1078 kMaxSocketsPerGroup, 1067 kMaxSocketsPerGroup,
1079 histograms_.get(),
1080 host_resolver_.get(), 1068 host_resolver_.get(),
1081 &client_socket_factory_, 1069 &client_socket_factory_,
1082 NULL); 1070 NULL);
1083 1071
1084 MockTransportClientSocketFactory::ClientSocketType case_types[] = { 1072 MockTransportClientSocketFactory::ClientSocketType case_types[] = {
1085 // This is the IPv6 socket. 1073 // This is the IPv6 socket.
1086 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET, 1074 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET,
1087 // This is the IPv4 socket. 1075 // This is the IPv4 socket.
1088 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET 1076 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET
1089 }; 1077 };
(...skipping 13 matching lines...) Expand all
1103 handle.socket()->GetLocalAddress(&endpoint); 1091 handle.socket()->GetLocalAddress(&endpoint);
1104 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size()); 1092 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size());
1105 EXPECT_EQ(1, client_socket_factory_.allocation_count()); 1093 EXPECT_EQ(1, client_socket_factory_.allocation_count());
1106 // Verify that TCP FastOpen was not turned on for the socket. 1094 // Verify that TCP FastOpen was not turned on for the socket.
1107 EXPECT_FALSE(handle.socket()->UsingTCPFastOpen()); 1095 EXPECT_FALSE(handle.socket()->UsingTCPFastOpen());
1108 } 1096 }
1109 1097
1110 } // namespace 1098 } // namespace
1111 1099
1112 } // namespace net 1100 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/transport_client_socket_pool.cc ('k') | net/socket/websocket_transport_client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698