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

Unified Diff: net/spdy/spdy_network_transaction_unittest.cc

Issue 848006: Generalize the net module's LoadLog facility from a passive container, to an event stream (NetLog). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Split up RequestTracker into ConnectJobTracker+RequestTracker+RequestTrackerBase, address comments Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_network_transaction.cc ('k') | net/spdy/spdy_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_network_transaction_unittest.cc
===================================================================
--- net/spdy/spdy_network_transaction_unittest.cc (revision 41560)
+++ net/spdy/spdy_network_transaction_unittest.cc (working copy)
@@ -7,8 +7,8 @@
#include "base/basictypes.h"
#include "base/ref_counted.h"
#include "net/base/completion_callback.h"
-#include "net/base/load_log_unittest.h"
#include "net/base/mock_host_resolver.h"
+#include "net/base/net_log_unittest.h"
#include "net/base/ssl_config_service_defaults.h"
#include "net/base/test_completion_callback.h"
#include "net/base/upload_data.h"
@@ -285,7 +285,7 @@
TransactionHelperResult TransactionHelper(const HttpRequestInfo& request,
DelayedSocketData* data,
- LoadLog* log) {
+ const BoundNetLog& log) {
TransactionHelperResult out;
// We disable SSL for this test.
@@ -1024,8 +1024,8 @@
EnableCompression(false);
}
-// Test that the LoadLog contains good data for a simple GET request.
-TEST_F(SpdyNetworkTransactionTest, LoadLog) {
+// Test that the NetLog contains good data for a simple GET request.
+TEST_F(SpdyNetworkTransactionTest, NetLog) {
MockWrite writes[] = {
MockWrite(true, reinterpret_cast<const char*>(kGetSyn),
arraysize(kGetSyn)),
@@ -1039,7 +1039,7 @@
MockRead(true, 0, 0) // EOF
};
- scoped_refptr<net::LoadLog> log(new net::LoadLog(net::LoadLog::kUnbounded));
+ net::CapturingBoundNetLog log(net::CapturingNetLog::kUnbounded);
HttpRequestInfo request;
request.method = "GET";
@@ -1049,42 +1049,42 @@
new DelayedSocketData(1, reads, arraysize(reads),
writes, arraysize(writes)));
TransactionHelperResult out = TransactionHelper(request, data.get(),
- log);
+ log.bound());
EXPECT_EQ(OK, out.rv);
EXPECT_EQ("HTTP/1.1 200 OK", out.status_line);
EXPECT_EQ("hello!", out.response_data);
- // Check that the LoadLog was filled reasonably.
+ // Check that the NetLog was filled reasonably.
// This test is intentionally non-specific about the exact ordering of
// the log; instead we just check to make sure that certain events exist.
- EXPECT_LT(0u, log->entries().size());
+ EXPECT_LT(0u, log.entries().size());
int pos = 0;
// We know the first event at position 0.
EXPECT_TRUE(net::LogContainsBeginEvent(
- *log, 0, net::LoadLog::TYPE_SPDY_TRANSACTION_INIT_CONNECTION));
+ log.entries(), 0, net::NetLog::TYPE_SPDY_TRANSACTION_INIT_CONNECTION));
// For the rest of the events, allow additional events in the middle,
// but expect these to be logged in order.
- pos = net::ExpectLogContainsSomewhere(log, 0,
- net::LoadLog::TYPE_SPDY_TRANSACTION_INIT_CONNECTION,
- net::LoadLog::PHASE_END);
- pos = net::ExpectLogContainsSomewhere(log, pos + 1,
- net::LoadLog::TYPE_SPDY_TRANSACTION_SEND_REQUEST,
- net::LoadLog::PHASE_BEGIN);
- pos = net::ExpectLogContainsSomewhere(log, pos + 1,
- net::LoadLog::TYPE_SPDY_TRANSACTION_SEND_REQUEST,
- net::LoadLog::PHASE_END);
- pos = net::ExpectLogContainsSomewhere(log, pos + 1,
- net::LoadLog::TYPE_SPDY_TRANSACTION_READ_HEADERS,
- net::LoadLog::PHASE_BEGIN);
- pos = net::ExpectLogContainsSomewhere(log, pos + 1,
- net::LoadLog::TYPE_SPDY_TRANSACTION_READ_HEADERS,
- net::LoadLog::PHASE_END);
- pos = net::ExpectLogContainsSomewhere(log, pos + 1,
- net::LoadLog::TYPE_SPDY_TRANSACTION_READ_BODY,
- net::LoadLog::PHASE_BEGIN);
- pos = net::ExpectLogContainsSomewhere(log, pos + 1,
- net::LoadLog::TYPE_SPDY_TRANSACTION_READ_BODY,
- net::LoadLog::PHASE_END);
+ pos = net::ExpectLogContainsSomewhere(log.entries(), 0,
+ net::NetLog::TYPE_SPDY_TRANSACTION_INIT_CONNECTION,
+ net::NetLog::PHASE_END);
+ pos = net::ExpectLogContainsSomewhere(log.entries(), pos + 1,
+ net::NetLog::TYPE_SPDY_TRANSACTION_SEND_REQUEST,
+ net::NetLog::PHASE_BEGIN);
+ pos = net::ExpectLogContainsSomewhere(log.entries(), pos + 1,
+ net::NetLog::TYPE_SPDY_TRANSACTION_SEND_REQUEST,
+ net::NetLog::PHASE_END);
+ pos = net::ExpectLogContainsSomewhere(log.entries(), pos + 1,
+ net::NetLog::TYPE_SPDY_TRANSACTION_READ_HEADERS,
+ net::NetLog::PHASE_BEGIN);
+ pos = net::ExpectLogContainsSomewhere(log.entries(), pos + 1,
+ net::NetLog::TYPE_SPDY_TRANSACTION_READ_HEADERS,
+ net::NetLog::PHASE_END);
+ pos = net::ExpectLogContainsSomewhere(log.entries(), pos + 1,
+ net::NetLog::TYPE_SPDY_TRANSACTION_READ_BODY,
+ net::NetLog::PHASE_BEGIN);
+ pos = net::ExpectLogContainsSomewhere(log.entries(), pos + 1,
+ net::NetLog::TYPE_SPDY_TRANSACTION_READ_BODY,
+ net::NetLog::PHASE_END);
}
// Since we buffer the IO from the stream to the renderer, this test verifies
« no previous file with comments | « net/spdy/spdy_network_transaction.cc ('k') | net/spdy/spdy_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698