summaryrefslogtreecommitdiffstats
path: root/net/url_request
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 00:25:29 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 00:25:29 +0000
commitab6a5c4dd0c4a16b202567afa28f70c7ebd37ec9 (patch)
treec1527588a21c60861895cd62ecf21895ecd99ccb /net/url_request
parent88e79009f006cf467bdc8de883e2f36b78a06b64 (diff)
downloadchromium_src-ab6a5c4dd0c4a16b202567afa28f70c7ebd37ec9.zip
chromium_src-ab6a5c4dd0c4a16b202567afa28f70c7ebd37ec9.tar.gz
chromium_src-ab6a5c4dd0c4a16b202567afa28f70c7ebd37ec9.tar.bz2
Add LoadLog instrumentation to HttpNetworkTransaction, to tell how much time was spent reading/writing headers and reading/writing body.
Review URL: http://codereview.chromium.org/384098 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31861 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r--net/url_request/url_request_unittest.cc26
1 files changed, 18 insertions, 8 deletions
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index a8b47d2..0877768 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -203,14 +203,24 @@ TEST_F(URLRequestTestHTTP, GetTest_NoCache) {
EXPECT_FALSE(d.received_data_before_response());
EXPECT_NE(0, d.bytes_received());
- // The first and last entries of the LoadLog should be for
- // TYPE_URL_REQUEST_START.
- net::ExpectLogContains(r.load_log(), 0,
- net::LoadLog::TYPE_URL_REQUEST_START,
- net::LoadLog::PHASE_BEGIN);
- net::ExpectLogContains(r.load_log(), r.load_log()->events().size() - 1,
- net::LoadLog::TYPE_URL_REQUEST_START,
- net::LoadLog::PHASE_END);
+ // The first part of the log will be for URL_REQUEST_START.
+ // After that, there should be an HTTP_TRANSACTION_READ_BODY
+ EXPECT_TRUE(
+ net::LogContains(*r.load_log(), 0,
+ net::LoadLog::TYPE_URL_REQUEST_START,
+ net::LoadLog::PHASE_BEGIN));
+ EXPECT_TRUE(
+ net::LogContains(*r.load_log(), -3,
+ net::LoadLog::TYPE_URL_REQUEST_START,
+ net::LoadLog::PHASE_END));
+ EXPECT_TRUE(
+ net::LogContains(*r.load_log(), -2,
+ net::LoadLog::TYPE_HTTP_TRANSACTION_READ_BODY,
+ net::LoadLog::PHASE_BEGIN));
+ EXPECT_TRUE(
+ net::LogContains(*r.load_log(), -1,
+ net::LoadLog::TYPE_HTTP_TRANSACTION_READ_BODY,
+ net::LoadLog::PHASE_END));
}
}