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

Unified Diff: net/http/http_transaction_unittest.cc

Issue 10933022: Revert 153131 (Histograms showed it doesn't help much) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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/http/http_transaction_unittest.h ('k') | net/url_request/url_request_http_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_transaction_unittest.cc
===================================================================
--- net/http/http_transaction_unittest.cc (revision 156013)
+++ net/http/http_transaction_unittest.cc (working copy)
@@ -27,7 +27,6 @@
// mock transaction data
const MockTransaction kSimpleGET_Transaction = {
- net::OK,
"http://www.google.com/",
"GET",
base::Time(),
@@ -43,7 +42,6 @@
};
const MockTransaction kSimplePOST_Transaction = {
- net::OK,
"http://bugdatabase.com/edit",
"POST",
base::Time(),
@@ -59,7 +57,6 @@
};
const MockTransaction kTypicalGET_Transaction = {
- net::OK,
"http://www.example.com/~foo/bar.html",
"GET",
base::Time(),
@@ -76,7 +73,6 @@
};
const MockTransaction kETagGET_Transaction = {
- net::OK,
"http://www.google.com/foopy",
"GET",
base::Time(),
@@ -93,7 +89,6 @@
};
const MockTransaction kRangeGET_Transaction = {
- net::OK,
"http://www.google.com/",
"GET",
base::Time(),
@@ -131,9 +126,6 @@
}
void AddMockTransaction(const MockTransaction* trans) {
- // To return a result asynchronously, set the TEST_MODE_SYNC_NET_START bit
- // of |test_mode|.
- ASSERT_NE(net::ERR_IO_PENDING, trans->start_result);
mock_transactions[GURL(trans->url).spec()] = trans;
}
@@ -238,38 +230,35 @@
if (!t)
return net::ERR_FAILED;
- net::Error result = t->start_result;
- test_mode_ = t->test_mode;
- if (result == net::OK) {
- std::string resp_status = t->status;
- std::string resp_headers = t->response_headers;
- std::string resp_data = t->data;
- if (t->handler)
- (t->handler)(request, &resp_status, &resp_headers, &resp_data);
+ std::string resp_status = t->status;
+ std::string resp_headers = t->response_headers;
+ std::string resp_data = t->data;
+ if (t->handler)
+ (t->handler)(request, &resp_status, &resp_headers, &resp_data);
- std::string header_data = base::StringPrintf(
- "%s\n%s\n", resp_status.c_str(), resp_headers.c_str());
- std::replace(header_data.begin(), header_data.end(), '\n', '\0');
+ std::string header_data = base::StringPrintf(
+ "%s\n%s\n", resp_status.c_str(), resp_headers.c_str());
+ std::replace(header_data.begin(), header_data.end(), '\n', '\0');
- response_.request_time = base::Time::Now();
- if (!t->request_time.is_null())
- response_.request_time = t->request_time;
+ response_.request_time = base::Time::Now();
+ if (!t->request_time.is_null())
+ response_.request_time = t->request_time;
- response_.was_cached = false;
+ response_.was_cached = false;
- response_.response_time = base::Time::Now();
- if (!t->response_time.is_null())
- response_.response_time = t->response_time;
+ response_.response_time = base::Time::Now();
+ if (!t->response_time.is_null())
+ response_.response_time = t->response_time;
- response_.headers = new net::HttpResponseHeaders(header_data);
- response_.ssl_info.cert_status = t->cert_status;
- data_ = resp_data;
- }
+ response_.headers = new net::HttpResponseHeaders(header_data);
+ response_.ssl_info.cert_status = t->cert_status;
+ data_ = resp_data;
+ test_mode_ = t->test_mode;
if (test_mode_ & TEST_MODE_SYNC_NET_START)
- return result;
+ return net::OK;
- CallbackLater(callback, result);
+ CallbackLater(callback, net::OK);
return net::ERR_IO_PENDING;
}
« no previous file with comments | « net/http/http_transaction_unittest.h ('k') | net/url_request/url_request_http_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698