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

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

Issue 1716007: Cleanup: Address some of the todos in net_log.h... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address willchan's comments 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.cc ('k') | net/socket/socks5_client_socket.cc » ('j') | 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/client_socket_pool_base.h" 5 #include "net/socket/client_socket_pool_base.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 "base/platform_thread.h" 10 #include "base/platform_thread.h"
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 1389
1390 // Invoke the idle socket cleanup check. Only one socket should be left, the 1390 // Invoke the idle socket cleanup check. Only one socket should be left, the
1391 // used socket. Request it to make sure that it's used. 1391 // used socket. Request it to make sure that it's used.
1392 1392
1393 pool_->CleanupTimedOutIdleSockets(); 1393 pool_->CleanupTimedOutIdleSockets();
1394 CapturingBoundNetLog log(CapturingNetLog::kUnbounded); 1394 CapturingBoundNetLog log(CapturingNetLog::kUnbounded);
1395 rv = InitHandle(req.handle(), "a", LOWEST, &req, pool_, log.bound()); 1395 rv = InitHandle(req.handle(), "a", LOWEST, &req, pool_, log.bound());
1396 EXPECT_EQ(OK, rv); 1396 EXPECT_EQ(OK, rv);
1397 EXPECT_TRUE(req.handle()->is_reused()); 1397 EXPECT_TRUE(req.handle()->is_reused());
1398 EXPECT_TRUE(LogContainsEntryWithType( 1398 EXPECT_TRUE(LogContainsEntryWithType(
1399 log.entries(), 1, NetLog::TYPE_TODO_STRING_LITERAL)); 1399 log.entries(), 1, NetLog::TYPE_SOCKET_POOL_REUSED_AN_EXISTING_SOCKET));
1400 } 1400 }
1401 1401
1402 // Make sure that we process all pending requests even when we're stalling 1402 // Make sure that we process all pending requests even when we're stalling
1403 // because of multiple releasing disconnected sockets. 1403 // because of multiple releasing disconnected sockets.
1404 TEST_F(ClientSocketPoolBaseTest, MultipleReleasingDisconnectedSockets) { 1404 TEST_F(ClientSocketPoolBaseTest, MultipleReleasingDisconnectedSockets) {
1405 CreatePoolWithIdleTimeouts( 1405 CreatePoolWithIdleTimeouts(
1406 kDefaultMaxSockets, kDefaultMaxSocketsPerGroup, 1406 kDefaultMaxSockets, kDefaultMaxSocketsPerGroup,
1407 base::TimeDelta(), // Time out unused sockets immediately. 1407 base::TimeDelta(), // Time out unused sockets immediately.
1408 base::TimeDelta::FromDays(1)); // Don't time out used sockets. 1408 base::TimeDelta::FromDays(1)); // Don't time out used sockets.
1409 1409
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 TestReleasingSocketRequest request(pool_.get()); 1519 TestReleasingSocketRequest request(pool_.get());
1520 EXPECT_EQ(ERR_IO_PENDING, InitHandle(request.handle(), "a", kDefaultPriority, 1520 EXPECT_EQ(ERR_IO_PENDING, InitHandle(request.handle(), "a", kDefaultPriority,
1521 &request, pool_, NULL)); 1521 &request, pool_, NULL));
1522 1522
1523 EXPECT_EQ(OK, request.WaitForResult()); 1523 EXPECT_EQ(OK, request.WaitForResult());
1524 } 1524 }
1525 1525
1526 } // namespace 1526 } // namespace
1527 1527
1528 } // namespace net 1528 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/client_socket_pool_base.cc ('k') | net/socket/socks5_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698