diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 18:18:34 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 18:18:34 +0000 |
commit | c530c85aa67a10aac9a77d10970951633ff686d9 (patch) | |
tree | 5b0943bd7369f48053075a75db9cf6e5a0d1514d /content/test/test_url_fetcher_factory.h | |
parent | b4c95f61571c24ea1fc15fed0eda1269fe75d94b (diff) | |
download | chromium_src-c530c85aa67a10aac9a77d10970951633ff686d9.zip chromium_src-c530c85aa67a10aac9a77d10970951633ff686d9.tar.gz chromium_src-c530c85aa67a10aac9a77d10970951633ff686d9.tar.bz2 |
Convert URLFetcher::Delegates to use an interface in content/public/common. Also remove the old URLFetcher delegate callback while I'm touching all of them.BUG=98716,83592
Review URL: http://codereview.chromium.org/8373021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test/test_url_fetcher_factory.h')
-rw-r--r-- | content/test/test_url_fetcher_factory.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/content/test/test_url_fetcher_factory.h b/content/test/test_url_fetcher_factory.h index 377b5b0..2e7593e 100644 --- a/content/test/test_url_fetcher_factory.h +++ b/content/test/test_url_fetcher_factory.h @@ -57,7 +57,7 @@ class TestURLFetcher : public URLFetcher { TestURLFetcher(int id, const GURL& url, RequestType request_type, - Delegate* d); + content::URLFetcherDelegate* d); virtual ~TestURLFetcher(); // Overriden to do nothing. It is assumed the caller will notify the delegate. @@ -83,7 +83,9 @@ class TestURLFetcher : public URLFetcher { const std::list<std::string>& upload_chunks() const { return chunks_; } // Returns the delegate installed on the URLFetcher. - Delegate* delegate() const { return URLFetcher::delegate(); } + content::URLFetcherDelegate* delegate() const { + return URLFetcher::delegate(); + } void set_url(const GURL& url) { fake_url_ = url; } virtual const GURL& url() const OVERRIDE; @@ -96,6 +98,9 @@ class TestURLFetcher : public URLFetcher { } virtual int response_code() const OVERRIDE; + void set_cookies(const net::ResponseCookies& c) { fake_cookies_ = c; } + virtual const net::ResponseCookies& cookies() const OVERRIDE; + void set_was_fetched_via_proxy(bool flag); void set_response_headers(scoped_refptr<net::HttpResponseHeaders> headers); @@ -107,7 +112,6 @@ class TestURLFetcher : public URLFetcher { void SetResponseFilePath(const FilePath& path); // Override response access functions to return fake data. - virtual const std::string& GetResponseStringRef() const OVERRIDE; virtual bool GetResponseAsString(std::string* out_response_string) const OVERRIDE; virtual bool GetResponseAsFilePath(bool take_ownership, @@ -127,6 +131,7 @@ class TestURLFetcher : public URLFetcher { GURL fake_url_; net::URLRequestStatus fake_status_; int fake_response_code_; + net::ResponseCookies fake_cookies_; std::string fake_response_string_; FilePath fake_response_file_path_; @@ -144,7 +149,7 @@ class TestURLFetcherFactory : public URLFetcher::Factory, virtual URLFetcher* CreateURLFetcher(int id, const GURL& url, URLFetcher::RequestType request_type, - URLFetcher::Delegate* d) OVERRIDE; + content::URLFetcherDelegate* d) OVERRIDE; TestURLFetcher* GetFetcherByID(int id) const; void RemoveFetcherFromMap(int id); @@ -205,7 +210,7 @@ class FakeURLFetcherFactory : public URLFetcher::Factory, virtual URLFetcher* CreateURLFetcher(int id, const GURL& url, URLFetcher::RequestType request_type, - URLFetcher::Delegate* d) OVERRIDE; + content::URLFetcherDelegate* d) OVERRIDE; // Sets the fake response for a given URL. If success is true we will serve // an HTTP/200 and an HTTP/500 otherwise. The |response_data| may be empty. @@ -238,7 +243,7 @@ class URLFetcherFactory : public URLFetcher::Factory { virtual URLFetcher* CreateURLFetcher(int id, const GURL& url, URLFetcher::RequestType request_type, - URLFetcher::Delegate* d) OVERRIDE; + content::URLFetcherDelegate* d) OVERRIDE; }; |