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

Unified Diff: net/socket/tcp_client_socket_pool_unittest.cc

Issue 149027: Limit total number of sockets in the system.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: reorder Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/tcp_client_socket_pool.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_client_socket_pool_unittest.cc
diff --git a/net/socket/tcp_client_socket_pool_unittest.cc b/net/socket/tcp_client_socket_pool_unittest.cc
index d81137deff0820adc48e27041e9ac78dbd1af5a0..a31afccdef191585c177ad87d8a66071ce79cb22 100644
--- a/net/socket/tcp_client_socket_pool_unittest.cc
+++ b/net/socket/tcp_client_socket_pool_unittest.cc
@@ -18,6 +18,7 @@ namespace net {
namespace {
+const int kMaxSockets = 32;
const int kMaxSocketsPerGroup = 6;
// Note that the first and the last are the same, the first should be handled
@@ -225,7 +226,8 @@ class TCPClientSocketPoolTest : public testing::Test {
protected:
TCPClientSocketPoolTest()
: host_resolver_(new MockHostResolver),
- pool_(new TCPClientSocketPool(kMaxSocketsPerGroup,
+ pool_(new TCPClientSocketPool(kMaxSockets,
+ kMaxSocketsPerGroup,
host_resolver_,
&client_socket_factory_)) {
}
@@ -618,6 +620,7 @@ TEST_F(TCPClientSocketPoolTest, FailingActiveRequestWithPendingRequests) {
MockClientSocketFactory::MOCK_PENDING_FAILING_CLIENT_SOCKET);
scoped_ptr<TestSocketRequest> reqs[kMaxSocketsPerGroup * 2 + 1];
+ ASSERT_LE(static_cast<int>(arraysize(reqs)), kMaxSockets);
// Queue up all the requests
« no previous file with comments | « net/socket/tcp_client_socket_pool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698