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

Unified Diff: net/url_request/url_request_test_job.h

Issue 2552463002: Add more ResourceLoaderTests (Closed)
Patch Set: Fix 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 | « content/browser/loader/test_resource_handler.cc ('k') | net/url_request/url_request_test_job.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_job.h
diff --git a/net/url_request/url_request_test_job.h b/net/url_request/url_request_test_job.h
index 0f327236848a4dec9e0d2ccd2b675368968ac3c6..708267890451fbd24efa8f0ad81466f1cc1bd65c 100644
--- a/net/url_request/url_request_test_job.h
+++ b/net/url_request/url_request_test_job.h
@@ -63,13 +63,28 @@ class NET_EXPORT_PRIVATE URLRequestTestJob : public URLRequestJob {
// The canned URLs this handler will respond to without having been
// explicitly initialized with response headers and data.
- // FIXME(brettw): we should probably also have a redirect one
+
+ // URL that, by default, automatically advances through each state. Reads
+ // complete synchronously.
static GURL test_url_1();
+
+ // URLs that, by default, must be manually advanced through each state.
static GURL test_url_2();
static GURL test_url_3();
static GURL test_url_4();
+
+ // URL that, by default, automatically advances through each state. Reads
+ // complete asynchronously. Has same response body as test_url_1(), which is
+ // (test_data_1()).
+ static GURL test_url_auto_advance_async_reads_1();
+
+ // URL that fails with ERR_INVALID_URL.
static GURL test_url_error();
+
+ // Redirects to test_url_1().
static GURL test_url_redirect_to_url_1();
+
+ // Redirects to test_url_2().
static GURL test_url_redirect_to_url_2();
// The data that corresponds to each of the URLs above
@@ -151,6 +166,10 @@ class NET_EXPORT_PRIVATE URLRequestTestJob : public URLRequestJob {
// Assigns |response_headers_| and |response_headers_length_|.
void SetResponseHeaders(const std::string& response_headers);
+ // Copies as much of the response body as will into |buf|, and returns number
+ // of bytes written.
+ int CopyDataForRead(IOBuffer* buf, int buf_size);
+
bool auto_advance_;
Stage stage_;
@@ -178,6 +197,8 @@ class NET_EXPORT_PRIVATE URLRequestTestJob : public URLRequestJob {
// Original size in bytes of the response headers before decoding.
int response_headers_length_;
+ bool async_reads_;
+
base::WeakPtrFactory<URLRequestTestJob> weak_factory_;
};
« no previous file with comments | « content/browser/loader/test_resource_handler.cc ('k') | net/url_request/url_request_test_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698