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

Unified Diff: net/url_request/url_request_test_job.cc

Issue 2542843006: ResourceLoader: Fix a bunch of double-cancellation/double-error notification cases. (Closed)
Patch Set: Fix merge Created 4 years 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_job.h ('k') | net/url_request/url_request_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_test_job.cc
diff --git a/net/url_request/url_request_test_job.cc b/net/url_request/url_request_test_job.cc
index 1f5824babc12d245060e0390407cdb257de4aa26..42e8c68fb1d85435e7e05e4ab65aa35f5138de26 100644
--- a/net/url_request/url_request_test_job.cc
+++ b/net/url_request/url_request_test_job.cc
@@ -56,6 +56,9 @@ GURL URLRequestTestJob::test_url_4() {
GURL URLRequestTestJob::test_url_error() {
return GURL("test:error");
}
+GURL URLRequestTestJob::test_url_redirect_to_url_1() {
+ return GURL("test:redirect_to_1");
+}
GURL URLRequestTestJob::test_url_redirect_to_url_2() {
return GURL("test:redirect_to_2");
}
@@ -93,6 +96,17 @@ std::string URLRequestTestJob::test_redirect_headers() {
}
// static getter for redirect response headers
+std::string URLRequestTestJob::test_redirect_to_url_1_headers() {
+ std::string headers = "HTTP/1.1 302 MOVED";
+ headers.push_back('\n');
+ headers += "Location: ";
+ headers += test_url_1().spec();
+ headers.push_back('\n');
+ headers.push_back('\n');
+ return headers;
+}
+
+// static getter for redirect response headers
std::string URLRequestTestJob::test_redirect_to_url_2_headers() {
std::string headers = "HTTP/1.1 302 MOVED";
headers.push_back('\n');
@@ -199,6 +213,8 @@ void URLRequestTestJob::StartAsync() {
response_data_ = test_data_3();
} else if (request_->url().spec() == test_url_4().spec()) {
response_data_ = test_data_4();
+ } else if (request_->url().spec() == test_url_redirect_to_url_1().spec()) {
+ SetResponseHeaders(test_redirect_to_url_1_headers());
} else if (request_->url().spec() == test_url_redirect_to_url_2().spec()) {
SetResponseHeaders(test_redirect_to_url_2_headers());
} else {
« no previous file with comments | « net/url_request/url_request_test_job.h ('k') | net/url_request/url_request_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698