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

Side by Side Diff: net/socket/websocket_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/websocket_transport_client_socket_pool.h" 5 #include "net/socket/websocket_transport_client_socket_pool.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
15 #include "base/run_loop.h" 15 #include "base/run_loop.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "base/time/time.h" 17 #include "base/time/time.h"
18 #include "net/base/capturing_net_log.h" 18 #include "net/base/capturing_net_log.h"
19 #include "net/base/ip_endpoint.h" 19 #include "net/base/ip_endpoint.h"
20 #include "net/base/load_timing_info.h" 20 #include "net/base/load_timing_info.h"
21 #include "net/base/load_timing_info_test_util.h" 21 #include "net/base/load_timing_info_test_util.h"
22 #include "net/base/net_errors.h" 22 #include "net/base/net_errors.h"
23 #include "net/base/net_util.h" 23 #include "net/base/net_util.h"
24 #include "net/base/test_completion_callback.h" 24 #include "net/base/test_completion_callback.h"
25 #include "net/dns/mock_host_resolver.h" 25 #include "net/dns/mock_host_resolver.h"
26 #include "net/socket/client_socket_handle.h" 26 #include "net/socket/client_socket_handle.h"
27 #include "net/socket/client_socket_pool_histograms.h"
28 #include "net/socket/socket_test_util.h" 27 #include "net/socket/socket_test_util.h"
29 #include "net/socket/stream_socket.h" 28 #include "net/socket/stream_socket.h"
30 #include "net/socket/transport_client_socket_pool_test_util.h" 29 #include "net/socket/transport_client_socket_pool_test_util.h"
31 #include "net/socket/websocket_endpoint_lock_manager.h" 30 #include "net/socket/websocket_endpoint_lock_manager.h"
32 #include "testing/gtest/include/gtest/gtest.h" 31 #include "testing/gtest/include/gtest/gtest.h"
33 32
34 namespace net { 33 namespace net {
35 34
36 namespace { 35 namespace {
37 36
(...skipping 12 matching lines...) Expand all
50 49
51 class WebSocketTransportClientSocketPoolTest : public ::testing::Test { 50 class WebSocketTransportClientSocketPoolTest : public ::testing::Test {
52 protected: 51 protected:
53 WebSocketTransportClientSocketPoolTest() 52 WebSocketTransportClientSocketPoolTest()
54 : params_(new TransportSocketParams( 53 : params_(new TransportSocketParams(
55 HostPortPair("www.google.com", 80), 54 HostPortPair("www.google.com", 80),
56 false, 55 false,
57 false, 56 false,
58 OnHostResolutionCallback(), 57 OnHostResolutionCallback(),
59 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DEFAULT)), 58 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DEFAULT)),
60 histograms_(new ClientSocketPoolHistograms("TCPUnitTest")),
61 host_resolver_(new MockHostResolver), 59 host_resolver_(new MockHostResolver),
62 client_socket_factory_(&net_log_), 60 client_socket_factory_(&net_log_),
63 pool_(kMaxSockets, 61 pool_(kMaxSockets,
64 kMaxSocketsPerGroup, 62 kMaxSocketsPerGroup,
65 histograms_.get(),
66 host_resolver_.get(), 63 host_resolver_.get(),
67 &client_socket_factory_, 64 &client_socket_factory_,
68 NULL) {} 65 NULL) {}
69 66
70 ~WebSocketTransportClientSocketPoolTest() override { 67 ~WebSocketTransportClientSocketPoolTest() override {
71 RunUntilIdle(); 68 RunUntilIdle();
72 // ReleaseAllConnections() calls RunUntilIdle() after releasing each 69 // ReleaseAllConnections() calls RunUntilIdle() after releasing each
73 // connection. 70 // connection.
74 ReleaseAllConnections(ClientSocketPoolTest::NO_KEEP_ALIVE); 71 ReleaseAllConnections(ClientSocketPoolTest::NO_KEEP_ALIVE);
75 EXPECT_TRUE(WebSocketEndpointLockManager::GetInstance()->IsEmpty()); 72 EXPECT_TRUE(WebSocketEndpointLockManager::GetInstance()->IsEmpty());
(...skipping 25 matching lines...) Expand all
101 test_base_.ReleaseAllConnections(keep_alive); 98 test_base_.ReleaseAllConnections(keep_alive);
102 } 99 }
103 100
104 TestSocketRequest* request(int i) { return test_base_.request(i); } 101 TestSocketRequest* request(int i) { return test_base_.request(i); }
105 102
106 ScopedVector<TestSocketRequest>* requests() { return test_base_.requests(); } 103 ScopedVector<TestSocketRequest>* requests() { return test_base_.requests(); }
107 size_t completion_count() const { return test_base_.completion_count(); } 104 size_t completion_count() const { return test_base_.completion_count(); }
108 105
109 CapturingNetLog net_log_; 106 CapturingNetLog net_log_;
110 scoped_refptr<TransportSocketParams> params_; 107 scoped_refptr<TransportSocketParams> params_;
111 scoped_ptr<ClientSocketPoolHistograms> histograms_;
112 scoped_ptr<MockHostResolver> host_resolver_; 108 scoped_ptr<MockHostResolver> host_resolver_;
113 MockTransportClientSocketFactory client_socket_factory_; 109 MockTransportClientSocketFactory client_socket_factory_;
114 WebSocketTransportClientSocketPool pool_; 110 WebSocketTransportClientSocketPool pool_;
115 ClientSocketPoolTest test_base_; 111 ClientSocketPoolTest test_base_;
116 ScopedWebSocketEndpointZeroUnlockDelay zero_unlock_delay_; 112 ScopedWebSocketEndpointZeroUnlockDelay zero_unlock_delay_;
117 113
118 private: 114 private:
119 DISALLOW_COPY_AND_ASSIGN(WebSocketTransportClientSocketPoolTest); 115 DISALLOW_COPY_AND_ASSIGN(WebSocketTransportClientSocketPoolTest);
120 }; 116 };
121 117
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 pool_.CancelRequest("a", request(0)->handle()); 554 pool_.CancelRequest("a", request(0)->handle());
559 EXPECT_EQ(OK, request(1)->WaitForResult()); 555 EXPECT_EQ(OK, request(1)->WaitForResult());
560 } 556 }
561 557
562 // Test the case of the IPv6 address stalling, and falling back to the IPv4 558 // Test the case of the IPv6 address stalling, and falling back to the IPv4
563 // socket which finishes first. 559 // socket which finishes first.
564 TEST_F(WebSocketTransportClientSocketPoolTest, 560 TEST_F(WebSocketTransportClientSocketPoolTest,
565 IPv6FallbackSocketIPv4FinishesFirst) { 561 IPv6FallbackSocketIPv4FinishesFirst) {
566 WebSocketTransportClientSocketPool pool(kMaxSockets, 562 WebSocketTransportClientSocketPool pool(kMaxSockets,
567 kMaxSocketsPerGroup, 563 kMaxSocketsPerGroup,
568 histograms_.get(),
569 host_resolver_.get(), 564 host_resolver_.get(),
570 &client_socket_factory_, 565 &client_socket_factory_,
571 NULL); 566 NULL);
572 567
573 MockTransportClientSocketFactory::ClientSocketType case_types[] = { 568 MockTransportClientSocketFactory::ClientSocketType case_types[] = {
574 // This is the IPv6 socket. 569 // This is the IPv6 socket.
575 MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET, 570 MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET,
576 // This is the IPv4 socket. 571 // This is the IPv4 socket.
577 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET}; 572 MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET};
578 573
(...skipping 20 matching lines...) Expand all
599 EXPECT_EQ(2, client_socket_factory_.allocation_count()); 594 EXPECT_EQ(2, client_socket_factory_.allocation_count());
600 } 595 }
601 596
602 // Test the case of the IPv6 address being slow, thus falling back to trying to 597 // Test the case of the IPv6 address being slow, thus falling back to trying to
603 // connect to the IPv4 address, but having the connect to the IPv6 address 598 // connect to the IPv4 address, but having the connect to the IPv6 address
604 // finish first. 599 // finish first.
605 TEST_F(WebSocketTransportClientSocketPoolTest, 600 TEST_F(WebSocketTransportClientSocketPoolTest,
606 IPv6FallbackSocketIPv6FinishesFirst) { 601 IPv6FallbackSocketIPv6FinishesFirst) {
607 WebSocketTransportClientSocketPool pool(kMaxSockets, 602 WebSocketTransportClientSocketPool pool(kMaxSockets,
608 kMaxSocketsPerGroup, 603 kMaxSocketsPerGroup,
609 histograms_.get(),
610 host_resolver_.get(), 604 host_resolver_.get(),
611 &client_socket_factory_, 605 &client_socket_factory_,
612 NULL); 606 NULL);
613 607
614 MockTransportClientSocketFactory::ClientSocketType case_types[] = { 608 MockTransportClientSocketFactory::ClientSocketType case_types[] = {
615 // This is the IPv6 socket. 609 // This is the IPv6 socket.
616 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET, 610 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET,
617 // This is the IPv4 socket. 611 // This is the IPv4 socket.
618 MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET}; 612 MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET};
619 613
(...skipping 19 matching lines...) Expand all
639 IPEndPoint endpoint; 633 IPEndPoint endpoint;
640 handle.socket()->GetLocalAddress(&endpoint); 634 handle.socket()->GetLocalAddress(&endpoint);
641 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size()); 635 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size());
642 EXPECT_EQ(2, client_socket_factory_.allocation_count()); 636 EXPECT_EQ(2, client_socket_factory_.allocation_count());
643 } 637 }
644 638
645 TEST_F(WebSocketTransportClientSocketPoolTest, 639 TEST_F(WebSocketTransportClientSocketPoolTest,
646 IPv6NoIPv4AddressesToFallbackTo) { 640 IPv6NoIPv4AddressesToFallbackTo) {
647 WebSocketTransportClientSocketPool pool(kMaxSockets, 641 WebSocketTransportClientSocketPool pool(kMaxSockets,
648 kMaxSocketsPerGroup, 642 kMaxSocketsPerGroup,
649 histograms_.get(),
650 host_resolver_.get(), 643 host_resolver_.get(),
651 &client_socket_factory_, 644 &client_socket_factory_,
652 NULL); 645 NULL);
653 646
654 client_socket_factory_.set_default_client_socket_type( 647 client_socket_factory_.set_default_client_socket_type(
655 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); 648 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
656 649
657 // Resolve an AddressList with only IPv6 addresses. 650 // Resolve an AddressList with only IPv6 addresses.
658 host_resolver_->rules()->AddIPLiteralRule( 651 host_resolver_->rules()->AddIPLiteralRule(
659 "*", "2:abcd::3:4:ff,3:abcd::3:4:ff", std::string()); 652 "*", "2:abcd::3:4:ff,3:abcd::3:4:ff", std::string());
(...skipping 11 matching lines...) Expand all
671 EXPECT_TRUE(handle.socket()); 664 EXPECT_TRUE(handle.socket());
672 IPEndPoint endpoint; 665 IPEndPoint endpoint;
673 handle.socket()->GetLocalAddress(&endpoint); 666 handle.socket()->GetLocalAddress(&endpoint);
674 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size()); 667 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size());
675 EXPECT_EQ(1, client_socket_factory_.allocation_count()); 668 EXPECT_EQ(1, client_socket_factory_.allocation_count());
676 } 669 }
677 670
678 TEST_F(WebSocketTransportClientSocketPoolTest, IPv4HasNoFallback) { 671 TEST_F(WebSocketTransportClientSocketPoolTest, IPv4HasNoFallback) {
679 WebSocketTransportClientSocketPool pool(kMaxSockets, 672 WebSocketTransportClientSocketPool pool(kMaxSockets,
680 kMaxSocketsPerGroup, 673 kMaxSocketsPerGroup,
681 histograms_.get(),
682 host_resolver_.get(), 674 host_resolver_.get(),
683 &client_socket_factory_, 675 &client_socket_factory_,
684 NULL); 676 NULL);
685 677
686 client_socket_factory_.set_default_client_socket_type( 678 client_socket_factory_.set_default_client_socket_type(
687 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); 679 MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET);
688 680
689 // Resolve an AddressList with only IPv4 addresses. 681 // Resolve an AddressList with only IPv4 addresses.
690 host_resolver_->rules()->AddIPLiteralRule("*", "1.1.1.1", std::string()); 682 host_resolver_->rules()->AddIPLiteralRule("*", "1.1.1.1", std::string());
691 683
(...skipping 12 matching lines...) Expand all
704 handle.socket()->GetLocalAddress(&endpoint); 696 handle.socket()->GetLocalAddress(&endpoint);
705 EXPECT_EQ(kIPv4AddressSize, endpoint.address().size()); 697 EXPECT_EQ(kIPv4AddressSize, endpoint.address().size());
706 EXPECT_EQ(1, client_socket_factory_.allocation_count()); 698 EXPECT_EQ(1, client_socket_factory_.allocation_count());
707 } 699 }
708 700
709 // If all IPv6 addresses fail to connect synchronously, then IPv4 connections 701 // If all IPv6 addresses fail to connect synchronously, then IPv4 connections
710 // proceeed immediately. 702 // proceeed immediately.
711 TEST_F(WebSocketTransportClientSocketPoolTest, IPv6InstantFail) { 703 TEST_F(WebSocketTransportClientSocketPoolTest, IPv6InstantFail) {
712 WebSocketTransportClientSocketPool pool(kMaxSockets, 704 WebSocketTransportClientSocketPool pool(kMaxSockets,
713 kMaxSocketsPerGroup, 705 kMaxSocketsPerGroup,
714 histograms_.get(),
715 host_resolver_.get(), 706 host_resolver_.get(),
716 &client_socket_factory_, 707 &client_socket_factory_,
717 NULL); 708 NULL);
718 709
719 MockTransportClientSocketFactory::ClientSocketType case_types[] = { 710 MockTransportClientSocketFactory::ClientSocketType case_types[] = {
720 // First IPv6 socket. 711 // First IPv6 socket.
721 MockTransportClientSocketFactory::MOCK_FAILING_CLIENT_SOCKET, 712 MockTransportClientSocketFactory::MOCK_FAILING_CLIENT_SOCKET,
722 // Second IPv6 socket. 713 // Second IPv6 socket.
723 MockTransportClientSocketFactory::MOCK_FAILING_CLIENT_SOCKET, 714 MockTransportClientSocketFactory::MOCK_FAILING_CLIENT_SOCKET,
724 // This is the IPv4 socket. 715 // This is the IPv4 socket.
(...skipping 16 matching lines...) Expand all
741 IPEndPoint endpoint; 732 IPEndPoint endpoint;
742 handle.socket()->GetPeerAddress(&endpoint); 733 handle.socket()->GetPeerAddress(&endpoint);
743 EXPECT_EQ("2.2.2.2", endpoint.ToStringWithoutPort()); 734 EXPECT_EQ("2.2.2.2", endpoint.ToStringWithoutPort());
744 } 735 }
745 736
746 // If all IPv6 addresses fail before the IPv4 fallback timeout, then the IPv4 737 // If all IPv6 addresses fail before the IPv4 fallback timeout, then the IPv4
747 // connections proceed immediately. 738 // connections proceed immediately.
748 TEST_F(WebSocketTransportClientSocketPoolTest, IPv6RapidFail) { 739 TEST_F(WebSocketTransportClientSocketPoolTest, IPv6RapidFail) {
749 WebSocketTransportClientSocketPool pool(kMaxSockets, 740 WebSocketTransportClientSocketPool pool(kMaxSockets,
750 kMaxSocketsPerGroup, 741 kMaxSocketsPerGroup,
751 histograms_.get(),
752 host_resolver_.get(), 742 host_resolver_.get(),
753 &client_socket_factory_, 743 &client_socket_factory_,
754 NULL); 744 NULL);
755 745
756 MockTransportClientSocketFactory::ClientSocketType case_types[] = { 746 MockTransportClientSocketFactory::ClientSocketType case_types[] = {
757 // First IPv6 socket. 747 // First IPv6 socket.
758 MockTransportClientSocketFactory::MOCK_PENDING_FAILING_CLIENT_SOCKET, 748 MockTransportClientSocketFactory::MOCK_PENDING_FAILING_CLIENT_SOCKET,
759 // Second IPv6 socket. 749 // Second IPv6 socket.
760 MockTransportClientSocketFactory::MOCK_PENDING_FAILING_CLIENT_SOCKET, 750 MockTransportClientSocketFactory::MOCK_PENDING_FAILING_CLIENT_SOCKET,
761 // This is the IPv4 socket. 751 // This is the IPv4 socket.
(...skipping 24 matching lines...) Expand all
786 handle.socket()->GetPeerAddress(&endpoint); 776 handle.socket()->GetPeerAddress(&endpoint);
787 EXPECT_EQ("2.2.2.2", endpoint.ToStringWithoutPort()); 777 EXPECT_EQ("2.2.2.2", endpoint.ToStringWithoutPort());
788 } 778 }
789 779
790 // If two sockets connect successfully, the one which connected first wins (this 780 // If two sockets connect successfully, the one which connected first wins (this
791 // can only happen if the sockets are different types, since sockets of the same 781 // can only happen if the sockets are different types, since sockets of the same
792 // type do not race). 782 // type do not race).
793 TEST_F(WebSocketTransportClientSocketPoolTest, FirstSuccessWins) { 783 TEST_F(WebSocketTransportClientSocketPoolTest, FirstSuccessWins) {
794 WebSocketTransportClientSocketPool pool(kMaxSockets, 784 WebSocketTransportClientSocketPool pool(kMaxSockets,
795 kMaxSocketsPerGroup, 785 kMaxSocketsPerGroup,
796 histograms_.get(),
797 host_resolver_.get(), 786 host_resolver_.get(),
798 &client_socket_factory_, 787 &client_socket_factory_,
799 NULL); 788 NULL);
800 789
801 client_socket_factory_.set_default_client_socket_type( 790 client_socket_factory_.set_default_client_socket_type(
802 MockTransportClientSocketFactory::MOCK_TRIGGERABLE_CLIENT_SOCKET); 791 MockTransportClientSocketFactory::MOCK_TRIGGERABLE_CLIENT_SOCKET);
803 792
804 // Resolve an AddressList with an IPv6 addresses and an IPv4 address. 793 // Resolve an AddressList with an IPv6 addresses and an IPv4 address.
805 host_resolver_->rules()->AddIPLiteralRule( 794 host_resolver_->rules()->AddIPLiteralRule(
806 "*", "2:abcd::3:4:ff,2.2.2.2", std::string()); 795 "*", "2:abcd::3:4:ff,2.2.2.2", std::string());
(...skipping 18 matching lines...) Expand all
825 814
826 IPEndPoint endpoint; 815 IPEndPoint endpoint;
827 handle.socket()->GetPeerAddress(&endpoint); 816 handle.socket()->GetPeerAddress(&endpoint);
828 EXPECT_EQ("2.2.2.2", endpoint.ToStringWithoutPort()); 817 EXPECT_EQ("2.2.2.2", endpoint.ToStringWithoutPort());
829 } 818 }
830 819
831 // We should not report failure until all connections have failed. 820 // We should not report failure until all connections have failed.
832 TEST_F(WebSocketTransportClientSocketPoolTest, LastFailureWins) { 821 TEST_F(WebSocketTransportClientSocketPoolTest, LastFailureWins) {
833 WebSocketTransportClientSocketPool pool(kMaxSockets, 822 WebSocketTransportClientSocketPool pool(kMaxSockets,
834 kMaxSocketsPerGroup, 823 kMaxSocketsPerGroup,
835 histograms_.get(),
836 host_resolver_.get(), 824 host_resolver_.get(),
837 &client_socket_factory_, 825 &client_socket_factory_,
838 NULL); 826 NULL);
839 827
840 client_socket_factory_.set_default_client_socket_type( 828 client_socket_factory_.set_default_client_socket_type(
841 MockTransportClientSocketFactory::MOCK_DELAYED_FAILING_CLIENT_SOCKET); 829 MockTransportClientSocketFactory::MOCK_DELAYED_FAILING_CLIENT_SOCKET);
842 base::TimeDelta delay = base::TimeDelta::FromMilliseconds( 830 base::TimeDelta delay = base::TimeDelta::FromMilliseconds(
843 TransportConnectJobHelper::kIPv6FallbackTimerInMs / 3); 831 TransportConnectJobHelper::kIPv6FallbackTimerInMs / 3);
844 client_socket_factory_.set_delay(delay); 832 client_socket_factory_.set_delay(delay);
845 833
(...skipping 22 matching lines...) Expand all
868 856
869 EXPECT_GE(base::TimeTicks::Now() - start, delay * 5); 857 EXPECT_GE(base::TimeTicks::Now() - start, delay * 5);
870 } 858 }
871 859
872 // Global timeout for all connects applies. This test is disabled by default 860 // Global timeout for all connects applies. This test is disabled by default
873 // because it takes 4 minutes. Run with --gtest_also_run_disabled_tests if you 861 // because it takes 4 minutes. Run with --gtest_also_run_disabled_tests if you
874 // want to run it. 862 // want to run it.
875 TEST_F(WebSocketTransportClientSocketPoolTest, DISABLED_OverallTimeoutApplies) { 863 TEST_F(WebSocketTransportClientSocketPoolTest, DISABLED_OverallTimeoutApplies) {
876 WebSocketTransportClientSocketPool pool(kMaxSockets, 864 WebSocketTransportClientSocketPool pool(kMaxSockets,
877 kMaxSocketsPerGroup, 865 kMaxSocketsPerGroup,
878 histograms_.get(),
879 host_resolver_.get(), 866 host_resolver_.get(),
880 &client_socket_factory_, 867 &client_socket_factory_,
881 NULL); 868 NULL);
882 const base::TimeDelta connect_job_timeout = pool.ConnectionTimeout(); 869 const base::TimeDelta connect_job_timeout = pool.ConnectionTimeout();
883 870
884 client_socket_factory_.set_default_client_socket_type( 871 client_socket_factory_.set_default_client_socket_type(
885 MockTransportClientSocketFactory::MOCK_DELAYED_FAILING_CLIENT_SOCKET); 872 MockTransportClientSocketFactory::MOCK_DELAYED_FAILING_CLIENT_SOCKET);
886 client_socket_factory_.set_delay(base::TimeDelta::FromSeconds(1) + 873 client_socket_factory_.set_delay(base::TimeDelta::FromSeconds(1) +
887 connect_job_timeout / 6); 874 connect_job_timeout / 6);
888 875
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 EXPECT_EQ(OK, request(1)->WaitForResult()); 1132 EXPECT_EQ(OK, request(1)->WaitForResult());
1146 // Third socket should still be waiting for endpoint. 1133 // Third socket should still be waiting for endpoint.
1147 ASSERT_FALSE(request(2)->handle()->is_initialized()); 1134 ASSERT_FALSE(request(2)->handle()->is_initialized());
1148 EXPECT_EQ(LOAD_STATE_WAITING_FOR_AVAILABLE_SOCKET, 1135 EXPECT_EQ(LOAD_STATE_WAITING_FOR_AVAILABLE_SOCKET,
1149 request(2)->handle()->GetLoadState()); 1136 request(2)->handle()->GetLoadState());
1150 } 1137 }
1151 1138
1152 } // namespace 1139 } // namespace
1153 1140
1154 } // namespace net 1141 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/websocket_transport_client_socket_pool.cc ('k') | net/websockets/websocket_basic_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698