Index: net/socket/client_socket_pool_base_unittest.cc |
=================================================================== |
--- net/socket/client_socket_pool_base_unittest.cc (revision 67848) |
+++ net/socket/client_socket_pool_base_unittest.cc (working copy) |
@@ -620,21 +620,24 @@ |
PlatformThread::Sleep(1); |
EXPECT_EQ(ERR_TIMED_OUT, delegate.WaitForResult()); |
- EXPECT_EQ(6u, log.entries().size()); |
+ net::CapturingNetLog::EntryList entries; |
+ log.GetEntries(&entries); |
+ |
+ EXPECT_EQ(6u, entries.size()); |
EXPECT_TRUE(LogContainsBeginEvent( |
- log.entries(), 0, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB)); |
+ entries, 0, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB)); |
EXPECT_TRUE(LogContainsBeginEvent( |
- log.entries(), 1, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_CONNECT)); |
+ entries, 1, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_CONNECT)); |
EXPECT_TRUE(LogContainsEvent( |
- log.entries(), 2, NetLog::TYPE_CONNECT_JOB_SET_SOCKET, |
+ entries, 2, NetLog::TYPE_CONNECT_JOB_SET_SOCKET, |
NetLog::PHASE_NONE)); |
EXPECT_TRUE(LogContainsEvent( |
- log.entries(), 3, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_TIMED_OUT, |
+ entries, 3, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_TIMED_OUT, |
NetLog::PHASE_NONE)); |
EXPECT_TRUE(LogContainsEndEvent( |
- log.entries(), 4, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_CONNECT)); |
+ entries, 4, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_CONNECT)); |
EXPECT_TRUE(LogContainsEndEvent( |
- log.entries(), 5, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB)); |
+ entries, 5, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB)); |
} |
TEST_F(ClientSocketPoolBaseTest, BasicSynchronous) { |
@@ -655,17 +658,20 @@ |
EXPECT_TRUE(handle.socket()); |
handle.Reset(); |
- EXPECT_EQ(4u, log.entries().size()); |
+ net::CapturingNetLog::EntryList entries; |
+ log.GetEntries(&entries); |
+ |
+ EXPECT_EQ(4u, entries.size()); |
EXPECT_TRUE(LogContainsBeginEvent( |
- log.entries(), 0, NetLog::TYPE_SOCKET_POOL)); |
+ entries, 0, NetLog::TYPE_SOCKET_POOL)); |
EXPECT_TRUE(LogContainsEvent( |
- log.entries(), 1, NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB, |
+ entries, 1, NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB, |
NetLog::PHASE_NONE)); |
EXPECT_TRUE(LogContainsEvent( |
- log.entries(), 2, NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET, |
+ entries, 2, NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET, |
NetLog::PHASE_NONE)); |
EXPECT_TRUE(LogContainsEndEvent( |
- log.entries(), 3, NetLog::TYPE_SOCKET_POOL)); |
+ entries, 3, NetLog::TYPE_SOCKET_POOL)); |
} |
TEST_F(ClientSocketPoolBaseTest, InitConnectionFailure) { |
@@ -692,14 +698,17 @@ |
EXPECT_FALSE(handle.is_ssl_error()); |
EXPECT_TRUE(handle.ssl_error_response_info().headers.get() == NULL); |
- EXPECT_EQ(3u, log.entries().size()); |
+ net::CapturingNetLog::EntryList entries; |
+ log.GetEntries(&entries); |
+ |
+ EXPECT_EQ(3u, entries.size()); |
EXPECT_TRUE(LogContainsBeginEvent( |
- log.entries(), 0, NetLog::TYPE_SOCKET_POOL)); |
+ entries, 0, NetLog::TYPE_SOCKET_POOL)); |
EXPECT_TRUE(LogContainsEvent( |
- log.entries(), 1, NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB, |
+ entries, 1, NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB, |
NetLog::PHASE_NONE)); |
EXPECT_TRUE(LogContainsEndEvent( |
- log.entries(), 2, NetLog::TYPE_SOCKET_POOL)); |
+ entries, 2, NetLog::TYPE_SOCKET_POOL)); |
} |
TEST_F(ClientSocketPoolBaseTest, TotalLimit) { |
@@ -1503,17 +1512,20 @@ |
EXPECT_TRUE(handle.socket()); |
handle.Reset(); |
- EXPECT_EQ(4u, log.entries().size()); |
+ net::CapturingNetLog::EntryList entries; |
+ log.GetEntries(&entries); |
+ |
+ EXPECT_EQ(4u, entries.size()); |
EXPECT_TRUE(LogContainsBeginEvent( |
- log.entries(), 0, NetLog::TYPE_SOCKET_POOL)); |
+ entries, 0, NetLog::TYPE_SOCKET_POOL)); |
EXPECT_TRUE(LogContainsEvent( |
- log.entries(), 1, NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB, |
+ entries, 1, NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB, |
NetLog::PHASE_NONE)); |
EXPECT_TRUE(LogContainsEvent( |
- log.entries(), 2, NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET, |
+ entries, 2, NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET, |
NetLog::PHASE_NONE)); |
EXPECT_TRUE(LogContainsEndEvent( |
- log.entries(), 3, NetLog::TYPE_SOCKET_POOL)); |
+ entries, 3, NetLog::TYPE_SOCKET_POOL)); |
} |
TEST_F(ClientSocketPoolBaseTest, |
@@ -1540,14 +1552,17 @@ |
EXPECT_FALSE(handle.is_ssl_error()); |
EXPECT_TRUE(handle.ssl_error_response_info().headers.get() == NULL); |
- EXPECT_EQ(3u, log.entries().size()); |
+ net::CapturingNetLog::EntryList entries; |
+ log.GetEntries(&entries); |
+ |
+ EXPECT_EQ(3u, entries.size()); |
EXPECT_TRUE(LogContainsBeginEvent( |
- log.entries(), 0, NetLog::TYPE_SOCKET_POOL)); |
+ entries, 0, NetLog::TYPE_SOCKET_POOL)); |
EXPECT_TRUE(LogContainsEvent( |
- log.entries(), 1, NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB, |
+ entries, 1, NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB, |
NetLog::PHASE_NONE)); |
EXPECT_TRUE(LogContainsEndEvent( |
- log.entries(), 2, NetLog::TYPE_SOCKET_POOL)); |
+ entries, 2, NetLog::TYPE_SOCKET_POOL)); |
} |
TEST_F(ClientSocketPoolBaseTest, TwoRequestsCancelOne) { |
@@ -1892,8 +1907,11 @@ |
log.bound()); |
EXPECT_EQ(OK, rv); |
EXPECT_TRUE(handle.is_reused()); |
+ |
+ net::CapturingNetLog::EntryList entries; |
+ log.GetEntries(&entries); |
EXPECT_TRUE(LogContainsEntryWithType( |
- log.entries(), 1, NetLog::TYPE_SOCKET_POOL_REUSED_AN_EXISTING_SOCKET)); |
+ entries, 1, NetLog::TYPE_SOCKET_POOL_REUSED_AN_EXISTING_SOCKET)); |
} |
// Make sure that we process all pending requests even when we're stalling |