diff options
author | vishal.b <vishal.b@samsung.com> | 2015-04-17 01:45:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-17 08:46:07 +0000 |
commit | 62985ca964bae26730280620d01a606eeff1d226 (patch) | |
tree | 52f6c9ad2f7b20990796d14687a5d0b79780baf7 /net | |
parent | 817cf387dbb2b63fb8c00f0f9b1535a152d88b62 (diff) | |
download | chromium_src-62985ca964bae26730280620d01a606eeff1d226.zip chromium_src-62985ca964bae26730280620d01a606eeff1d226.tar.gz chromium_src-62985ca964bae26730280620d01a606eeff1d226.tar.bz2 |
Rename NetLogLogger and CapturingNetLog
Renaming two classes
CapturingNetLog --> TestNetLog
NetLogLogger --> WriteToFileNetLogObserver
BUG=473252
TBR=jam,mmenke
Review URL: https://codereview.chromium.org/1084533002
Cr-Commit-Position: refs/heads/master@{#325611}
Diffstat (limited to 'net')
40 files changed, 383 insertions, 382 deletions
diff --git a/net/BUILD.gn b/net/BUILD.gn index cb20fce..4a0e7d9 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn @@ -645,10 +645,10 @@ source_set("test_support") { "http/http_transaction_test_util.h", "log/captured_net_log_entry.cc", "log/captured_net_log_entry.h", - "log/capturing_net_log.cc", - "log/capturing_net_log.h", "log/capturing_net_log_observer.cc", "log/capturing_net_log_observer.h", + "log/test_net_log.cc", + "log/test_net_log.h", "proxy/mock_proxy_resolver.cc", "proxy/mock_proxy_resolver.h", "proxy/mock_proxy_script_fetcher.cc", diff --git a/net/base/file_stream_unittest.cc b/net/base/file_stream_unittest.cc index cf5ed41..1e6e6db 100644 --- a/net/base/file_stream_unittest.cc +++ b/net/base/file_stream_unittest.cc @@ -20,7 +20,7 @@ #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/base/test_completion_callback.h" -#include "net/log/capturing_net_log.h" +#include "net/log/test_net_log.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" diff --git a/net/cert/multi_log_ct_verifier_unittest.cc b/net/cert/multi_log_ct_verifier_unittest.cc index 06c07a8..9e1ea4d 100644 --- a/net/cert/multi_log_ct_verifier_unittest.cc +++ b/net/cert/multi_log_ct_verifier_unittest.cc @@ -21,8 +21,8 @@ #include "net/cert/sct_status_flags.h" #include "net/cert/signed_certificate_timestamp.h" #include "net/cert/x509_certificate.h" -#include "net/log/capturing_net_log.h" #include "net/log/net_log.h" +#include "net/log/test_net_log.h" #include "net/test/cert_test_util.h" #include "net/test/ct_test_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -71,20 +71,20 @@ class MultiLogCTVerifierTest : public ::testing::Test { (result.verified_scts[0]->origin == origin); } - bool CheckForEmbeddedSCTInNetLog(CapturingNetLog& net_log) { - CapturingNetLog::CapturedEntryList entries; + bool CheckForEmbeddedSCTInNetLog(TestNetLog& net_log) { + TestNetLog::CapturedEntryList entries; net_log.GetEntries(&entries); if (entries.size() != 2) return false; - const CapturingNetLog::CapturedEntry& received = entries[0]; + const TestNetLog::CapturedEntry& received = entries[0]; std::string embedded_scts; if (!received.GetStringValue("embedded_scts", &embedded_scts)) return false; if (embedded_scts.empty()) return false; - const CapturingNetLog::CapturedEntry& parsed = entries[1]; + const TestNetLog::CapturedEntry& parsed = entries[1]; base::ListValue* verified_scts; if (!parsed.GetListValue("verified_scts", &verified_scts) || verified_scts->GetSize() != 1) { @@ -139,7 +139,7 @@ class MultiLogCTVerifierTest : public ::testing::Test { bool VerifySinglePrecertificateChain(scoped_refptr<X509Certificate> chain) { ct::CTVerifyResult result; - CapturingNetLog net_log; + TestNetLog net_log; BoundNetLog bound_net_log = BoundNetLog::Make(&net_log, NetLog::SOURCE_CONNECT_JOB); @@ -152,7 +152,7 @@ class MultiLogCTVerifierTest : public ::testing::Test { bool CheckPrecertificateVerification(scoped_refptr<X509Certificate> chain) { ct::CTVerifyResult result; - CapturingNetLog net_log; + TestNetLog net_log; BoundNetLog bound_net_log = BoundNetLog::Make(&net_log, NetLog::SOURCE_CONNECT_JOB); return (VerifySinglePrecertificateChain(chain, bound_net_log, &result) && diff --git a/net/http/http_auth_handler_unittest.cc b/net/http/http_auth_handler_unittest.cc index 9f4a0a8..335bec3a 100644 --- a/net/http/http_auth_handler_unittest.cc +++ b/net/http/http_auth_handler_unittest.cc @@ -11,8 +11,8 @@ #include "net/http/http_auth_challenge_tokenizer.h" #include "net/http/http_auth_handler_mock.h" #include "net/http/http_request_info.h" -#include "net/log/capturing_net_log.h" #include "net/log/net_log_unittest.h" +#include "net/log/test_net_log.h" #include "testing/gtest/include/gtest/gtest.h" namespace net { @@ -38,7 +38,7 @@ TEST(HttpAuthHandlerTest, NetLog) { HttpAuthChallengeTokenizer tokenizer( challenge.begin(), challenge.end()); HttpAuthHandlerMock mock_handler; - CapturingNetLog capturing_net_log; + TestNetLog capturing_net_log; BoundNetLog bound_net_log(BoundNetLog::Make(&capturing_net_log, net::NetLog::SOURCE_NONE)); @@ -50,7 +50,7 @@ TEST(HttpAuthHandlerTest, NetLog) { if (async) test_callback.WaitForResult(); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; capturing_net_log.GetEntries(&entries); EXPECT_EQ(2u, entries.size()); diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc index d629016..b64ebbf 100644 --- a/net/http/http_cache_unittest.cc +++ b/net/http/http_cache_unittest.cc @@ -534,7 +534,7 @@ class FakeWebSocketHandshakeStreamCreateHelper // Returns true if |entry| is not one of the log types paid attention to in this // test. Note that TYPE_HTTP_CACHE_WRITE_INFO and TYPE_HTTP_CACHE_*_DATA are // ignored. -bool ShouldIgnoreLogEntry(const net::CapturingNetLog::CapturedEntry& entry) { +bool ShouldIgnoreLogEntry(const net::TestNetLog::CapturedEntry& entry) { switch (entry.type) { case net::NetLog::TYPE_HTTP_CACHE_GET_BACKEND: case net::NetLog::TYPE_HTTP_CACHE_OPEN_ENTRY: @@ -550,15 +550,15 @@ bool ShouldIgnoreLogEntry(const net::CapturingNetLog::CapturedEntry& entry) { // Modifies |entries| to only include log entries created by the cache layer and // asserted on in these tests. -void FilterLogEntries(net::CapturingNetLog::CapturedEntryList* entries) { +void FilterLogEntries(net::TestNetLog::CapturedEntryList* entries) { entries->erase(std::remove_if(entries->begin(), entries->end(), &ShouldIgnoreLogEntry), entries->end()); } -bool LogContainsEventType(const net::CapturingBoundNetLog& log, +bool LogContainsEventType(const net::BoundTestNetLog& log, net::NetLog::EventType expected) { - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); for (size_t i = 0; i < entries.size(); i++) { if (entries[i].type == expected) @@ -593,7 +593,7 @@ TEST(HttpCache, GetBackend) { TEST(HttpCache, SimpleGET) { MockHttpCache cache; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; // Write to the cache. @@ -611,7 +611,7 @@ TEST(HttpCache, SimpleGETNoDiskCache) { cache.disk_cache()->set_fail_requests(); - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; // Read from the network, and don't use the cache. @@ -620,7 +620,7 @@ TEST(HttpCache, SimpleGETNoDiskCache) { // Check that the NetLog was filled as expected. // (We attempted to both Open and Create entries, but both failed). - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); FilterLogEntries(&entries); @@ -777,7 +777,7 @@ TEST(HttpCache, SimpleGETWithDiskFailures3) { TEST(HttpCache, SimpleGET_LoadOnlyFromCache_Hit) { MockHttpCache cache; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; // Write to the cache. @@ -785,7 +785,7 @@ TEST(HttpCache, SimpleGET_LoadOnlyFromCache_Hit) { log.bound(), &load_timing_info); // Check that the NetLog was filled as expected. - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); FilterLogEntries(&entries); @@ -940,7 +940,7 @@ TEST(HttpCache, SimpleGET_LoadPreferringCache_VaryMismatch) { // the network again. transaction.load_flags |= net::LOAD_PREFERRING_CACHE; transaction.request_headers = "Foo: none\r\n"; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; RunTransactionTestAndGetTiming(cache.http_cache(), transaction, log.bound(), &load_timing_info); @@ -1135,7 +1135,7 @@ TEST(HttpCache, SimpleGET_LoadBypassCache) { MockTransaction transaction(kSimpleGET_Transaction); transaction.load_flags |= net::LOAD_BYPASS_CACHE; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; // Write to the cache. @@ -1143,7 +1143,7 @@ TEST(HttpCache, SimpleGET_LoadBypassCache) { &load_timing_info); // Check that the NetLog was filled as expected. - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); FilterLogEntries(&entries); @@ -1219,7 +1219,7 @@ TEST(HttpCache, SimpleGET_LoadValidateCache) { transaction.load_flags |= net::LOAD_VALIDATE_CACHE; net::HttpResponseInfo response_info; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; RunTransactionTestWithResponseInfoAndGetTiming( cache.http_cache(), transaction, &response_info, log.bound(), @@ -2012,7 +2012,7 @@ TEST(HttpCache, TypicalGET_ConditionalRequest) { // Get the same URL again, but this time we expect it to result // in a conditional request. - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; RunTransactionTestAndGetTiming(cache.http_cache(), kTypicalGET_Transaction, log.bound(), &load_timing_info); @@ -2051,7 +2051,7 @@ TEST(HttpCache, ETagGET_ConditionalRequest_304) { // in a conditional request. transaction.load_flags = net::LOAD_VALIDATE_CACHE; transaction.handler = ETagGet_ConditionalRequest_Handler; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; RunTransactionTestAndGetTiming(cache.http_cache(), transaction, log.bound(), &load_timing_info); @@ -2126,7 +2126,7 @@ TEST(HttpCache, GET_ValidateCache_VaryMatch) { // Read from the cache. RevalidationServer server; transaction.handler = server.Handler; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; RunTransactionTestAndGetTiming(cache.http_cache(), transaction, log.bound(), &load_timing_info); @@ -2160,7 +2160,7 @@ TEST(HttpCache, GET_ValidateCache_VaryMismatch) { RevalidationServer server; transaction.handler = server.Handler; transaction.request_headers = "Foo: none\r\n"; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; RunTransactionTestAndGetTiming(cache.http_cache(), transaction, log.bound(), &load_timing_info); @@ -2193,7 +2193,7 @@ TEST(HttpCache, GET_DontValidateCache_VaryMismatch) { RevalidationServer server; transaction.handler = server.Handler; transaction.request_headers = "Foo: none\r\n"; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; RunTransactionTestAndGetTiming(cache.http_cache(), transaction, log.bound(), &load_timing_info); @@ -3811,7 +3811,7 @@ TEST(HttpCache, RangeGET_SkipsCache2) { TEST(HttpCache, SimpleGET_DoesntLogHeaders) { MockHttpCache cache; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; RunTransactionTestWithLog(cache.http_cache(), kSimpleGET_Transaction, log.bound()); @@ -3822,7 +3822,7 @@ TEST(HttpCache, SimpleGET_DoesntLogHeaders) { TEST(HttpCache, RangeGET_LogsHeaders) { MockHttpCache cache; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; RunTransactionTestWithLog(cache.http_cache(), kRangeGET_Transaction, log.bound()); @@ -3833,7 +3833,7 @@ TEST(HttpCache, RangeGET_LogsHeaders) { TEST(HttpCache, ExternalValidation_LogsHeaders) { MockHttpCache cache; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; MockTransaction transaction(kSimpleGET_Transaction); transaction.request_headers = "If-None-Match: foo\r\n" EXTRA_HEADER; RunTransactionTestWithLog(cache.http_cache(), transaction, log.bound()); @@ -3845,7 +3845,7 @@ TEST(HttpCache, ExternalValidation_LogsHeaders) { TEST(HttpCache, SpecialHeaders_LogsHeaders) { MockHttpCache cache; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; MockTransaction transaction(kSimpleGET_Transaction); transaction.request_headers = "cache-control: no-cache\r\n" EXTRA_HEADER; RunTransactionTestWithLog(cache.http_cache(), transaction, log.bound()); @@ -3962,7 +3962,7 @@ TEST(HttpCache, RangeGET_NoValidation_LogsRestart) { RunTransactionTest(cache.http_cache(), transaction); // Now verify that the cached data is not used. - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; RunTransactionTestWithLog(cache.http_cache(), kRangeGET_TransactionOK, log.bound()); @@ -4124,7 +4124,7 @@ TEST(HttpCache, RangeGET_OK) { // Write and read from the cache (20-59). transaction.request_headers = "Range: bytes = 20-59\r\n" EXTRA_HEADER; transaction.data = "rg: 20-29 rg: 30-39 rg: 40-49 rg: 50-59 "; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; RunTransactionTestWithResponseAndGetTiming( cache.http_cache(), transaction, &headers, log.bound(), @@ -4184,7 +4184,7 @@ TEST(HttpCache, RangeGET_SyncOK) { // Write and read from the cache (20-59). transaction.request_headers = "Range: bytes = 20-59\r\n" EXTRA_HEADER; transaction.data = "rg: 20-29 rg: 30-39 rg: 40-49 rg: 50-59 "; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; RunTransactionTestWithResponseAndGetTiming( cache.http_cache(), transaction, &headers, log.bound(), @@ -4221,7 +4221,7 @@ TEST(HttpCache, RangeGET_Revalidate1) { EXPECT_EQ(1, cache.disk_cache()->create_count()); // Read from the cache (40-49). - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; RunTransactionTestWithResponseAndGetTiming( cache.http_cache(), transaction, &headers, log.bound(), @@ -4720,7 +4720,7 @@ TEST(HttpCache, GET_Previous206) { MockHttpCache cache; AddMockTransaction(&kRangeGET_TransactionOK); std::string headers; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; // Write to the cache (40-49). @@ -4759,7 +4759,7 @@ TEST(HttpCache, GET_Previous206_NotModified) { MockTransaction transaction(kRangeGET_TransactionOK); AddMockTransaction(&transaction); std::string headers; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; // Write to the cache (0-9). @@ -4829,7 +4829,7 @@ TEST(HttpCache, GET_Previous206_NewContent) { transaction2.data = "Not a range"; RangeTransactionServer handler; handler.set_modified(true); - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; RunTransactionTestWithResponseAndGetTiming( cache.http_cache(), transaction2, &headers, log.bound(), @@ -4877,7 +4877,7 @@ TEST(HttpCache, GET_Previous206_NotSparse) { // Now see that we don't use the stored entry. std::string headers; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; net::LoadTimingInfo load_timing_info; RunTransactionTestWithResponseAndGetTiming( cache.http_cache(), kSimpleGET_Transaction, &headers, log.bound(), @@ -5445,7 +5445,7 @@ TEST(HttpCache, RangeGET_FastFlakyServer) { RangeTransactionServer handler; handler.set_bad_200(true); transaction.data = "Not a range"; - net::CapturingBoundNetLog log; + net::BoundTestNetLog log; RunTransactionTestWithLog(cache.http_cache(), transaction, log.bound()); EXPECT_EQ(3, cache.network_layer()->transaction_count()); diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 6c59954..eb81161 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -50,9 +50,9 @@ #include "net/http/http_stream_factory.h" #include "net/http/http_stream_parser.h" #include "net/http/http_transaction_test_util.h" -#include "net/log/capturing_net_log.h" #include "net/log/net_log.h" #include "net/log/net_log_unittest.h" +#include "net/log/test_net_log.h" #include "net/proxy/mock_proxy_resolver.h" #include "net/proxy/proxy_config_service_fixed.h" #include "net/proxy/proxy_info.h" @@ -317,7 +317,7 @@ class HttpNetworkTransactionTest request.url = GURL("http://www.google.com/"); request.load_flags = 0; - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( @@ -358,7 +358,7 @@ class HttpNetworkTransactionTest rv = ReadTransaction(trans.get(), &out.response_data); EXPECT_EQ(OK, rv); - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); size_t pos = ExpectLogContainsSomewhere( entries, 0, NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_HEADERS, @@ -1273,7 +1273,7 @@ void HttpNetworkTransactionTest::KeepAliveConnectionResendRequestTest( request.url = GURL("http://www.foo.com/"); request.load_flags = 0; - CapturingNetLog net_log; + TestNetLog net_log; session_deps_.net_log = &net_log; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -1363,7 +1363,7 @@ void HttpNetworkTransactionTest::PreconnectErrorResendRequestTest( request.url = GURL("https://www.foo.com/"); request.load_flags = 0; - CapturingNetLog net_log; + TestNetLog net_log; session_deps_.net_log = &net_log; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -1777,7 +1777,7 @@ TEST_P(HttpNetworkTransactionTest, KeepAliveAfterUnreadBody) { request.url = GURL("http://www.foo.com/"); request.load_flags = 0; - CapturingNetLog net_log; + TestNetLog net_log; session_deps_.net_log = &net_log; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -1886,7 +1886,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuth) { request.url = GURL("http://www.google.com/"); request.load_flags = 0; - CapturingNetLog log; + TestNetLog log; session_deps_.net_log = &log; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( @@ -2033,7 +2033,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAlive) { request.url = GURL("http://www.google.com/"); request.load_flags = 0; - CapturingNetLog log; + TestNetLog log; session_deps_.net_log = &log; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -2383,7 +2383,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAliveHttp10) { // Configure against proxy server "myproxy:70". session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("PROXY myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -2439,7 +2439,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAliveHttp10) { rv = callback1.WaitForResult(); EXPECT_EQ(OK, rv); - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); size_t pos = ExpectLogContainsSomewhere( entries, 0, NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, @@ -2501,7 +2501,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAliveHttp11) { // Configure against proxy server "myproxy:70". session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("PROXY myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -2555,7 +2555,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAliveHttp11) { rv = callback1.WaitForResult(); EXPECT_EQ(OK, rv); - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); size_t pos = ExpectLogContainsSomewhere( entries, 0, NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, @@ -2618,7 +2618,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHttp10) { // Configure against proxy server "myproxy:70". session_deps_.proxy_service.reset(ProxyService::CreateFixed("myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -2671,7 +2671,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHttp10) { rv = callback1.WaitForResult(); EXPECT_EQ(OK, rv); - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); size_t pos = ExpectLogContainsSomewhere( entries, 0, NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, @@ -2725,7 +2725,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHttp11) { // Configure against proxy server "myproxy:70". session_deps_.proxy_service.reset(ProxyService::CreateFixed("myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -2774,7 +2774,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHttp11) { rv = callback1.WaitForResult(); EXPECT_EQ(OK, rv); - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); size_t pos = ExpectLogContainsSomewhere( entries, 0, NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, @@ -2993,7 +2993,7 @@ TEST_P(HttpNetworkTransactionTest, request.url = GURL("https://www.google.com/"); session_deps_.proxy_service.reset(ProxyService::CreateFixed("myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -3033,7 +3033,7 @@ TEST_P(HttpNetworkTransactionTest, rv = callback1.WaitForResult(); EXPECT_EQ(ERR_UNEXPECTED_PROXY_AUTH, rv); - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); size_t pos = ExpectLogContainsSomewhere( entries, 0, NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, @@ -3057,7 +3057,7 @@ TEST_P(HttpNetworkTransactionTest, HttpProxyLoadTimingNoPacTwoRequests) { // Configure against proxy server "myproxy:70". session_deps_.proxy_service.reset( ProxyService::CreateFixed("PROXY myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -3155,7 +3155,7 @@ TEST_P(HttpNetworkTransactionTest, HttpProxyLoadTimingWithPacTwoRequests) { // Configure against proxy server "myproxy:70". session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("PROXY myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -3250,7 +3250,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxyGet) { // Configure against https proxy server "proxy:70". session_deps_.proxy_service.reset(ProxyService::CreateFixed( "https://proxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -3312,7 +3312,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGet) { // Configure against https proxy server "proxy:70". session_deps_.proxy_service.reset(ProxyService::CreateFixed( "https://proxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -3377,7 +3377,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithSessionRace) { // Configure SPDY proxy server "proxy:70". session_deps_.proxy_service.reset( ProxyService::CreateFixed("https://proxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -3451,7 +3451,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithProxyAuth) { // Configure against https proxy server "myproxy:70". session_deps_.proxy_service.reset( ProxyService::CreateFixed("https://myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -3554,7 +3554,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectHttps) { // Configure against https proxy server "proxy:70". session_deps_.proxy_service.reset(ProxyService::CreateFixed( "https://proxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -3641,7 +3641,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectSpdy) { // Configure against https proxy server "proxy:70". session_deps_.proxy_service.reset(ProxyService::CreateFixed( "https://proxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -3730,7 +3730,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectFailure) { // Configure against https proxy server "proxy:70". session_deps_.proxy_service.reset(ProxyService::CreateFixed( "https://proxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -3785,7 +3785,7 @@ TEST_P(HttpNetworkTransactionTest, // Configure against https proxy server "proxy:70". session_deps_.proxy_service.reset(ProxyService::CreateFixed( "https://proxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_)); @@ -3935,7 +3935,7 @@ TEST_P(HttpNetworkTransactionTest, // Configure against https proxy server "proxy:70". session_deps_.proxy_service.reset(ProxyService::CreateFixed( "https://proxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_)); @@ -4066,7 +4066,7 @@ TEST_P(HttpNetworkTransactionTest, // Configure against https proxy server "proxy:70". session_deps_.proxy_service.reset(ProxyService::CreateFixed( "https://proxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_)); @@ -4184,7 +4184,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxyAuthRetry) { // Configure against https proxy server "myproxy:70". session_deps_.proxy_service.reset( ProxyService::CreateFixed("https://myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -6374,7 +6374,7 @@ TEST_P(HttpNetworkTransactionTest, HTTPSBadCertificateViaProxy) { TEST_P(HttpNetworkTransactionTest, HTTPSViaHttpsProxy) { session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("HTTPS proxy:70")); - CapturingNetLog net_log; + TestNetLog net_log; session_deps_.net_log = &net_log; HttpRequestInfo request; @@ -6438,7 +6438,7 @@ TEST_P(HttpNetworkTransactionTest, HTTPSViaHttpsProxy) { TEST_P(HttpNetworkTransactionTest, RedirectOfHttpsConnectViaHttpsProxy) { session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("HTTPS proxy:70")); - CapturingNetLog net_log; + TestNetLog net_log; session_deps_.net_log = &net_log; HttpRequestInfo request; @@ -6691,7 +6691,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) { // Configure against https proxy server "myproxy:70". session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("HTTPS myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -6771,7 +6771,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) { rv = callback1.WaitForResult(); EXPECT_EQ(OK, rv); - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); size_t pos = ExpectLogContainsSomewhere( entries, 0, NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, @@ -6832,7 +6832,7 @@ TEST_P(HttpNetworkTransactionTest, CrossOriginProxyPush) { // Configure against https proxy server "myproxy:70". session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("HTTPS myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); // Enable cross-origin push. @@ -6947,7 +6947,7 @@ TEST_P(HttpNetworkTransactionTest, CrossOriginProxyPushCorrectness) { // Configure against https proxy server "myproxy:70". session_deps_.proxy_service.reset( ProxyService::CreateFixed("https://myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); // Enable cross-origin push. @@ -7498,7 +7498,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS4_HTTP_GET) { session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("SOCKS myproxy:1080")); - CapturingNetLog net_log; + TestNetLog net_log; session_deps_.net_log = &net_log; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -7557,7 +7557,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS4_SSL_GET) { session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("SOCKS myproxy:1080")); - CapturingNetLog net_log; + TestNetLog net_log; session_deps_.net_log = &net_log; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -7621,7 +7621,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS4_HTTP_GET_no_PAC) { session_deps_.proxy_service.reset( ProxyService::CreateFixed("socks4://myproxy:1080")); - CapturingNetLog net_log; + TestNetLog net_log; session_deps_.net_log = &net_log; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -7680,7 +7680,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS5_HTTP_GET) { session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("SOCKS5 myproxy:1080")); - CapturingNetLog net_log; + TestNetLog net_log; session_deps_.net_log = &net_log; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -7753,7 +7753,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS5_SSL_GET) { session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("SOCKS5 myproxy:1080")); - CapturingNetLog net_log; + TestNetLog net_log; session_deps_.net_log = &net_log; scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -9524,7 +9524,7 @@ TEST_P(HttpNetworkTransactionTest, make_scoped_ptr( new ForwardingProxyResolverFactory(&capturing_proxy_resolver)), NULL)); - CapturingNetLog net_log; + TestNetLog net_log; session_deps_.net_log = &net_log; HttpRequestInfo request; @@ -10455,7 +10455,7 @@ TEST_P(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) { session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("PROXY myproxy:70")); - CapturingNetLog net_log; + TestNetLog net_log; session_deps_.net_log = &net_log; GURL request_url; { @@ -10639,7 +10639,7 @@ TEST_P(HttpNetworkTransactionTest, SimpleCancel) { TestCompletionCallback callback; - CapturingBoundNetLog log; + BoundTestNetLog log; int rv = trans->Start(&request, callback.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); trans.reset(); // Cancel the transaction here. @@ -10701,7 +10701,7 @@ TEST_P(HttpNetworkTransactionTest, CancelAfterHeaders) { TEST_P(HttpNetworkTransactionTest, ProxyGet) { session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("PROXY myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -10764,7 +10764,7 @@ TEST_P(HttpNetworkTransactionTest, ProxyGet) { TEST_P(HttpNetworkTransactionTest, ProxyTunnelGet) { session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("PROXY myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -10808,7 +10808,7 @@ TEST_P(HttpNetworkTransactionTest, ProxyTunnelGet) { rv = callback1.WaitForResult(); EXPECT_EQ(OK, rv); - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); size_t pos = ExpectLogContainsSomewhere( entries, 0, NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, @@ -10839,7 +10839,7 @@ TEST_P(HttpNetworkTransactionTest, ProxyTunnelGet) { // while establishing the tunnel. TEST_P(HttpNetworkTransactionTest, ProxyTunnelGetHangup) { session_deps_.proxy_service.reset(ProxyService::CreateFixed("myproxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -10880,7 +10880,7 @@ TEST_P(HttpNetworkTransactionTest, ProxyTunnelGetHangup) { rv = callback1.WaitForResult(); EXPECT_EQ(ERR_EMPTY_RESPONSE, rv); - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); size_t pos = ExpectLogContainsSomewhere( entries, 0, NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, @@ -11225,7 +11225,7 @@ TEST_P(HttpNetworkTransactionTest, TEST_P(HttpNetworkTransactionTest, ClientAuthCertCache_Proxy_Fail) { session_deps_.proxy_service.reset( ProxyService::CreateFixed("https://proxy:70")); - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); scoped_refptr<SSLCertRequestInfo> cert_request(new SSLCertRequestInfo()); @@ -11819,7 +11819,7 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttpOverTunnel) { session_deps_.proxy_service.reset( ProxyService::CreateFixedFromPacResult("HTTPS proxy:70")); - CapturingNetLog log; + TestNetLog log; session_deps_.net_log = &log; SSLSocketDataProvider ssl1(ASYNC, OK); // to the proxy ssl1.SetNextProto(GetParam()); diff --git a/net/log/net_log_unittest.cc b/net/log/net_log_unittest.cc index 7c08334..73e4e30 100644 --- a/net/log/net_log_unittest.cc +++ b/net/log/net_log_unittest.cc @@ -25,8 +25,8 @@ base::Value* NetLogLevelCallback(NetLog::LogLevel log_level) { } TEST(NetLogTest, Basic) { - CapturingNetLog net_log; - CapturingNetLog::CapturedEntryList entries; + TestNetLog net_log; + TestNetLog::CapturedEntryList entries; net_log.GetEntries(&entries); EXPECT_EQ(0u, entries.size()); @@ -44,7 +44,7 @@ TEST(NetLogTest, Basic) { // Check that the correct LogLevel is sent to NetLog Value callbacks. TEST(NetLogTest, LogLevels) { - CapturingNetLog net_log; + TestNetLog net_log; for (int log_level = NetLog::LOG_ALL; log_level < NetLog::LOG_NONE; ++log_level) { net_log.SetLogLevel(static_cast<NetLog::LogLevel>(log_level)); @@ -53,7 +53,7 @@ TEST(NetLogTest, LogLevels) { net_log.AddGlobalEntry(NetLog::TYPE_SOCKET_ALIVE, base::Bind(NetLogLevelCallback)); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log.GetEntries(&entries); ASSERT_EQ(1u, entries.size()); diff --git a/net/log/net_log_unittest.h b/net/log/net_log_unittest.h index 62cf0ce..1634e60 100644 --- a/net/log/net_log_unittest.h +++ b/net/log/net_log_unittest.h @@ -7,7 +7,7 @@ #include <cstddef> -#include "net/log/capturing_net_log.h" +#include "net/log/test_net_log.h" #include "testing/gtest/include/gtest/gtest.h" namespace net { @@ -20,7 +20,7 @@ inline base::TimeTicks MakeTime(int t) { } inline ::testing::AssertionResult LogContainsEventHelper( - const CapturingNetLog::CapturedEntryList& entries, + const TestNetLog::CapturedEntryList& entries, int i, // Negative indices are reverse indices. const base::TimeTicks& expected_time, bool check_time, @@ -31,7 +31,7 @@ inline ::testing::AssertionResult LogContainsEventHelper( : static_cast<size_t>(i); if (j >= entries.size()) return ::testing::AssertionFailure() << j << " is out of bounds."; - const CapturingNetLog::CapturedEntry& entry = entries[j]; + const TestNetLog::CapturedEntry& entry = entries[j]; if (expected_event != entry.type) { return ::testing::AssertionFailure() << "Actual event: " << NetLog::EventTypeToString(entry.type) @@ -54,7 +54,7 @@ inline ::testing::AssertionResult LogContainsEventHelper( } inline ::testing::AssertionResult LogContainsEventAtTime( - const CapturingNetLog::CapturedEntryList& log, + const TestNetLog::CapturedEntryList& log, int i, // Negative indices are reverse indices. const base::TimeTicks& expected_time, NetLog::EventType expected_event, @@ -65,7 +65,7 @@ inline ::testing::AssertionResult LogContainsEventAtTime( // Version without timestamp. inline ::testing::AssertionResult LogContainsEvent( - const CapturingNetLog::CapturedEntryList& log, + const TestNetLog::CapturedEntryList& log, int i, // Negative indices are reverse indices. NetLog::EventType expected_event, NetLog::EventPhase expected_phase) { @@ -75,7 +75,7 @@ inline ::testing::AssertionResult LogContainsEvent( // Version for PHASE_BEGIN (and no timestamp). inline ::testing::AssertionResult LogContainsBeginEvent( - const CapturingNetLog::CapturedEntryList& log, + const TestNetLog::CapturedEntryList& log, int i, // Negative indices are reverse indices. NetLog::EventType expected_event) { return LogContainsEvent(log, i, expected_event, NetLog::PHASE_BEGIN); @@ -83,14 +83,14 @@ inline ::testing::AssertionResult LogContainsBeginEvent( // Version for PHASE_END (and no timestamp). inline ::testing::AssertionResult LogContainsEndEvent( - const CapturingNetLog::CapturedEntryList& log, + const TestNetLog::CapturedEntryList& log, int i, // Negative indices are reverse indices. NetLog::EventType expected_event) { return LogContainsEvent(log, i, expected_event, NetLog::PHASE_END); } inline ::testing::AssertionResult LogContainsEntryWithType( - const CapturingNetLog::CapturedEntryList& entries, + const TestNetLog::CapturedEntryList& entries, int i, // Negative indices are reverse indices. NetLog::EventType type) { // Negative indices are reverse indices. @@ -98,7 +98,7 @@ inline ::testing::AssertionResult LogContainsEntryWithType( : static_cast<size_t>(i); if (j >= entries.size()) return ::testing::AssertionFailure() << j << " is out of bounds."; - const CapturingNetLog::CapturedEntry& entry = entries[j]; + const TestNetLog::CapturedEntry& entry = entries[j]; if (entry.type != type) return ::testing::AssertionFailure() << "Type does not match."; return ::testing::AssertionSuccess(); @@ -107,7 +107,7 @@ inline ::testing::AssertionResult LogContainsEntryWithType( // Check if the log contains any entry of the given type at |min_index| or // after. inline ::testing::AssertionResult LogContainsEntryWithTypeAfter( - const CapturingNetLog::CapturedEntryList& entries, + const TestNetLog::CapturedEntryList& entries, int min_index, // Negative indices are reverse indices. NetLog::EventType type) { // Negative indices are reverse indices. @@ -116,7 +116,7 @@ inline ::testing::AssertionResult LogContainsEntryWithTypeAfter( ? static_cast<size_t>(static_cast<int>(entries.size()) + min_index) : static_cast<size_t>(min_index); for (size_t i = real_index; i < entries.size(); ++i) { - const CapturingNetLog::CapturedEntry& entry = entries[i]; + const TestNetLog::CapturedEntry& entry = entries[i]; if (entry.type == type) return ::testing::AssertionSuccess(); } @@ -127,13 +127,13 @@ inline ::testing::AssertionResult LogContainsEntryWithTypeAfter( // as long as the first index where it is found is at least |min_index|. // Returns the position where the event was found. inline size_t ExpectLogContainsSomewhere( - const CapturingNetLog::CapturedEntryList& entries, + const TestNetLog::CapturedEntryList& entries, size_t min_index, NetLog::EventType expected_event, NetLog::EventPhase expected_phase) { size_t i = 0; for (; i < entries.size(); ++i) { - const CapturingNetLog::CapturedEntry& entry = entries[i]; + const TestNetLog::CapturedEntry& entry = entries[i]; if (entry.type == expected_event && entry.phase == expected_phase) break; } @@ -146,13 +146,13 @@ inline size_t ExpectLogContainsSomewhere( // as long as one index where it is found is at least |min_index|. // Returns the first such position where the event was found. inline size_t ExpectLogContainsSomewhereAfter( - const CapturingNetLog::CapturedEntryList& entries, + const TestNetLog::CapturedEntryList& entries, size_t min_index, NetLog::EventType expected_event, NetLog::EventPhase expected_phase) { size_t i = min_index; for (; i < entries.size(); ++i) { - const CapturingNetLog::CapturedEntry& entry = entries[i]; + const TestNetLog::CapturedEntry& entry = entries[i]; if (entry.type == expected_event && entry.phase == expected_phase) break; } diff --git a/net/log/capturing_net_log.cc b/net/log/test_net_log.cc index 99e7296..695eacc 100644 --- a/net/log/capturing_net_log.cc +++ b/net/log/test_net_log.cc @@ -2,68 +2,67 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "net/log/capturing_net_log.h" +#include "net/log/test_net_log.h" namespace net { -CapturingNetLog::CapturingNetLog() { +TestNetLog::TestNetLog() { DeprecatedAddObserver(&capturing_net_log_observer_, LOG_ALL_BUT_BYTES); } -CapturingNetLog::~CapturingNetLog() { +TestNetLog::~TestNetLog() { DeprecatedRemoveObserver(&capturing_net_log_observer_); } -void CapturingNetLog::SetLogLevel(NetLog::LogLevel log_level) { +void TestNetLog::SetLogLevel(NetLog::LogLevel log_level) { SetObserverLogLevel(&capturing_net_log_observer_, log_level); } -void CapturingNetLog::GetEntries( - CapturingNetLog::CapturedEntryList* entry_list) const { +void TestNetLog::GetEntries(TestNetLog::CapturedEntryList* entry_list) const { capturing_net_log_observer_.GetEntries(entry_list); } -void CapturingNetLog::GetEntriesForSource(NetLog::Source source, - CapturedEntryList* entry_list) const { +void TestNetLog::GetEntriesForSource(NetLog::Source source, + CapturedEntryList* entry_list) const { capturing_net_log_observer_.GetEntriesForSource(source, entry_list); } -size_t CapturingNetLog::GetSize() const { +size_t TestNetLog::GetSize() const { return capturing_net_log_observer_.GetSize(); } -void CapturingNetLog::Clear() { +void TestNetLog::Clear() { capturing_net_log_observer_.Clear(); } -CapturingBoundNetLog::CapturingBoundNetLog() +BoundTestNetLog::BoundTestNetLog() : net_log_( BoundNetLog::Make(&capturing_net_log_, net::NetLog::SOURCE_NONE)) { } -CapturingBoundNetLog::~CapturingBoundNetLog() { +BoundTestNetLog::~BoundTestNetLog() { } -void CapturingBoundNetLog::GetEntries( - CapturingNetLog::CapturedEntryList* entry_list) const { +void BoundTestNetLog::GetEntries( + TestNetLog::CapturedEntryList* entry_list) const { capturing_net_log_.GetEntries(entry_list); } -void CapturingBoundNetLog::GetEntriesForSource( +void BoundTestNetLog::GetEntriesForSource( NetLog::Source source, - CapturingNetLog::CapturedEntryList* entry_list) const { + TestNetLog::CapturedEntryList* entry_list) const { capturing_net_log_.GetEntriesForSource(source, entry_list); } -size_t CapturingBoundNetLog::GetSize() const { +size_t BoundTestNetLog::GetSize() const { return capturing_net_log_.GetSize(); } -void CapturingBoundNetLog::Clear() { +void BoundTestNetLog::Clear() { capturing_net_log_.Clear(); } -void CapturingBoundNetLog::SetLogLevel(NetLog::LogLevel log_level) { +void BoundTestNetLog::SetLogLevel(NetLog::LogLevel log_level) { capturing_net_log_.SetLogLevel(log_level); } diff --git a/net/log/capturing_net_log.h b/net/log/test_net_log.h index f2cc03f..174f715 100644 --- a/net/log/capturing_net_log.h +++ b/net/log/test_net_log.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef NET_LOG_CAPTURING_NET_LOG_H_ -#define NET_LOG_CAPTURING_NET_LOG_H_ +#ifndef NET_LOG_TEST_NET_LOG_H_ +#define NET_LOG_TEST_NET_LOG_H_ #include <string> #include <vector> @@ -16,17 +16,17 @@ namespace net { -// CapturingNetLog is convenience class which combines a NetLog and a +// TestNetLog is convenience class which combines a NetLog and a // CapturingNetLogObserver. It is intended for testing only, and is part of the // net_test_support project. -class CapturingNetLog : public NetLog { +class TestNetLog : public NetLog { public: // TODO(mmenke): Get rid of these. typedef CapturedNetLogEntry CapturedEntry; typedef CapturedNetLogEntry::List CapturedEntryList; - CapturingNetLog(); - ~CapturingNetLog() override; + TestNetLog(); + ~TestNetLog() override; void SetLogLevel(LogLevel log_level); @@ -39,45 +39,44 @@ class CapturingNetLog : public NetLog { private: CapturingNetLogObserver capturing_net_log_observer_; - DISALLOW_COPY_AND_ASSIGN(CapturingNetLog); + DISALLOW_COPY_AND_ASSIGN(TestNetLog); }; // Helper class that exposes a similar API as BoundNetLog, but uses a -// CapturingNetLog rather than the more generic NetLog. +// TestNetLog rather than the more generic NetLog. // -// A CapturingBoundNetLog can easily be converted to a BoundNetLog using the +// A BoundTestNetLog can easily be converted to a BoundNetLog using the // bound() method. -class CapturingBoundNetLog { +class BoundTestNetLog { public: - CapturingBoundNetLog(); - ~CapturingBoundNetLog(); + BoundTestNetLog(); + ~BoundTestNetLog(); // The returned BoundNetLog is only valid while |this| is alive. BoundNetLog bound() const { return net_log_; } // Fills |entry_list| with all entries in the log. - void GetEntries(CapturingNetLog::CapturedEntryList* entry_list) const; + void GetEntries(TestNetLog::CapturedEntryList* entry_list) const; // Fills |entry_list| with all entries in the log from the specified Source. - void GetEntriesForSource( - NetLog::Source source, - CapturingNetLog::CapturedEntryList* entry_list) const; + void GetEntriesForSource(NetLog::Source source, + TestNetLog::CapturedEntryList* entry_list) const; // Returns number of entries in the log. size_t GetSize() const; void Clear(); - // Sets the log level of the underlying CapturingNetLog. + // Sets the log level of the underlying TestNetLog. void SetLogLevel(NetLog::LogLevel log_level); private: - CapturingNetLog capturing_net_log_; + TestNetLog capturing_net_log_; const BoundNetLog net_log_; - DISALLOW_COPY_AND_ASSIGN(CapturingBoundNetLog); + DISALLOW_COPY_AND_ASSIGN(BoundTestNetLog); }; } // namespace net -#endif // NET_LOG_CAPTURING_NET_LOG_H_ +#endif // NET_LOG_TEST_NET_LOG_H_ diff --git a/net/log/trace_net_log_observer_unittest.cc b/net/log/trace_net_log_observer_unittest.cc index 0314378..2c2bb48 100644 --- a/net/log/trace_net_log_observer_unittest.cc +++ b/net/log/trace_net_log_observer_unittest.cc @@ -17,8 +17,8 @@ #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event_impl.h" #include "base/values.h" -#include "net/log/capturing_net_log.h" #include "net/log/net_log.h" +#include "net/log/test_net_log.h" #include "testing/gtest/include/gtest/gtest.h" using base::trace_event::TraceLog; @@ -131,7 +131,7 @@ class TraceNetLogObserverTest : public testing::Test { base::ListValue* trace_events() const { return trace_events_.get(); } - CapturingNetLog* net_log() { return &net_log_; } + TestNetLog* net_log() { return &net_log_; } TraceNetLogObserver* trace_net_log_observer() const { return trace_net_log_observer_.get(); @@ -141,7 +141,7 @@ class TraceNetLogObserverTest : public testing::Test { scoped_ptr<base::ListValue> trace_events_; base::trace_event::TraceResultBuffer trace_buffer_; base::trace_event::TraceResultBuffer::SimpleOutput json_output_; - CapturingNetLog net_log_; + TestNetLog net_log_; scoped_ptr<TraceNetLogObserver> trace_net_log_observer_; }; @@ -156,7 +156,7 @@ TEST_F(TraceNetLogObserverTest, TracingNotEnabled) { } TEST_F(TraceNetLogObserverTest, TraceEventCaptured) { - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log()->GetEntries(&entries); EXPECT_TRUE(entries.empty()); @@ -223,7 +223,7 @@ TEST_F(TraceNetLogObserverTest, EnableAndDisableTracing) { EndTraceAndFlush(); trace_net_log_observer()->StopWatchForTraceStart(); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log()->GetEntries(&entries); EXPECT_EQ(3u, entries.size()); EXPECT_EQ(2u, trace_events()->GetSize()); @@ -263,7 +263,7 @@ TEST_F(TraceNetLogObserverTest, DestroyObserverWhileTracing) { EndTraceAndFlush(); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log()->GetEntries(&entries); EXPECT_EQ(2u, entries.size()); EXPECT_EQ(1u, trace_events()->GetSize()); @@ -292,7 +292,7 @@ TEST_F(TraceNetLogObserverTest, DestroyObserverWhileNotTracing) { EndTraceAndFlush(); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log()->GetEntries(&entries); EXPECT_EQ(3u, entries.size()); EXPECT_EQ(0u, trace_events()->GetSize()); @@ -310,7 +310,7 @@ TEST_F(TraceNetLogObserverTest, CreateObserverAfterTracingStarts) { EndTraceAndFlush(); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log()->GetEntries(&entries); EXPECT_EQ(3u, entries.size()); EXPECT_EQ(0u, trace_events()->GetSize()); @@ -329,7 +329,7 @@ TEST_F(TraceNetLogObserverTest, EventsWithAndWithoutParameters) { EndTraceAndFlush(); trace_net_log_observer()->StopWatchForTraceStart(); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log()->GetEntries(&entries); EXPECT_EQ(2u, entries.size()); EXPECT_EQ(2u, trace_events()->GetSize()); diff --git a/net/log/net_log_logger.cc b/net/log/write_to_file_net_log_observer.cc index 4a2b475..668b866 100644 --- a/net/log/net_log_logger.cc +++ b/net/log/write_to_file_net_log_observer.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "net/log/net_log_logger.h" +#include "net/log/write_to_file_net_log_observer.h" #include <stdio.h> @@ -17,22 +17,23 @@ namespace net { -NetLogLogger::NetLogLogger() +WriteToFileNetLogObserver::WriteToFileNetLogObserver() : log_level_(NetLog::LOG_STRIP_PRIVATE_DATA), added_events_(false) { } -NetLogLogger::~NetLogLogger() { +WriteToFileNetLogObserver::~WriteToFileNetLogObserver() { } -void NetLogLogger::set_log_level(net::NetLog::LogLevel log_level) { +void WriteToFileNetLogObserver::set_log_level(net::NetLog::LogLevel log_level) { DCHECK(!net_log()); log_level_ = log_level; } -void NetLogLogger::StartObserving(net::NetLog* net_log, - base::ScopedFILE file, - base::Value* constants, - net::URLRequestContext* url_request_context) { +void WriteToFileNetLogObserver::StartObserving( + net::NetLog* net_log, + base::ScopedFILE file, + base::Value* constants, + net::URLRequestContext* url_request_context) { DCHECK(file.get()); file_ = file.Pass(); added_events_ = false; @@ -64,7 +65,8 @@ void NetLogLogger::StartObserving(net::NetLog* net_log, net_log->DeprecatedAddObserver(this, log_level_); } -void NetLogLogger::StopObserving(net::URLRequestContext* url_request_context) { +void WriteToFileNetLogObserver::StopObserving( + net::URLRequestContext* url_request_context) { net_log()->DeprecatedRemoveObserver(this); // End events array. @@ -85,7 +87,7 @@ void NetLogLogger::StopObserving(net::URLRequestContext* url_request_context) { file_.reset(); } -void NetLogLogger::OnAddEntry(const net::NetLog::Entry& entry) { +void WriteToFileNetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { // Add a comma and newline for every event but the first. Newlines are needed // so can load partial log files by just ignoring the last line. For this to // work, lines cannot be pretty printed. diff --git a/net/log/net_log_logger.h b/net/log/write_to_file_net_log_observer.h index 111d8dd..bd147e3 100644 --- a/net/log/net_log_logger.h +++ b/net/log/write_to_file_net_log_observer.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef NET_LOG_NET_LOG_LOGGER_H_ -#define NET_LOG_NET_LOG_LOGGER_H_ +#ifndef WRITE_TO_FILE_NET_LOG_OBSERVER_H_ +#define WRITE_TO_FILE_NET_LOG_OBSERVER_H_ #include <stdio.h> @@ -22,14 +22,14 @@ namespace net { class URLRequestContext; -// NetLogLogger watches the NetLog event stream, and sends all entries to -// a file specified on creation. +// WriteToFileNetLogObserver watches the NetLog event stream, and sends all +// entries to a file specified on creation. // // The text file will contain a single JSON object. -class NET_EXPORT NetLogLogger : public NetLog::ThreadSafeObserver { +class NET_EXPORT WriteToFileNetLogObserver : public NetLog::ThreadSafeObserver { public: - NetLogLogger(); - ~NetLogLogger() override; + WriteToFileNetLogObserver(); + ~WriteToFileNetLogObserver() override; // Sets the log level to log at. Must be called before StartObserving. void set_log_level(NetLog::LogLevel log_level); @@ -52,7 +52,7 @@ class NET_EXPORT NetLogLogger : public NetLog::ThreadSafeObserver { net::URLRequestContext* url_request_context); // Stops observing net_log(). Must already be watching. Must be called - // before destruction of the NetLogLogger and the NetLog. + // before destruction of the WriteToFileNetLogObserver and the NetLog. // // |url_request_context| is an optional argument used to added additional // network stack state to the log. If the context is non-NULL, this must be @@ -71,9 +71,9 @@ class NET_EXPORT NetLogLogger : public NetLog::ThreadSafeObserver { // True if OnAddEntry() has been called at least once. bool added_events_; - DISALLOW_COPY_AND_ASSIGN(NetLogLogger); + DISALLOW_COPY_AND_ASSIGN(WriteToFileNetLogObserver); }; } // namespace net -#endif // NET_LOG_NET_LOG_LOGGER_H_ +#endif // WRITE_TO_FILE_NET_LOG_OBSERVER_H_ diff --git a/net/log/net_log_logger_unittest.cc b/net/log/write_to_file_net_log_observer_unittest.cc index 8a0d64a..4c12cf3d 100644 --- a/net/log/net_log_logger_unittest.cc +++ b/net/log/write_to_file_net_log_observer_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "net/log/net_log_logger.h" +#include "net/log/write_to_file_net_log_observer.h" #include "base/files/file_path.h" #include "base/files/file_util.h" @@ -22,7 +22,7 @@ namespace net { namespace { -class NetLogLoggerTest : public testing::Test { +class WriteToFileNetLogObserverTest : public testing::Test { public: void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); @@ -35,11 +35,11 @@ class NetLogLoggerTest : public testing::Test { NetLog net_log_; }; -TEST_F(NetLogLoggerTest, GeneratesValidJSONForNoEvents) { +TEST_F(WriteToFileNetLogObserverTest, GeneratesValidJSONForNoEvents) { // Create and destroy a logger. base::ScopedFILE file(base::OpenFile(log_path_, "w")); ASSERT_TRUE(file); - scoped_ptr<NetLogLogger> logger(new NetLogLogger()); + scoped_ptr<WriteToFileNetLogObserver> logger(new WriteToFileNetLogObserver()); logger->StartObserving(&net_log_, file.Pass(), nullptr, nullptr); logger->StopObserving(nullptr); logger.reset(); @@ -61,10 +61,10 @@ TEST_F(NetLogLoggerTest, GeneratesValidJSONForNoEvents) { ASSERT_TRUE(dict->GetDictionary("constants", &constants)); } -TEST_F(NetLogLoggerTest, LogLevel) { +TEST_F(WriteToFileNetLogObserverTest, LogLevel) { base::ScopedFILE file(base::OpenFile(log_path_, "w")); ASSERT_TRUE(file); - NetLogLogger logger; + WriteToFileNetLogObserver logger; logger.StartObserving(&net_log_, file.Pass(), nullptr, nullptr); EXPECT_EQ(NetLog::LOG_STRIP_PRIVATE_DATA, logger.log_level()); EXPECT_EQ(NetLog::LOG_STRIP_PRIVATE_DATA, net_log_.GetLogLevel()); @@ -79,10 +79,10 @@ TEST_F(NetLogLoggerTest, LogLevel) { logger.StopObserving(nullptr); } -TEST_F(NetLogLoggerTest, GeneratesValidJSONWithOneEvent) { +TEST_F(WriteToFileNetLogObserverTest, GeneratesValidJSONWithOneEvent) { base::ScopedFILE file(base::OpenFile(log_path_, "w")); ASSERT_TRUE(file); - scoped_ptr<NetLogLogger> logger(new NetLogLogger()); + scoped_ptr<WriteToFileNetLogObserver> logger(new WriteToFileNetLogObserver()); logger->StartObserving(&net_log_, file.Pass(), nullptr, nullptr); const int kDummyId = 1; @@ -109,10 +109,10 @@ TEST_F(NetLogLoggerTest, GeneratesValidJSONWithOneEvent) { ASSERT_EQ(1u, events->GetSize()); } -TEST_F(NetLogLoggerTest, GeneratesValidJSONWithMultipleEvents) { +TEST_F(WriteToFileNetLogObserverTest, GeneratesValidJSONWithMultipleEvents) { base::ScopedFILE file(base::OpenFile(log_path_, "w")); ASSERT_TRUE(file); - scoped_ptr<NetLogLogger> logger(new NetLogLogger()); + scoped_ptr<WriteToFileNetLogObserver> logger(new WriteToFileNetLogObserver()); logger->StartObserving(&net_log_, file.Pass(), nullptr, nullptr); const int kDummyId = 1; @@ -142,12 +142,12 @@ TEST_F(NetLogLoggerTest, GeneratesValidJSONWithMultipleEvents) { ASSERT_EQ(2u, events->GetSize()); } -TEST_F(NetLogLoggerTest, CustomConstants) { +TEST_F(WriteToFileNetLogObserverTest, CustomConstants) { const char kConstantString[] = "awesome constant"; scoped_ptr<base::Value> constants(new base::StringValue(kConstantString)); base::ScopedFILE file(base::OpenFile(log_path_, "w")); ASSERT_TRUE(file); - scoped_ptr<NetLogLogger> logger(new NetLogLogger()); + scoped_ptr<WriteToFileNetLogObserver> logger(new WriteToFileNetLogObserver()); logger->StartObserving(&net_log_, file.Pass(), constants.get(), nullptr); logger->StopObserving(nullptr); logger.reset(); @@ -166,7 +166,7 @@ TEST_F(NetLogLoggerTest, CustomConstants) { ASSERT_EQ(kConstantString, constants_string); } -TEST_F(NetLogLoggerTest, GeneratesValidJSONWithContext) { +TEST_F(WriteToFileNetLogObserverTest, GeneratesValidJSONWithContext) { // Create context, start a request. TestURLRequestContext context(true); context.set_net_log(&net_log_); @@ -175,7 +175,7 @@ TEST_F(NetLogLoggerTest, GeneratesValidJSONWithContext) { // Create and destroy a logger. base::ScopedFILE file(base::OpenFile(log_path_, "w")); ASSERT_TRUE(file); - scoped_ptr<NetLogLogger> logger(new NetLogLogger()); + scoped_ptr<WriteToFileNetLogObserver> logger(new WriteToFileNetLogObserver()); logger->StartObserving(&net_log_, file.Pass(), nullptr, &context); logger->StopObserving(&context); logger.reset(); @@ -198,7 +198,8 @@ TEST_F(NetLogLoggerTest, GeneratesValidJSONWithContext) { ASSERT_TRUE(dict->GetDictionary("tabInfo", &tab_info)); } -TEST_F(NetLogLoggerTest, GeneratesValidJSONWithContextWithActiveRequest) { +TEST_F(WriteToFileNetLogObserverTest, + GeneratesValidJSONWithContextWithActiveRequest) { // Create context, start a request. TestURLRequestContext context(true); context.set_net_log(&net_log_); @@ -213,7 +214,7 @@ TEST_F(NetLogLoggerTest, GeneratesValidJSONWithContextWithActiveRequest) { // Create and destroy a logger. base::ScopedFILE file(base::OpenFile(log_path_, "w")); ASSERT_TRUE(file); - scoped_ptr<NetLogLogger> logger(new NetLogLogger()); + scoped_ptr<WriteToFileNetLogObserver> logger(new WriteToFileNetLogObserver()); logger->StartObserving(&net_log_, file.Pass(), nullptr, &context); logger->StopObserving(&context); logger.reset(); diff --git a/net/net.gyp b/net/net.gyp index aac3855..5e4ae19 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -540,8 +540,8 @@ 'http/http_transaction_test_util.h', 'log/captured_net_log_entry.cc', 'log/captured_net_log_entry.h', - 'log/capturing_net_log.cc', - 'log/capturing_net_log.h', + 'log/test_net_log.cc', + 'log/test_net_log.h', 'log/capturing_net_log_observer.cc', 'log/capturing_net_log_observer.h', 'proxy/mock_proxy_resolver.cc', diff --git a/net/net.gypi b/net/net.gypi index cbdc7e4..8faf632 100644 --- a/net/net.gypi +++ b/net/net.gypi @@ -479,8 +479,8 @@ 'disk_cache/simple/simple_entry_impl.h', 'disk_cache/simple/simple_entry_operation.cc', 'disk_cache/simple/simple_entry_operation.h', - 'log/net_log_logger.cc', - 'log/net_log_logger.h', + 'log/write_to_file_net_log_observer.cc', + 'log/write_to_file_net_log_observer.h', 'log/net_log_util.cc', 'log/net_log_util.h', 'log/trace_net_log_observer.cc', @@ -1434,7 +1434,7 @@ 'http/transport_security_persister_unittest.cc', 'http/transport_security_state_unittest.cc', 'http/url_security_manager_unittest.cc', - 'log/net_log_logger_unittest.cc', + 'log/write_to_file_net_log_observer_unittest.cc', 'log/net_log_unittest.cc', 'log/net_log_unittest.h', 'log/net_log_util_unittest.cc', diff --git a/net/proxy/multi_threaded_proxy_resolver_unittest.cc b/net/proxy/multi_threaded_proxy_resolver_unittest.cc index 9d8d728..eb70c1df 100644 --- a/net/proxy/multi_threaded_proxy_resolver_unittest.cc +++ b/net/proxy/multi_threaded_proxy_resolver_unittest.cc @@ -194,7 +194,7 @@ TEST(MultiThreadedProxyResolverTest, SingleThread_Basic) { // Start request 0. TestCompletionCallback callback0; - CapturingBoundNetLog log0; + BoundTestNetLog log0; ProxyInfo results0; rv = resolver.GetProxyForURL(GURL("http://request0"), &results0, callback0.callback(), NULL, log0.bound()); @@ -209,7 +209,7 @@ TEST(MultiThreadedProxyResolverTest, SingleThread_Basic) { // on completion, this should have been copied into |log0|. // We also have 1 log entry that was emitted by the // MultiThreadedProxyResolver. - CapturingNetLog::CapturedEntryList entries0; + TestNetLog::CapturedEntryList entries0; log0.GetEntries(&entries0); ASSERT_EQ(2u, entries0.size()); @@ -275,7 +275,7 @@ TEST(MultiThreadedProxyResolverTest, ProxyResolver::RequestHandle request0; TestCompletionCallback callback0; ProxyInfo results0; - CapturingBoundNetLog log0; + BoundTestNetLog log0; rv = resolver.GetProxyForURL(GURL("http://request0"), &results0, callback0.callback(), &request0, log0.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -284,7 +284,7 @@ TEST(MultiThreadedProxyResolverTest, TestCompletionCallback callback1; ProxyInfo results1; - CapturingBoundNetLog log1; + BoundTestNetLog log1; rv = resolver.GetProxyForURL(GURL("http://request1"), &results1, callback1.callback(), NULL, log1.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -292,7 +292,7 @@ TEST(MultiThreadedProxyResolverTest, ProxyResolver::RequestHandle request2; TestCompletionCallback callback2; ProxyInfo results2; - CapturingBoundNetLog log2; + BoundTestNetLog log2; rv = resolver.GetProxyForURL(GURL("http://request2"), &results2, callback2.callback(), &request2, log2.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -307,7 +307,7 @@ TEST(MultiThreadedProxyResolverTest, EXPECT_EQ(0, callback0.WaitForResult()); EXPECT_EQ("PROXY request0:80", results0.ToPacString()); - CapturingNetLog::CapturedEntryList entries0; + TestNetLog::CapturedEntryList entries0; log0.GetEntries(&entries0); ASSERT_EQ(2u, entries0.size()); @@ -318,7 +318,7 @@ TEST(MultiThreadedProxyResolverTest, EXPECT_EQ(1, callback1.WaitForResult()); EXPECT_EQ("PROXY request1:80", results1.ToPacString()); - CapturingNetLog::CapturedEntryList entries1; + TestNetLog::CapturedEntryList entries1; log1.GetEntries(&entries1); ASSERT_EQ(4u, entries1.size()); @@ -333,7 +333,7 @@ TEST(MultiThreadedProxyResolverTest, EXPECT_EQ(2, callback2.WaitForResult()); EXPECT_EQ("PROXY request2:80", results2.ToPacString()); - CapturingNetLog::CapturedEntryList entries2; + TestNetLog::CapturedEntryList entries2; log2.GetEntries(&entries2); ASSERT_EQ(4u, entries2.size()); diff --git a/net/proxy/proxy_resolver_v8_tracing_unittest.cc b/net/proxy/proxy_resolver_v8_tracing_unittest.cc index 9c25508..13dfe62 100644 --- a/net/proxy/proxy_resolver_v8_tracing_unittest.cc +++ b/net/proxy/proxy_resolver_v8_tracing_unittest.cc @@ -96,8 +96,8 @@ class MockErrorObserver : public ProxyResolverErrorObserver { }; TEST_F(ProxyResolverV8TracingTest, Simple) { - CapturingNetLog log; - CapturingBoundNetLog request_log; + TestNetLog log; + BoundTestNetLog request_log; MockCachingHostResolver host_resolver; MockErrorObserver* error_observer = new MockErrorObserver; ProxyResolverV8Tracing resolver(&host_resolver, error_observer, &log); @@ -127,8 +127,8 @@ TEST_F(ProxyResolverV8TracingTest, Simple) { } TEST_F(ProxyResolverV8TracingTest, JavascriptError) { - CapturingNetLog log; - CapturingBoundNetLog request_log; + TestNetLog log; + BoundTestNetLog request_log; MockCachingHostResolver host_resolver; MockErrorObserver* error_observer = new MockErrorObserver; ProxyResolverV8Tracing resolver(&host_resolver, error_observer, &log); @@ -152,12 +152,12 @@ TEST_F(ProxyResolverV8TracingTest, JavascriptError) { // Check the NetLogs -- there was 1 alert and 1 javascript error, and they // were output to both the global log, and per-request log. - CapturingNetLog::CapturedEntryList entries_list[2]; + TestNetLog::CapturedEntryList entries_list[2]; log.GetEntries(&entries_list[0]); request_log.GetEntries(&entries_list[1]); for (size_t list_i = 0; list_i < arraysize(entries_list); list_i++) { - const CapturingNetLog::CapturedEntryList& entries = entries_list[list_i]; + const TestNetLog::CapturedEntryList& entries = entries_list[list_i]; EXPECT_EQ(2u, entries.size()); EXPECT_TRUE( LogContainsEvent(entries, 0, NetLog::TYPE_PAC_JAVASCRIPT_ALERT, @@ -173,8 +173,8 @@ TEST_F(ProxyResolverV8TracingTest, JavascriptError) { } TEST_F(ProxyResolverV8TracingTest, TooManyAlerts) { - CapturingNetLog log; - CapturingBoundNetLog request_log; + TestNetLog log; + BoundTestNetLog request_log; MockCachingHostResolver host_resolver; MockErrorObserver* error_observer = new MockErrorObserver; ProxyResolverV8Tracing resolver(&host_resolver, error_observer, &log); @@ -206,12 +206,12 @@ TEST_F(ProxyResolverV8TracingTest, TooManyAlerts) { // Check the NetLogs -- the script generated 50 alerts, which were mirrored // to both the global and per-request logs. - CapturingNetLog::CapturedEntryList entries_list[2]; + TestNetLog::CapturedEntryList entries_list[2]; log.GetEntries(&entries_list[0]); request_log.GetEntries(&entries_list[1]); for (size_t list_i = 0; list_i < arraysize(entries_list); list_i++) { - const CapturingNetLog::CapturedEntryList& entries = entries_list[list_i]; + const TestNetLog::CapturedEntryList& entries = entries_list[list_i]; EXPECT_EQ(50u, entries.size()); for (size_t i = 0; i < entries.size(); ++i) { ASSERT_TRUE( @@ -224,8 +224,8 @@ TEST_F(ProxyResolverV8TracingTest, TooManyAlerts) { // Verify that buffered alerts cannot grow unboundedly, even when the message is // empty string. TEST_F(ProxyResolverV8TracingTest, TooManyEmptyAlerts) { - CapturingNetLog log; - CapturingBoundNetLog request_log; + TestNetLog log; + BoundTestNetLog request_log; MockCachingHostResolver host_resolver; MockErrorObserver* error_observer = new MockErrorObserver; ProxyResolverV8Tracing resolver(&host_resolver, error_observer, &log); @@ -254,12 +254,12 @@ TEST_F(ProxyResolverV8TracingTest, TooManyEmptyAlerts) { // Check the NetLogs -- the script generated 50 alerts, which were mirrored // to both the global and per-request logs. - CapturingNetLog::CapturedEntryList entries_list[2]; + TestNetLog::CapturedEntryList entries_list[2]; log.GetEntries(&entries_list[0]); request_log.GetEntries(&entries_list[1]); for (size_t list_i = 0; list_i < arraysize(entries_list); list_i++) { - const CapturingNetLog::CapturedEntryList& entries = entries_list[list_i]; + const TestNetLog::CapturedEntryList& entries = entries_list[list_i]; EXPECT_EQ(1000u, entries.size()); for (size_t i = 0; i < entries.size(); ++i) { ASSERT_TRUE( @@ -273,8 +273,8 @@ TEST_F(ProxyResolverV8TracingTest, TooManyEmptyAlerts) { // verifies the final result, and that the underlying DNS resolver received // the correct set of queries. TEST_F(ProxyResolverV8TracingTest, Dns) { - CapturingNetLog log; - CapturingBoundNetLog request_log; + TestNetLog log; + BoundTestNetLog request_log; MockCachingHostResolver host_resolver; MockErrorObserver* error_observer = new MockErrorObserver; ProxyResolverV8Tracing resolver(&host_resolver, error_observer, &log); @@ -332,12 +332,12 @@ TEST_F(ProxyResolverV8TracingTest, Dns) { // Check the NetLogs -- the script generated 1 alert, mirrored to both // the per-request and global logs. - CapturingNetLog::CapturedEntryList entries_list[2]; + TestNetLog::CapturedEntryList entries_list[2]; log.GetEntries(&entries_list[0]); request_log.GetEntries(&entries_list[1]); for (size_t list_i = 0; list_i < arraysize(entries_list); list_i++) { - const CapturingNetLog::CapturedEntryList& entries = entries_list[list_i]; + const TestNetLog::CapturedEntryList& entries = entries_list[list_i]; EXPECT_EQ(1u, entries.size()); EXPECT_TRUE( LogContainsEvent(entries, 0, NetLog::TYPE_PAC_JAVASCRIPT_ALERT, @@ -350,8 +350,8 @@ TEST_F(ProxyResolverV8TracingTest, Dns) { // "dnsResolve()". This requires 2 restarts. However once the HostResolver's // cache is warmed, subsequent calls should take 0 restarts. TEST_F(ProxyResolverV8TracingTest, DnsChecksCache) { - CapturingNetLog log; - CapturingBoundNetLog request_log; + TestNetLog log; + BoundTestNetLog request_log; MockCachingHostResolver host_resolver; MockErrorObserver* error_observer = new MockErrorObserver; ProxyResolverV8Tracing resolver(&host_resolver, error_observer, &log); @@ -407,8 +407,8 @@ TEST_F(ProxyResolverV8TracingTest, DnsChecksCache) { // optimization. The proxy resolver should detect the inconsistency and // fall-back to synchronous mode execution. TEST_F(ProxyResolverV8TracingTest, FallBackToSynchronous1) { - CapturingNetLog log; - CapturingBoundNetLog request_log; + TestNetLog log; + BoundTestNetLog request_log; MockCachingHostResolver host_resolver; MockErrorObserver* error_observer = new MockErrorObserver; ProxyResolverV8Tracing resolver(&host_resolver, error_observer, &log); @@ -441,12 +441,12 @@ TEST_F(ProxyResolverV8TracingTest, FallBackToSynchronous1) { // Check the NetLogs -- the script generated 1 alert, mirrored to both // the per-request and global logs. - CapturingNetLog::CapturedEntryList entries_list[2]; + TestNetLog::CapturedEntryList entries_list[2]; log.GetEntries(&entries_list[0]); request_log.GetEntries(&entries_list[1]); for (size_t list_i = 0; list_i < arraysize(entries_list); list_i++) { - const CapturingNetLog::CapturedEntryList& entries = entries_list[list_i]; + const TestNetLog::CapturedEntryList& entries = entries_list[list_i]; EXPECT_EQ(1u, entries.size()); EXPECT_TRUE( LogContainsEvent(entries, 0, NetLog::TYPE_PAC_JAVASCRIPT_ALERT, @@ -459,8 +459,8 @@ TEST_F(ProxyResolverV8TracingTest, FallBackToSynchronous1) { // optimization. The proxy resolver should detect the inconsistency and // fall-back to synchronous mode execution. TEST_F(ProxyResolverV8TracingTest, FallBackToSynchronous2) { - CapturingNetLog log; - CapturingBoundNetLog request_log; + TestNetLog log; + BoundTestNetLog request_log; MockCachingHostResolver host_resolver; MockErrorObserver* error_observer = new MockErrorObserver; ProxyResolverV8Tracing resolver(&host_resolver, error_observer, &log); @@ -499,8 +499,8 @@ TEST_F(ProxyResolverV8TracingTest, FallBackToSynchronous2) { // DNS resolves per request limit (20) after which every DNS resolve will // fail. TEST_F(ProxyResolverV8TracingTest, InfiniteDNSSequence) { - CapturingNetLog log; - CapturingBoundNetLog request_log; + TestNetLog log; + BoundTestNetLog request_log; MockCachingHostResolver host_resolver; MockErrorObserver* error_observer = new MockErrorObserver; ProxyResolverV8Tracing resolver(&host_resolver, error_observer, &log); @@ -542,8 +542,8 @@ TEST_F(ProxyResolverV8TracingTest, InfiniteDNSSequence) { // DNS resolves per request limit (20) after which every DNS resolve will // fail. TEST_F(ProxyResolverV8TracingTest, InfiniteDNSSequence2) { - CapturingNetLog log; - CapturingBoundNetLog request_log; + TestNetLog log; + BoundTestNetLog request_log; MockCachingHostResolver host_resolver; MockErrorObserver* error_observer = new MockErrorObserver; ProxyResolverV8Tracing resolver(&host_resolver, error_observer, &log); @@ -575,8 +575,8 @@ TEST_F(ProxyResolverV8TracingTest, InfiniteDNSSequence2) { } void DnsDuringInitHelper(bool synchronous_host_resolver) { - CapturingNetLog log; - CapturingBoundNetLog request_log; + TestNetLog log; + BoundTestNetLog request_log; MockCachingHostResolver host_resolver; host_resolver.set_synchronous_mode(synchronous_host_resolver); MockErrorObserver* error_observer = new MockErrorObserver; @@ -614,7 +614,7 @@ void DnsDuringInitHelper(bool synchronous_host_resolver) { // Check the NetLogs -- the script generated 2 alerts during initialization. EXPECT_EQ(0u, request_log.GetSize()); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); ASSERT_EQ(2u, entries.size()); @@ -949,8 +949,8 @@ TEST_F(ProxyResolverV8TracingTest, CancelSetPacWhileOutstandingBlockingDns) { // This tests that the execution of a PAC script is terminated when the DNS // dependencies are missing. If the test fails, then it will hang. TEST_F(ProxyResolverV8TracingTest, Terminate) { - CapturingNetLog log; - CapturingBoundNetLog request_log; + TestNetLog log; + BoundTestNetLog request_log; MockCachingHostResolver host_resolver; MockErrorObserver* error_observer = new MockErrorObserver; ProxyResolverV8Tracing resolver(&host_resolver, error_observer, &log); diff --git a/net/proxy/proxy_resolver_v8_unittest.cc b/net/proxy/proxy_resolver_v8_unittest.cc index ae582dc..1f33e18 100644 --- a/net/proxy/proxy_resolver_v8_unittest.cc +++ b/net/proxy/proxy_resolver_v8_unittest.cc @@ -145,7 +145,7 @@ TEST(ProxyResolverV8Test, Direct) { EXPECT_EQ(OK, result); ProxyInfo proxy_info; - CapturingBoundNetLog log; + BoundTestNetLog log; result = resolver.GetProxyForURL( kQueryUrl, &proxy_info, CompletionCallback(), NULL, log.bound()); @@ -155,7 +155,7 @@ TEST(ProxyResolverV8Test, Direct) { EXPECT_EQ(0U, resolver.mock_js_bindings()->alerts.size()); EXPECT_EQ(0U, resolver.mock_js_bindings()->errors.size()); - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); // No bindings were called, so no log entries. EXPECT_EQ(0u, entries.size()); diff --git a/net/proxy/proxy_script_decider_unittest.cc b/net/proxy/proxy_script_decider_unittest.cc index b30243d..383c159 100644 --- a/net/proxy/proxy_script_decider_unittest.cc +++ b/net/proxy/proxy_script_decider_unittest.cc @@ -188,14 +188,14 @@ TEST(ProxyScriptDeciderTest, CustomPacSucceeds) { Rules::Rule rule = rules.AddSuccessRule("http://custom/proxy.pac"); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; ProxyScriptDecider decider(&fetcher, &dhcp_fetcher, &log); EXPECT_EQ(OK, decider.Start( config, base::TimeDelta(), true, callback.callback())); EXPECT_EQ(rule.text(), decider.script_data()->utf16()); // Check the NetLog was filled correctly. - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_EQ(4u, entries.size()); @@ -224,7 +224,7 @@ TEST(ProxyScriptDeciderTest, CustomPacFails1) { rules.AddFailDownloadRule("http://custom/proxy.pac"); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; ProxyScriptDecider decider(&fetcher, &dhcp_fetcher, &log); EXPECT_EQ(kFailedDownloading, decider.Start(config, base::TimeDelta(), true, @@ -232,7 +232,7 @@ TEST(ProxyScriptDeciderTest, CustomPacFails1) { EXPECT_EQ(NULL, decider.script_data()); // Check the NetLog was filled correctly. - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_EQ(4u, entries.size()); @@ -477,7 +477,7 @@ TEST(ProxyScriptDeciderTest, AutodetectFailCustomSuccess2) { Rules::Rule rule = rules.AddSuccessRule("http://custom/proxy.pac"); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; ProxyScriptDecider decider(&fetcher, &dhcp_fetcher, &log); EXPECT_EQ(OK, decider.Start(config, base::TimeDelta(), @@ -492,7 +492,7 @@ TEST(ProxyScriptDeciderTest, AutodetectFailCustomSuccess2) { // Check the NetLog was filled correctly. // (Note that various states are repeated since both WPAD and custom // PAC scripts are tried). - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_EQ(10u, entries.size()); @@ -582,7 +582,7 @@ TEST(ProxyScriptDeciderTest, CustomPacFails1_WithPositiveDelay) { rules.AddFailDownloadRule("http://custom/proxy.pac"); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; ProxyScriptDecider decider(&fetcher, &dhcp_fetcher, &log); EXPECT_EQ(ERR_IO_PENDING, decider.Start(config, base::TimeDelta::FromMilliseconds(1), @@ -592,7 +592,7 @@ TEST(ProxyScriptDeciderTest, CustomPacFails1_WithPositiveDelay) { EXPECT_EQ(NULL, decider.script_data()); // Check the NetLog was filled correctly. - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_EQ(6u, entries.size()); @@ -624,7 +624,7 @@ TEST(ProxyScriptDeciderTest, CustomPacFails1_WithNegativeDelay) { rules.AddFailDownloadRule("http://custom/proxy.pac"); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; ProxyScriptDecider decider(&fetcher, &dhcp_fetcher, &log); EXPECT_EQ(kFailedDownloading, decider.Start(config, base::TimeDelta::FromSeconds(-5), @@ -632,7 +632,7 @@ TEST(ProxyScriptDeciderTest, CustomPacFails1_WithNegativeDelay) { EXPECT_EQ(NULL, decider.script_data()); // Check the NetLog was filled correctly. - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_EQ(4u, entries.size()); diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc index a37f31f5..db4151d 100644 --- a/net/proxy/proxy_service_unittest.cc +++ b/net/proxy/proxy_service_unittest.cc @@ -249,7 +249,7 @@ TEST_F(ProxyServiceTest, Direct) { ProxyInfo info; TestCompletionCallback callback; - CapturingBoundNetLog log; + BoundTestNetLog log; int rv = service.ResolveProxy( url, net::LOAD_NORMAL, &info, callback.callback(), NULL, NULL, log.bound()); @@ -261,7 +261,7 @@ TEST_F(ProxyServiceTest, Direct) { EXPECT_TRUE(info.proxy_resolve_end_time().is_null()); // Check the NetLog was filled correctly. - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_EQ(3u, entries.size()); @@ -287,7 +287,7 @@ TEST_F(ProxyServiceTest, OnResolveProxyCallbackAddProxy) { ProxyInfo info; TestCompletionCallback callback; - CapturingBoundNetLog log; + BoundTestNetLog log; // First, warm up the ProxyService. int rv = service.ResolveProxy( @@ -346,7 +346,7 @@ TEST_F(ProxyServiceTest, OnResolveProxyCallbackRemoveProxy) { ProxyInfo info; TestCompletionCallback callback; - CapturingBoundNetLog log; + BoundTestNetLog log; // First, warm up the ProxyService. int rv = service.ResolveProxy( @@ -393,7 +393,7 @@ TEST_F(ProxyServiceTest, PAC) { ProxyInfo info; TestCompletionCallback callback; ProxyService::PacRequest* request; - CapturingBoundNetLog log; + BoundTestNetLog log; int rv = service.ResolveProxy( url, net::LOAD_NORMAL, &info, callback.callback(), &request, NULL, @@ -423,7 +423,7 @@ TEST_F(ProxyServiceTest, PAC) { EXPECT_LE(info.proxy_resolve_start_time(), info.proxy_resolve_end_time()); // Check the NetLog was filled correctly. - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_EQ(5u, entries.size()); @@ -1913,7 +1913,7 @@ TEST_F(ProxyServiceTest, CancelWhilePACFetching) { ProxyInfo info1; TestCompletionCallback callback1; ProxyService::PacRequest* request1; - CapturingBoundNetLog log1; + BoundTestNetLog log1; int rv = service.ResolveProxy(GURL("http://request1"), net::LOAD_NORMAL, &info1, callback1.callback(), &request1, NULL, log1.bound()); @@ -1970,7 +1970,7 @@ TEST_F(ProxyServiceTest, CancelWhilePACFetching) { EXPECT_FALSE(callback1.have_result()); // Cancelled. EXPECT_FALSE(callback2.have_result()); // Cancelled. - CapturingNetLog::CapturedEntryList entries1; + TestNetLog::CapturedEntryList entries1; log1.GetEntries(&entries1); // Check the NetLog for request 1 (which was cancelled) got filled properly. @@ -2423,7 +2423,7 @@ TEST_F(ProxyServiceTest, NetworkChangeTriggersPacRefetch) { MockAsyncProxyResolverExpectsBytes resolver; - CapturingNetLog log; + TestNetLog log; ProxyService service( config_service, @@ -2520,7 +2520,7 @@ TEST_F(ProxyServiceTest, NetworkChangeTriggersPacRefetch) { // Check that the expected events were output to the log stream. In particular // PROXY_CONFIG_CHANGED should have only been emitted once (for the initial // setup), and NOT a second time when the IP address changed. - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsEntryWithType(entries, 0, @@ -3131,7 +3131,7 @@ TEST_F(ProxyServiceTest, SynchronousWithPAC) { ProxyInfo info; info.UseDirect(); - CapturingBoundNetLog log; + BoundTestNetLog log; bool synchronous_success = service.TryResolveProxySynchronously( url, net::LOAD_NORMAL, &info, NULL, log.bound()); @@ -3160,7 +3160,7 @@ TEST_F(ProxyServiceTest, SynchronousWithFixedConfiguration) { GURL url("http://www.google.com/"); ProxyInfo info; - CapturingBoundNetLog log; + BoundTestNetLog log; bool synchronous_success = service.TryResolveProxySynchronously( url, net::LOAD_NORMAL, &info, NULL, log.bound()); diff --git a/net/quic/quic_client_session_test.cc b/net/quic/quic_client_session_test.cc index c164ac8..b6457ec 100644 --- a/net/quic/quic_client_session_test.cc +++ b/net/quic/quic_client_session_test.cc @@ -13,7 +13,7 @@ #include "net/base/test_data_directory.h" #include "net/cert/cert_verify_result.h" #include "net/http/transport_security_state.h" -#include "net/log/capturing_net_log.h" +#include "net/log/test_net_log.h" #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" #include "net/quic/crypto/crypto_protocol.h" #include "net/quic/crypto/proof_verifier_chromium.h" @@ -81,7 +81,7 @@ class QuicClientSessionTest : public ::testing::TestWithParam<QuicVersion> { } PacketSavingConnection* connection_; - CapturingNetLog net_log_; + TestNetLog net_log_; MockClientSocketFactory socket_factory_; StaticSocketDataProvider socket_data_; TransportSecurityState transport_security_state_; diff --git a/net/quic/quic_network_transaction_unittest.cc b/net/quic/quic_network_transaction_unittest.cc index 5445abd..0fcb77b 100644 --- a/net/quic/quic_network_transaction_unittest.cc +++ b/net/quic/quic_network_transaction_unittest.cc @@ -19,8 +19,8 @@ #include "net/http/http_stream_factory.h" #include "net/http/http_transaction_test_util.h" #include "net/http/transport_security_state.h" -#include "net/log/capturing_net_log.h" #include "net/log/net_log_unittest.h" +#include "net/log/test_net_log.h" #include "net/proxy/proxy_config_service_fixed.h" #include "net/proxy/proxy_resolver.h" #include "net/proxy/proxy_service.h" @@ -353,7 +353,7 @@ class QuicNetworkTransactionTest HttpServerPropertiesImpl http_server_properties; HttpNetworkSession::Params params_; HttpRequestInfo request_; - CapturingBoundNetLog net_log_; + BoundTestNetLog net_log_; StaticSocketDataProvider hanging_data_; private: @@ -405,7 +405,7 @@ TEST_P(QuicNetworkTransactionTest, ForceQuic) { SendRequestAndExpectQuicResponse("hello!"); // Check that the NetLog was filled reasonably. - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; net_log_.GetEntries(&entries); EXPECT_LT(0u, entries.size()); diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc index 391fb61..e54259d 100644 --- a/net/socket/client_socket_pool_base_unittest.cc +++ b/net/socket/client_socket_pool_base_unittest.cc @@ -721,7 +721,7 @@ class ClientSocketPoolBaseTest : public testing::Test { ScopedVector<TestSocketRequest>* requests() { return test_base_.requests(); } size_t completion_count() const { return test_base_.completion_count(); } - CapturingNetLog net_log_; + TestNetLog net_log_; bool connect_backup_jobs_enabled_; bool cleanup_timer_enabled_; MockClientSocketFactory client_socket_factory_; @@ -754,7 +754,7 @@ TEST_F(ClientSocketPoolBaseTest, ConnectJob_NoTimeoutOnSynchronousCompletion) { TEST_F(ClientSocketPoolBaseTest, ConnectJob_TimedOut) { TestConnectJobDelegate delegate; ClientSocketHandle ignored; - CapturingNetLog log; + TestNetLog log; TestClientSocketPoolBase::Request request( &ignored, CompletionCallback(), DEFAULT_PRIORITY, @@ -773,7 +773,7 @@ TEST_F(ClientSocketPoolBaseTest, ConnectJob_TimedOut) { base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1)); EXPECT_EQ(ERR_TIMED_OUT, delegate.WaitForResult()); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_EQ(6u, entries.size()); @@ -798,7 +798,7 @@ TEST_F(ClientSocketPoolBaseTest, BasicSynchronous) { TestCompletionCallback callback; ClientSocketHandle handle; - CapturingBoundNetLog log; + BoundTestNetLog log; TestLoadTimingInfoNotConnected(handle); EXPECT_EQ(OK, @@ -815,7 +815,7 @@ TEST_F(ClientSocketPoolBaseTest, BasicSynchronous) { handle.Reset(); TestLoadTimingInfoNotConnected(handle); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_EQ(4u, entries.size()); @@ -835,7 +835,7 @@ TEST_F(ClientSocketPoolBaseTest, InitConnectionFailure) { CreatePool(kDefaultMaxSockets, kDefaultMaxSocketsPerGroup); connect_job_factory_->set_job_type(TestConnectJob::kMockFailingJob); - CapturingBoundNetLog log; + BoundTestNetLog log; ClientSocketHandle handle; TestCompletionCallback callback; @@ -856,7 +856,7 @@ TEST_F(ClientSocketPoolBaseTest, InitConnectionFailure) { EXPECT_TRUE(handle.ssl_error_response_info().headers.get() == NULL); TestLoadTimingInfoNotConnected(handle); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_EQ(3u, entries.size()); @@ -1672,7 +1672,7 @@ TEST_F(ClientSocketPoolBaseTest, BasicAsynchronous) { connect_job_factory_->set_job_type(TestConnectJob::kMockPendingJob); ClientSocketHandle handle; TestCompletionCallback callback; - CapturingBoundNetLog log; + BoundTestNetLog log; int rv = handle.Init("a", params_, LOWEST, @@ -1691,7 +1691,7 @@ TEST_F(ClientSocketPoolBaseTest, BasicAsynchronous) { handle.Reset(); TestLoadTimingInfoNotConnected(handle); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_EQ(4u, entries.size()); @@ -1714,7 +1714,7 @@ TEST_F(ClientSocketPoolBaseTest, connect_job_factory_->set_job_type(TestConnectJob::kMockPendingFailingJob); ClientSocketHandle handle; TestCompletionCallback callback; - CapturingBoundNetLog log; + BoundTestNetLog log; // Set the additional error state members to ensure that they get cleared. handle.set_is_ssl_error(true); HttpResponseInfo info; @@ -1731,7 +1731,7 @@ TEST_F(ClientSocketPoolBaseTest, EXPECT_FALSE(handle.is_ssl_error()); EXPECT_TRUE(handle.ssl_error_response_info().headers.get() == NULL); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_EQ(3u, entries.size()); @@ -1778,7 +1778,7 @@ TEST_F(ClientSocketPoolBaseTest, TwoRequestsCancelOne) { callback.callback(), pool_.get(), BoundNetLog())); - CapturingBoundNetLog log2; + BoundTestNetLog log2; EXPECT_EQ(ERR_IO_PENDING, handle2.Init("a", params_, @@ -2215,7 +2215,7 @@ TEST_F(ClientSocketPoolBaseTest, DisableCleanupTimerReuse) { // Request a new socket. This should reuse the old socket and complete // synchronously. - CapturingBoundNetLog log; + BoundTestNetLog log; rv = handle.Init("a", params_, LOWEST, @@ -2230,7 +2230,7 @@ TEST_F(ClientSocketPoolBaseTest, DisableCleanupTimerReuse) { EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a")); EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a")); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsEntryWithType( entries, 1, NetLog::TYPE_SOCKET_POOL_REUSED_AN_EXISTING_SOCKET)); @@ -2295,7 +2295,7 @@ TEST_F(ClientSocketPoolBaseTest, DisableCleanupTimerNoReuse) { // Request a new socket. This should cleanup the unused and timed out ones. // A new socket will be created rather than reusing the idle one. - CapturingBoundNetLog log; + BoundTestNetLog log; TestCompletionCallback callback3; rv = handle.Init("a", params_, @@ -2312,7 +2312,7 @@ TEST_F(ClientSocketPoolBaseTest, DisableCleanupTimerNoReuse) { EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a")); EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a")); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_FALSE(LogContainsEntryWithType( entries, 1, NetLog::TYPE_SOCKET_POOL_REUSED_AN_EXISTING_SOCKET)); @@ -2374,7 +2374,7 @@ TEST_F(ClientSocketPoolBaseTest, CleanupTimedOutIdleSockets) { // used socket. Request it to make sure that it's used. pool_->CleanupTimedOutIdleSockets(); - CapturingBoundNetLog log; + BoundTestNetLog log; rv = handle.Init("a", params_, LOWEST, @@ -2384,7 +2384,7 @@ TEST_F(ClientSocketPoolBaseTest, CleanupTimedOutIdleSockets) { EXPECT_EQ(OK, rv); EXPECT_TRUE(handle.is_reused()); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsEntryWithType( entries, 1, NetLog::TYPE_SOCKET_POOL_REUSED_AN_EXISTING_SOCKET)); diff --git a/net/socket/socks5_client_socket_unittest.cc b/net/socket/socks5_client_socket_unittest.cc index 6181e4be7..4ee9681 100644 --- a/net/socket/socks5_client_socket_unittest.cc +++ b/net/socket/socks5_client_socket_unittest.cc @@ -44,7 +44,7 @@ class SOCKS5ClientSocketTest : public PlatformTest { protected: const uint16 kNwPort; - CapturingNetLog net_log_; + TestNetLog net_log_; scoped_ptr<SOCKS5ClientSocket> user_sock_; AddressList address_list_; // Filled in by BuildMockSocket() and owned by its return value @@ -146,7 +146,7 @@ TEST_F(SOCKS5ClientSocketTest, CompleteHandshake) { EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_FALSE(user_sock_->IsConnected()); - CapturingNetLog::CapturedEntryList net_log_entries; + TestNetLog::CapturedEntryList net_log_entries; net_log_.GetEntries(&net_log_entries); EXPECT_TRUE(LogContainsBeginEvent(net_log_entries, 0, NetLog::TYPE_SOCKS5_CONNECT)); @@ -270,7 +270,7 @@ TEST_F(SOCKS5ClientSocketTest, PartialReadWrites) { int rv = user_sock_->Connect(callback_.callback()); EXPECT_EQ(ERR_IO_PENDING, rv); - CapturingNetLog::CapturedEntryList net_log_entries; + TestNetLog::CapturedEntryList net_log_entries; net_log_.GetEntries(&net_log_entries); EXPECT_TRUE(LogContainsBeginEvent(net_log_entries, 0, NetLog::TYPE_SOCKS5_CONNECT)); @@ -301,7 +301,7 @@ TEST_F(SOCKS5ClientSocketTest, PartialReadWrites) { int rv = user_sock_->Connect(callback_.callback()); EXPECT_EQ(ERR_IO_PENDING, rv); - CapturingNetLog::CapturedEntryList net_log_entries; + TestNetLog::CapturedEntryList net_log_entries; net_log_.GetEntries(&net_log_entries); EXPECT_TRUE(LogContainsBeginEvent(net_log_entries, 0, NetLog::TYPE_SOCKS5_CONNECT)); @@ -330,7 +330,7 @@ TEST_F(SOCKS5ClientSocketTest, PartialReadWrites) { hostname, 80, &net_log_); int rv = user_sock_->Connect(callback_.callback()); EXPECT_EQ(ERR_IO_PENDING, rv); - CapturingNetLog::CapturedEntryList net_log_entries; + TestNetLog::CapturedEntryList net_log_entries; net_log_.GetEntries(&net_log_entries); EXPECT_TRUE(LogContainsBeginEvent(net_log_entries, 0, NetLog::TYPE_SOCKS5_CONNECT)); @@ -361,7 +361,7 @@ TEST_F(SOCKS5ClientSocketTest, PartialReadWrites) { hostname, 80, &net_log_); int rv = user_sock_->Connect(callback_.callback()); EXPECT_EQ(ERR_IO_PENDING, rv); - CapturingNetLog::CapturedEntryList net_log_entries; + TestNetLog::CapturedEntryList net_log_entries; net_log_.GetEntries(&net_log_entries); EXPECT_TRUE(LogContainsBeginEvent(net_log_entries, 0, NetLog::TYPE_SOCKS5_CONNECT)); diff --git a/net/socket/socks_client_socket_unittest.cc b/net/socket/socks_client_socket_unittest.cc index 920a1ef..ea7f82e 100644 --- a/net/socket/socks_client_socket_unittest.cc +++ b/net/socket/socks_client_socket_unittest.cc @@ -144,7 +144,7 @@ TEST_F(SOCKSClientSocketTest, CompleteHandshake) { MockRead data_reads[] = { MockRead(ASYNC, kSOCKSOkReply, arraysize(kSOCKSOkReply)), MockRead(ASYNC, payload_read.data(), payload_read.size()) }; - CapturingNetLog log; + TestNetLog log; user_sock_ = BuildMockSocket(data_reads, arraysize(data_reads), data_writes, arraysize(data_writes), @@ -159,7 +159,7 @@ TEST_F(SOCKSClientSocketTest, CompleteHandshake) { int rv = user_sock_->Connect(callback_.callback()); EXPECT_EQ(ERR_IO_PENDING, rv); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE( LogContainsBeginEvent(entries, 0, NetLog::TYPE_SOCKS_CONNECT)); @@ -220,7 +220,7 @@ TEST_F(SOCKSClientSocketTest, HandshakeFailures) { MockRead data_reads[] = { MockRead(SYNCHRONOUS, tests[i].fail_reply, arraysize(tests[i].fail_reply)) }; - CapturingNetLog log; + TestNetLog log; user_sock_ = BuildMockSocket(data_reads, arraysize(data_reads), data_writes, arraysize(data_writes), @@ -231,7 +231,7 @@ TEST_F(SOCKSClientSocketTest, HandshakeFailures) { int rv = user_sock_->Connect(callback_.callback()); EXPECT_EQ(ERR_IO_PENDING, rv); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsBeginEvent( entries, 0, NetLog::TYPE_SOCKS_CONNECT)); @@ -257,7 +257,7 @@ TEST_F(SOCKSClientSocketTest, PartialServerReads) { MockRead data_reads[] = { MockRead(ASYNC, kSOCKSPartialReply1, arraysize(kSOCKSPartialReply1)), MockRead(ASYNC, kSOCKSPartialReply2, arraysize(kSOCKSPartialReply2)) }; - CapturingNetLog log; + TestNetLog log; user_sock_ = BuildMockSocket(data_reads, arraysize(data_reads), data_writes, arraysize(data_writes), @@ -267,7 +267,7 @@ TEST_F(SOCKSClientSocketTest, PartialServerReads) { int rv = user_sock_->Connect(callback_.callback()); EXPECT_EQ(ERR_IO_PENDING, rv); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsBeginEvent( entries, 0, NetLog::TYPE_SOCKS_CONNECT)); @@ -295,7 +295,7 @@ TEST_F(SOCKSClientSocketTest, PartialClientWrites) { }; MockRead data_reads[] = { MockRead(ASYNC, kSOCKSOkReply, arraysize(kSOCKSOkReply)) }; - CapturingNetLog log; + TestNetLog log; user_sock_ = BuildMockSocket(data_reads, arraysize(data_reads), data_writes, arraysize(data_writes), @@ -305,7 +305,7 @@ TEST_F(SOCKSClientSocketTest, PartialClientWrites) { int rv = user_sock_->Connect(callback_.callback()); EXPECT_EQ(ERR_IO_PENDING, rv); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsBeginEvent( entries, 0, NetLog::TYPE_SOCKS_CONNECT)); @@ -327,7 +327,7 @@ TEST_F(SOCKSClientSocketTest, FailedSocketRead) { MockRead(ASYNC, kSOCKSOkReply, arraysize(kSOCKSOkReply) - 2), // close connection unexpectedly MockRead(SYNCHRONOUS, 0) }; - CapturingNetLog log; + TestNetLog log; user_sock_ = BuildMockSocket(data_reads, arraysize(data_reads), data_writes, arraysize(data_writes), @@ -337,7 +337,7 @@ TEST_F(SOCKSClientSocketTest, FailedSocketRead) { int rv = user_sock_->Connect(callback_.callback()); EXPECT_EQ(ERR_IO_PENDING, rv); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsBeginEvent( entries, 0, NetLog::TYPE_SOCKS_CONNECT)); @@ -357,7 +357,7 @@ TEST_F(SOCKSClientSocketTest, FailedDNS) { host_resolver_->rules()->AddSimulatedFailure(hostname); - CapturingNetLog log; + TestNetLog log; user_sock_ = BuildMockSocket(NULL, 0, NULL, 0, @@ -367,7 +367,7 @@ TEST_F(SOCKSClientSocketTest, FailedDNS) { int rv = user_sock_->Connect(callback_.callback()); EXPECT_EQ(ERR_IO_PENDING, rv); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsBeginEvent( entries, 0, NetLog::TYPE_SOCKS_CONNECT)); diff --git a/net/socket/ssl_client_socket_openssl_unittest.cc b/net/socket/ssl_client_socket_openssl_unittest.cc index 20d78914..7f3c2b1 100644 --- a/net/socket/ssl_client_socket_openssl_unittest.cc +++ b/net/socket/ssl_client_socket_openssl_unittest.cc @@ -184,7 +184,7 @@ class SSLClientSocketOpenSSLClientAuthTest : public PlatformTest { scoped_ptr<SpawnedTestServer> test_server_; AddressList addr_; TestCompletionCallback callback_; - CapturingNetLog log_; + TestNetLog log_; scoped_ptr<StreamSocket> transport_; scoped_ptr<SSLClientSocket> sock_; }; diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc index e9f7924..a41903e 100644 --- a/net/socket/ssl_client_socket_unittest.cc +++ b/net/socket/ssl_client_socket_unittest.cc @@ -773,7 +773,7 @@ class SSLClientSocketTest : public PlatformTest { scoped_ptr<TransportSecurityState> transport_security_state_; SSLClientSocketContext context_; scoped_ptr<SSLClientSocket> sock_; - CapturingNetLog log_; + TestNetLog log_; private: scoped_ptr<StreamSocket> transport_; @@ -799,7 +799,7 @@ class SSLClientSocketCertRequestInfoTest : public SSLClientSocketTest { return NULL; TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; scoped_ptr<StreamSocket> transport( new TCPClientSocket(addr, &log, NetLog::Source())); int rv = transport->Connect(callback.callback()); @@ -970,7 +970,7 @@ class SSLClientSocketChannelIDTest : public SSLClientSocketTest { // timeout. This means that an SSL connect end event may appear as a socket // write. static bool LogContainsSSLConnectEndEvent( - const CapturingNetLog::CapturedEntryList& log, + const TestNetLog::CapturedEntryList& log, int i) { return LogContainsEndEvent(log, i, NetLog::TYPE_SSL_CONNECT) || LogContainsEvent( @@ -999,7 +999,7 @@ TEST_F(SSLClientSocketTest, Connect) { ASSERT_TRUE(test_server.GetAddressList(&addr)); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; scoped_ptr<StreamSocket> transport( new TCPClientSocket(addr, &log, NetLog::Source())); int rv = transport->Connect(callback.callback()); @@ -1014,7 +1014,7 @@ TEST_F(SSLClientSocketTest, Connect) { rv = sock->Connect(callback.callback()); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsBeginEvent(entries, 5, NetLog::TYPE_SSL_CONNECT)); if (rv == ERR_IO_PENDING) @@ -1041,7 +1041,7 @@ TEST_F(SSLClientSocketTest, ConnectExpired) { ASSERT_TRUE(test_server.GetAddressList(&addr)); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; scoped_ptr<StreamSocket> transport( new TCPClientSocket(addr, &log, NetLog::Source())); int rv = transport->Connect(callback.callback()); @@ -1056,7 +1056,7 @@ TEST_F(SSLClientSocketTest, ConnectExpired) { rv = sock->Connect(callback.callback()); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsBeginEvent(entries, 5, NetLog::TYPE_SSL_CONNECT)); if (rv == ERR_IO_PENDING) @@ -1085,7 +1085,7 @@ TEST_F(SSLClientSocketTest, ConnectMismatched) { ASSERT_TRUE(test_server.GetAddressList(&addr)); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; scoped_ptr<StreamSocket> transport( new TCPClientSocket(addr, &log, NetLog::Source())); int rv = transport->Connect(callback.callback()); @@ -1100,7 +1100,7 @@ TEST_F(SSLClientSocketTest, ConnectMismatched) { rv = sock->Connect(callback.callback()); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsBeginEvent(entries, 5, NetLog::TYPE_SSL_CONNECT)); if (rv == ERR_IO_PENDING) @@ -1129,7 +1129,7 @@ TEST_F(SSLClientSocketTest, ConnectClientAuthCertRequested) { ASSERT_TRUE(test_server.GetAddressList(&addr)); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; scoped_ptr<StreamSocket> transport( new TCPClientSocket(addr, &log, NetLog::Source())); int rv = transport->Connect(callback.callback()); @@ -1144,7 +1144,7 @@ TEST_F(SSLClientSocketTest, ConnectClientAuthCertRequested) { rv = sock->Connect(callback.callback()); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsBeginEvent(entries, 5, NetLog::TYPE_SSL_CONNECT)); if (rv == ERR_IO_PENDING) @@ -1188,7 +1188,7 @@ TEST_F(SSLClientSocketTest, ConnectClientAuthSendNullCert) { ASSERT_TRUE(test_server.GetAddressList(&addr)); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; scoped_ptr<StreamSocket> transport( new TCPClientSocket(addr, &log, NetLog::Source())); int rv = transport->Connect(callback.callback()); @@ -1209,7 +1209,7 @@ TEST_F(SSLClientSocketTest, ConnectClientAuthSendNullCert) { // TODO(davidben): Add a test which requires them and verify the error. rv = sock->Connect(callback.callback()); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsBeginEvent(entries, 5, NetLog::TYPE_SSL_CONNECT)); if (rv == ERR_IO_PENDING) @@ -2105,7 +2105,7 @@ TEST_F(SSLClientSocketTest, Read_FullLogging) { ASSERT_TRUE(test_server.GetAddressList(&addr)); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; log.SetLogLevel(NetLog::LOG_ALL); scoped_ptr<StreamSocket> transport( new TCPClientSocket(addr, &log, NetLog::Source())); @@ -2136,7 +2136,7 @@ TEST_F(SSLClientSocketTest, Read_FullLogging) { rv = callback.WaitForResult(); EXPECT_EQ(static_cast<int>(arraysize(request_text) - 1), rv); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); size_t last_index = ExpectLogContainsSomewhereAfter( entries, 5, NetLog::TYPE_SSL_SOCKET_BYTES_SENT, NetLog::PHASE_NONE); @@ -2230,7 +2230,7 @@ TEST_F(SSLClientSocketTest, CipherSuiteDisables) { ASSERT_TRUE(test_server.GetAddressList(&addr)); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; scoped_ptr<StreamSocket> transport( new TCPClientSocket(addr, &log, NetLog::Source())); int rv = transport->Connect(callback.callback()); @@ -2248,7 +2248,7 @@ TEST_F(SSLClientSocketTest, CipherSuiteDisables) { EXPECT_FALSE(sock->IsConnected()); rv = sock->Connect(callback.callback()); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsBeginEvent(entries, 5, NetLog::TYPE_SSL_CONNECT)); @@ -2529,7 +2529,7 @@ TEST_F(SSLClientSocketTest, VerifyReturnChainProperlyOrdered) { ASSERT_TRUE(test_server.GetAddressList(&addr)); TestCompletionCallback callback; - CapturingNetLog log; + TestNetLog log; scoped_ptr<StreamSocket> transport( new TCPClientSocket(addr, &log, NetLog::Source())); int rv = transport->Connect(callback.callback()); @@ -2542,7 +2542,7 @@ TEST_F(SSLClientSocketTest, VerifyReturnChainProperlyOrdered) { EXPECT_FALSE(sock->IsConnected()); rv = sock->Connect(callback.callback()); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_TRUE(LogContainsBeginEvent(entries, 5, NetLog::TYPE_SSL_CONNECT)); if (rv == ERR_IO_PENDING) diff --git a/net/socket/transport_client_socket_pool_unittest.cc b/net/socket/transport_client_socket_pool_unittest.cc index 938941b..a14e4ef 100644 --- a/net/socket/transport_client_socket_pool_unittest.cc +++ b/net/socket/transport_client_socket_pool_unittest.cc @@ -16,7 +16,7 @@ #include "net/base/net_util.h" #include "net/base/test_completion_callback.h" #include "net/dns/mock_host_resolver.h" -#include "net/log/capturing_net_log.h" +#include "net/log/test_net_log.h" #include "net/socket/client_socket_handle.h" #include "net/socket/socket_test_util.h" #include "net/socket/stream_socket.h" @@ -90,7 +90,7 @@ class TransportClientSocketPoolTest : public testing::Test { size_t completion_count() const { return test_base_.completion_count(); } bool connect_backup_jobs_enabled_; - CapturingNetLog net_log_; + TestNetLog net_log_; scoped_refptr<TransportSocketParams> params_; scoped_ptr<MockHostResolver> host_resolver_; MockTransportClientSocketFactory client_socket_factory_; diff --git a/net/socket/transport_client_socket_unittest.cc b/net/socket/transport_client_socket_unittest.cc index 0e2f11d..e481b4f 100644 --- a/net/socket/transport_client_socket_unittest.cc +++ b/net/socket/transport_client_socket_unittest.cc @@ -90,7 +90,7 @@ class TransportClientSocketTest protected: uint16 listen_port_; - CapturingNetLog net_log_; + TestNetLog net_log_; ClientSocketFactory* const socket_factory_; scoped_ptr<StreamSocket> sock_; @@ -185,7 +185,7 @@ TEST_P(TransportClientSocketTest, Connect) { int rv = sock_->Connect(callback.callback()); - net::CapturingNetLog::CapturedEntryList net_log_entries; + net::TestNetLog::CapturedEntryList net_log_entries; net_log_.GetEntries(&net_log_entries); EXPECT_TRUE(net::LogContainsBeginEvent( net_log_entries, 0, net::NetLog::TYPE_SOCKET_ALIVE)); diff --git a/net/socket/websocket_transport_client_socket_pool_unittest.cc b/net/socket/websocket_transport_client_socket_pool_unittest.cc index 31e8c94..2df6606 100644 --- a/net/socket/websocket_transport_client_socket_pool_unittest.cc +++ b/net/socket/websocket_transport_client_socket_pool_unittest.cc @@ -22,7 +22,7 @@ #include "net/base/net_util.h" #include "net/base/test_completion_callback.h" #include "net/dns/mock_host_resolver.h" -#include "net/log/capturing_net_log.h" +#include "net/log/test_net_log.h" #include "net/socket/client_socket_handle.h" #include "net/socket/socket_test_util.h" #include "net/socket/stream_socket.h" @@ -103,7 +103,7 @@ class WebSocketTransportClientSocketPoolTest : public ::testing::Test { ScopedVector<TestSocketRequest>* requests() { return test_base_.requests(); } size_t completion_count() const { return test_base_.completion_count(); } - CapturingNetLog net_log_; + TestNetLog net_log_; scoped_refptr<TransportSocketParams> params_; scoped_ptr<MockHostResolver> host_resolver_; MockTransportClientSocketFactory client_socket_factory_; diff --git a/net/spdy/spdy_http_stream_unittest.cc b/net/spdy/spdy_http_stream_unittest.cc index e76aa6e..55f5b36 100644 --- a/net/spdy/spdy_http_stream_unittest.cc +++ b/net/spdy/spdy_http_stream_unittest.cc @@ -21,7 +21,7 @@ #include "net/http/http_request_info.h" #include "net/http/http_response_headers.h" #include "net/http/http_response_info.h" -#include "net/log/capturing_net_log.h" +#include "net/log/test_net_log.h" #include "net/socket/next_proto.h" #include "net/socket/socket_test_util.h" #include "net/spdy/spdy_http_utils.h" @@ -103,7 +103,7 @@ class SpdyHttpStreamTest : public testing::Test, const std::string& proof); SpdyTestUtil spdy_util_; - CapturingNetLog net_log_; + TestNetLog net_log_; SpdySessionDependencies session_deps_; scoped_ptr<DeterministicSocketData> deterministic_data_; scoped_refptr<HttpNetworkSession> http_session_; diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc index d38bfed..e8d8e0b 100644 --- a/net/spdy/spdy_network_transaction_unittest.cc +++ b/net/spdy/spdy_network_transaction_unittest.cc @@ -3653,7 +3653,7 @@ TEST_P(SpdyNetworkTransactionTest, NetLog) { MockRead(ASYNC, 0, 0) // EOF }; - CapturingBoundNetLog log; + BoundTestNetLog log; DelayedSocketData data(1, reads, arraysize(reads), writes, arraysize(writes)); @@ -3670,7 +3670,7 @@ TEST_P(SpdyNetworkTransactionTest, NetLog) { // This test is intentionally non-specific about the exact ordering of the // log; instead we just check to make sure that certain events exist, and that // they are in the right order. - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_LT(0u, entries.size()); diff --git a/net/spdy/spdy_proxy_client_socket_unittest.cc b/net/spdy/spdy_proxy_client_socket_unittest.cc index c870f18..14d98dc 100644 --- a/net/spdy/spdy_proxy_client_socket_unittest.cc +++ b/net/spdy/spdy_proxy_client_socket_unittest.cc @@ -13,9 +13,9 @@ #include "net/dns/mock_host_resolver.h" #include "net/http/http_response_headers.h" #include "net/http/http_response_info.h" -#include "net/log/capturing_net_log.h" #include "net/log/net_log.h" #include "net/log/net_log_unittest.h" +#include "net/log/test_net_log.h" #include "net/socket/client_socket_factory.h" #include "net/socket/next_proto.h" #include "net/socket/socket_test_util.h" @@ -119,7 +119,7 @@ class SpdyProxyClientSocketTest TestCompletionCallback read_callback_; TestCompletionCallback write_callback_; scoped_ptr<DeterministicSocketData> data_; - CapturingBoundNetLog net_log_; + BoundTestNetLog net_log_; private: scoped_refptr<HttpNetworkSession> session_; @@ -1274,7 +1274,7 @@ TEST_P(SpdyProxyClientSocketTest, NetLog) { NetLog::Source sock_source = sock_->NetLog().source(); sock_.reset(); - CapturingNetLog::CapturedEntryList entry_list; + TestNetLog::CapturedEntryList entry_list; net_log_.GetEntriesForSource(sock_source, &entry_list); ASSERT_EQ(entry_list.size(), 10u); diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc index f4b5dec..af8ba39 100644 --- a/net/spdy/spdy_session_unittest.cc +++ b/net/spdy/spdy_session_unittest.cc @@ -1610,7 +1610,7 @@ TEST_P(SpdySessionTest, ClearSettingsStorageOnIPAddressChanged) { } TEST_P(SpdySessionTest, Initialize) { - CapturingBoundNetLog log; + BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); session_deps_.host_resolver->set_synchronous_mode(true); @@ -1632,7 +1632,7 @@ TEST_P(SpdySessionTest, Initialize) { // Flush the read completion task. base::MessageLoop::current()->RunUntilIdle(); - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_LT(0u, entries.size()); @@ -1642,7 +1642,7 @@ TEST_P(SpdySessionTest, Initialize) { net::NetLog::PHASE_NONE); EXPECT_LT(0, pos); - CapturingNetLog::CapturedEntry entry = entries[pos]; + TestNetLog::CapturedEntry entry = entries[pos]; NetLog::Source socket_source; EXPECT_TRUE(NetLog::Source::FromEventParameters(entry.params.get(), &socket_source)); @@ -1666,7 +1666,7 @@ TEST_P(SpdySessionTest, NetLogOnSessionGoaway) { CreateNetworkSession(); - CapturingBoundNetLog log; + BoundTestNetLog log; base::WeakPtr<SpdySession> session = CreateInsecureSpdySession(http_session_, key_, log.bound()); EXPECT_TRUE(HasSpdySession(spdy_session_pool_, key_)); @@ -1678,7 +1678,7 @@ TEST_P(SpdySessionTest, NetLogOnSessionGoaway) { EXPECT_TRUE(session == NULL); // Check that the NetLog was filled reasonably. - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_LT(0u, entries.size()); @@ -1688,7 +1688,7 @@ TEST_P(SpdySessionTest, NetLogOnSessionGoaway) { net::NetLog::PHASE_NONE); if (pos < static_cast<int>(entries.size())) { - CapturingNetLog::CapturedEntry entry = entries[pos]; + TestNetLog::CapturedEntry entry = entries[pos]; int error_code = 0; ASSERT_TRUE(entry.GetNetErrorCode(&error_code)); EXPECT_EQ(OK, error_code); @@ -1711,7 +1711,7 @@ TEST_P(SpdySessionTest, NetLogOnSessionEOF) { CreateNetworkSession(); - CapturingBoundNetLog log; + BoundTestNetLog log; base::WeakPtr<SpdySession> session = CreateInsecureSpdySession(http_session_, key_, log.bound()); EXPECT_TRUE(HasSpdySession(spdy_session_pool_, key_)); @@ -1723,7 +1723,7 @@ TEST_P(SpdySessionTest, NetLogOnSessionEOF) { EXPECT_TRUE(session == NULL); // Check that the NetLog was filled reasonably. - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_LT(0u, entries.size()); @@ -1733,7 +1733,7 @@ TEST_P(SpdySessionTest, NetLogOnSessionEOF) { net::NetLog::PHASE_NONE); if (pos < static_cast<int>(entries.size())) { - CapturingNetLog::CapturedEntry entry = entries[pos]; + TestNetLog::CapturedEntry entry = entries[pos]; int error_code = 0; ASSERT_TRUE(entry.GetNetErrorCode(&error_code)); EXPECT_EQ(ERR_CONNECTION_CLOSED, error_code); diff --git a/net/spdy/spdy_stream_unittest.cc b/net/spdy/spdy_stream_unittest.cc index 22029d0..fc8d35f 100644 --- a/net/spdy/spdy_stream_unittest.cc +++ b/net/spdy/spdy_stream_unittest.cc @@ -254,7 +254,7 @@ TEST_P(SpdyStreamTest, StreamError) { AddReadEOF(); - CapturingBoundNetLog log; + BoundTestNetLog log; DeterministicSocketData data(GetReads(), GetNumReads(), GetWrites(), GetNumWrites()); @@ -294,7 +294,7 @@ TEST_P(SpdyStreamTest, StreamError) { EXPECT_TRUE(data.at_write_eof()); // Check that the NetLog was filled reasonably. - net::CapturingNetLog::CapturedEntryList entries; + net::TestNetLog::CapturedEntryList entries; log.GetEntries(&entries); EXPECT_LT(0u, entries.size()); @@ -738,7 +738,7 @@ TEST_P(SpdyStreamTest, IncreaseSendWindowSizeOverflow) { AddReadEOF(); - CapturingBoundNetLog log; + BoundTestNetLog log; DeterministicSocketData data(GetReads(), GetNumReads(), GetWrites(), GetNumWrites()); diff --git a/net/udp/udp_socket_perftest.cc b/net/udp/udp_socket_perftest.cc index 5a85dcb..df36c46 100644 --- a/net/udp/udp_socket_perftest.cc +++ b/net/udp/udp_socket_perftest.cc @@ -91,7 +91,7 @@ void UDPSocketPerfTest::WriteBenchmark(bool use_nonblocking_io) { // Setup the server to listen. net::IPEndPoint bind_address; CreateUDPAddress("127.0.0.1", kPort, &bind_address); - net::CapturingNetLog server_log; + net::TestNetLog server_log; scoped_ptr<net::UDPServerSocket> server( new net::UDPServerSocket(&server_log, net::NetLog::Source())); #if defined(OS_WIN) @@ -104,7 +104,7 @@ void UDPSocketPerfTest::WriteBenchmark(bool use_nonblocking_io) { // Setup the client. net::IPEndPoint server_address; CreateUDPAddress("127.0.0.1", kPort, &server_address); - net::CapturingNetLog client_log; + net::TestNetLog client_log; scoped_ptr<net::UDPClientSocket> client(new net::UDPClientSocket( net::DatagramSocket::DEFAULT_BIND, net::RandIntCallback(), &client_log, net::NetLog::Source())); diff --git a/net/udp/udp_socket_unittest.cc b/net/udp/udp_socket_unittest.cc index f1bff68..d422e4a 100644 --- a/net/udp/udp_socket_unittest.cc +++ b/net/udp/udp_socket_unittest.cc @@ -149,7 +149,7 @@ void UDPSocketTest::ConnectTest(bool use_nonblocking_io) { // Setup the server to listen. IPEndPoint bind_address; CreateUDPAddress("127.0.0.1", kPort, &bind_address); - CapturingNetLog server_log; + TestNetLog server_log; scoped_ptr<UDPServerSocket> server( new UDPServerSocket(&server_log, NetLog::Source())); #if defined(OS_WIN) @@ -163,7 +163,7 @@ void UDPSocketTest::ConnectTest(bool use_nonblocking_io) { // Setup the client. IPEndPoint server_address; CreateUDPAddress("127.0.0.1", kPort, &server_address); - CapturingNetLog client_log; + TestNetLog client_log; scoped_ptr<UDPClientSocket> client( new UDPClientSocket(DatagramSocket::DEFAULT_BIND, RandIntCallback(), &client_log, NetLog::Source())); @@ -213,7 +213,7 @@ void UDPSocketTest::ConnectTest(bool use_nonblocking_io) { client.reset(); // Check the server's log. - CapturingNetLog::CapturedEntryList server_entries; + TestNetLog::CapturedEntryList server_entries; server_log.GetEntries(&server_entries); EXPECT_EQ(5u, server_entries.size()); EXPECT_TRUE( @@ -228,7 +228,7 @@ void UDPSocketTest::ConnectTest(bool use_nonblocking_io) { LogContainsEndEvent(server_entries, 4, NetLog::TYPE_SOCKET_ALIVE)); // Check the client's log. - CapturingNetLog::CapturedEntryList client_entries; + TestNetLog::CapturedEntryList client_entries; client_log.GetEntries(&client_entries); EXPECT_EQ(7u, client_entries.size()); EXPECT_TRUE( @@ -277,7 +277,7 @@ TEST_F(UDPSocketTest, Broadcast) { IPEndPoint listen_address; CreateUDPAddress("0.0.0.0", kPort, &listen_address); - CapturingNetLog server1_log, server2_log; + TestNetLog server1_log, server2_log; scoped_ptr<UDPServerSocket> server1( new UDPServerSocket(&server1_log, NetLog::Source())); scoped_ptr<UDPServerSocket> server2( diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 5996500..9b0d312 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -58,9 +58,9 @@ #include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" #include "net/http/http_util.h" -#include "net/log/capturing_net_log.h" #include "net/log/net_log.h" #include "net/log/net_log_unittest.h" +#include "net/log/test_net_log.h" #include "net/proxy/proxy_service.h" #include "net/socket/ssl_client_socket.h" #include "net/ssl/ssl_cipher_suite_names.h" @@ -655,7 +655,7 @@ class URLRequestTest : public PlatformTest { } protected: - CapturingNetLog net_log_; + TestNetLog net_log_; TestNetworkDelegate default_network_delegate_; // Must outlive URLRequest. URLRequestJobFactoryImpl* job_factory_impl_; scoped_ptr<URLRequestJobFactory> job_factory_; @@ -4163,8 +4163,8 @@ class AsyncDelegateLogger : public base::RefCounted<AsyncDelegateLogger> { // DELEGATE_INFO NetLog events that an AsyncDelegateLogger should have // recorded. Returns the index of entry after the expected number of // events this logged, or entries.size() if there aren't enough entries. - static size_t CheckDelegateInfo( - const CapturingNetLog::CapturedEntryList& entries, size_t log_position) { + static size_t CheckDelegateInfo(const TestNetLog::CapturedEntryList& entries, + size_t log_position) { // There should be 4 DELEGATE_INFO events: Two begins and two ends. if (log_position + 3 >= entries.size()) { ADD_FAILURE() << "Not enough log entries"; @@ -4198,7 +4198,7 @@ class AsyncDelegateLogger : public base::RefCounted<AsyncDelegateLogger> { // Find delegate request begin and end messages for OnBeforeNetworkStart. // Returns the position of the end message. static size_t ExpectBeforeNetworkEvents( - const CapturingNetLog::CapturedEntryList& entries, + const TestNetLog::CapturedEntryList& entries, size_t log_position) { log_position = ExpectLogContainsSomewhereAfter(entries, @@ -4465,7 +4465,7 @@ TEST_F(URLRequestTestHTTP, DelegateInfoBeforeStart) { EXPECT_EQ(URLRequestStatus::SUCCESS, r->status().status()); } - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log_.GetEntries(&entries); size_t log_position = ExpectLogContainsSomewhereAfter( entries, @@ -4510,7 +4510,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateInfo) { EXPECT_EQ(1, network_delegate.destroyed_requests()); size_t log_position = 0; - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log_.GetEntries(&entries); for (size_t i = 0; i < 3; ++i) { log_position = ExpectLogContainsSomewhereAfter( @@ -4567,7 +4567,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateInfoRedirect) { EXPECT_EQ(1, network_delegate.destroyed_requests()); size_t log_position = 0; - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log_.GetEntries(&entries); // The NetworkDelegate logged information in OnBeforeURLRequest, // OnBeforeSendHeaders, and OnHeadersReceived. @@ -4649,7 +4649,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateInfoAuth) { EXPECT_EQ(1, network_delegate.destroyed_requests()); size_t log_position = 0; - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log_.GetEntries(&entries); // The NetworkDelegate should have logged information in OnBeforeURLRequest, // OnBeforeSendHeaders, OnHeadersReceived, OnAuthRequired, and then again in @@ -4706,7 +4706,7 @@ TEST_F(URLRequestTestHTTP, URLRequestDelegateInfo) { EXPECT_EQ(URLRequestStatus::SUCCESS, r->status().status()); } - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log_.GetEntries(&entries); size_t log_position = 0; @@ -4759,7 +4759,7 @@ TEST_F(URLRequestTestHTTP, URLRequestDelegateInfoOnRedirect) { EXPECT_EQ(URLRequestStatus::SUCCESS, r->status().status()); } - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log_.GetEntries(&entries); // Delegate info should only have been logged in OnReceivedRedirect and @@ -4806,7 +4806,7 @@ TEST_F(URLRequestTestHTTP, URLRequestDelegateOnRedirectCancelled) { ++test_case) { AsyncLoggingUrlRequestDelegate request_delegate(kCancelStages[test_case]); TestURLRequestContext context(true); - CapturingNetLog net_log; + TestNetLog net_log; context.set_network_delegate(NULL); context.set_net_log(&net_log); context.Init(); @@ -4821,7 +4821,7 @@ TEST_F(URLRequestTestHTTP, URLRequestDelegateOnRedirectCancelled) { EXPECT_EQ(URLRequestStatus::CANCELED, r->status().status()); } - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log.GetEntries(&entries); // Delegate info is always logged in both OnReceivedRedirect and @@ -7265,7 +7265,7 @@ TEST_F(HTTPSRequestTest, HTTPSExpiredTest) { // Tests that servers which require a deprecated cipher suite still work. TEST_F(HTTPSRequestTest, CipherFallbackTest) { - CapturingNetLog net_log; + TestNetLog net_log; default_context_.set_net_log(&net_log); SpawnedTestServer::SSLOptions ssl_options; @@ -7301,7 +7301,7 @@ TEST_F(HTTPSRequestTest, CipherFallbackTest) { EXPECT_EQ(expected_version, SSLConnectionStatusToVersion(r->ssl_info().connection_status)); - CapturingNetLog::CapturedEntryList entries; + TestNetLog::CapturedEntryList entries; net_log.GetEntries(&entries); ExpectLogContainsSomewhere(entries, 0, NetLog::TYPE_SSL_CIPHER_FALLBACK, NetLog::PHASE_NONE); diff --git a/net/websockets/websocket_basic_stream_test.cc b/net/websockets/websocket_basic_stream_test.cc index aca04b0..69aab3c 100644 --- a/net/websockets/websocket_basic_stream_test.cc +++ b/net/websockets/websocket_basic_stream_test.cc @@ -16,7 +16,7 @@ #include "base/big_endian.h" #include "base/port.h" #include "net/base/test_completion_callback.h" -#include "net/log/capturing_net_log.h" +#include "net/log/test_net_log.h" #include "net/socket/socket_test_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -75,7 +75,7 @@ WebSocketMaskingKey GenerateNonNulMaskingKey() { return kNonNulMaskingKey; } class WebSocketBasicStreamTest : public ::testing::Test { protected: scoped_ptr<WebSocketBasicStream> stream_; - CapturingNetLog net_log_; + TestNetLog net_log_; }; // A subclass of StaticSocketDataProvider modified to require that all data @@ -164,7 +164,7 @@ class WebSocketBasicStreamSocketTest : public WebSocketBasicStreamTest { scoped_ptr<SocketDataProvider> socket_data_; MockClientSocketFactory factory_; MockTransportClientSocketPool pool_; - CapturingBoundNetLog(bound_net_log_); + BoundTestNetLog(bound_net_log_); ScopedVector<WebSocketFrame> frames_; TestCompletionCallback cb_; scoped_refptr<GrowableIOBuffer> http_read_buffer_; |