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

Unified Diff: net/url_request/url_request_test_util.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/url_request/url_request_test_util.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_test_util.cc
diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc
index 82d8579f54775a09015c345dd223022e9b1f8bb9..8f70ee73b173f0cbc88818b2e3012472260ad5e5 100644
--- a/net/url_request/url_request_test_util.cc
+++ b/net/url_request/url_request_test_util.cc
@@ -317,11 +317,14 @@ TestNetworkDelegate::TestNetworkDelegate()
blocked_set_cookie_count_(0),
set_cookie_count_(0),
observed_before_proxy_headers_sent_callbacks_(0),
+ before_send_headers_count_(0),
+ headers_received_count_(0),
has_load_timing_info_before_redirect_(false),
has_load_timing_info_before_auth_(false),
can_access_files_(true),
can_throttle_requests_(true),
- cancel_request_with_policy_violating_referrer_(false) {
+ cancel_request_with_policy_violating_referrer_(false),
+ will_be_intercepted_on_next_error_(false) {
}
TestNetworkDelegate::~TestNetworkDelegate() {
@@ -386,7 +389,7 @@ int TestNetworkDelegate::OnBeforeSendHeaders(
next_states_[req_id] =
kStageSendHeaders |
kStageCompletedError; // request canceled by delegate
-
+ before_send_headers_count_++;
return OK;
}
@@ -406,9 +409,11 @@ void TestNetworkDelegate::OnSendHeaders(
event_order_[req_id] += "OnSendHeaders\n";
EXPECT_TRUE(next_states_[req_id] & kStageSendHeaders) <<
event_order_[req_id];
- next_states_[req_id] =
- kStageHeadersReceived |
- kStageCompletedError;
+ if (!will_be_intercepted_on_next_error_)
+ next_states_[req_id] = kStageHeadersReceived | kStageCompletedError;
+ else
+ next_states_[req_id] = kStageResponseStarted;
+ will_be_intercepted_on_next_error_ = false;
}
int TestNetworkDelegate::OnHeadersReceived(
@@ -445,7 +450,7 @@ int TestNetworkDelegate::OnHeadersReceived(
if (!allowed_unsafe_redirect_url_.is_empty())
*allowed_unsafe_redirect_url = allowed_unsafe_redirect_url_;
}
-
+ headers_received_count_++;
return OK;
}
« no previous file with comments | « net/url_request/url_request_test_util.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698