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

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

Issue 1992010: Revert 46757 - Fix IO thread hang on releasing a socket.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/socket/client_socket_pool_base_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/tcp_client_socket_pool.h" 5 #include "net/socket/tcp_client_socket_pool.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "net/base/mock_host_resolver.h" 10 #include "net/base/mock_host_resolver.h"
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 // Let the appropriate socket connect. 724 // Let the appropriate socket connect.
725 MessageLoop::current()->RunAllPending(); 725 MessageLoop::current()->RunAllPending();
726 726
727 EXPECT_EQ(OK, callback.WaitForResult()); 727 EXPECT_EQ(OK, callback.WaitForResult());
728 EXPECT_TRUE(handle.is_initialized()); 728 EXPECT_TRUE(handle.is_initialized());
729 EXPECT_TRUE(handle.socket()); 729 EXPECT_TRUE(handle.socket());
730 730
731 // One socket is stalled, the other is active. 731 // One socket is stalled, the other is active.
732 EXPECT_EQ(0, pool_->IdleSocketCount()); 732 EXPECT_EQ(0, pool_->IdleSocketCount());
733 handle.Reset(); 733 handle.Reset();
734
735 pool_ = new TCPClientSocketPool(kMaxSockets,
736 kMaxSocketsPerGroup,
737 "TCPUnitTest",
738 host_resolver_,
739 &client_socket_factory_,
740 NULL);
741 } 734 }
742 } 735 }
743 736
744 // Test the case where a socket took long enough to start the creation 737 // Test the case where a socket took long enough to start the creation
745 // of the backup socket, but then we cancelled the request after that. 738 // of the backup socket, but then we cancelled the request after that.
746 TEST_F(TCPClientSocketPoolTest, BackupSocketCancel) { 739 TEST_F(TCPClientSocketPoolTest, BackupSocketCancel) {
747 client_socket_factory_.set_client_socket_type( 740 client_socket_factory_.set_client_socket_type(
748 MockClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET); 741 MockClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET);
749 742
750 enum { CANCEL_BEFORE_WAIT, CANCEL_AFTER_WAIT }; 743 enum { CANCEL_BEFORE_WAIT, CANCEL_AFTER_WAIT };
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 EXPECT_FALSE(handle.socket()); 862 EXPECT_FALSE(handle.socket());
870 handle.Reset(); 863 handle.Reset();
871 864
872 // Reset for the next case. 865 // Reset for the next case.
873 host_resolver_->set_synchronous_mode(false); 866 host_resolver_->set_synchronous_mode(false);
874 } 867 }
875 868
876 } // namespace 869 } // namespace
877 870
878 } // namespace net 871 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/client_socket_pool_base_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698