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

Unified Diff: chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc

Issue 8395038: Make test URLFetcher implementations not derive from the URLFetcher implementation, since we want... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: move factory to its own file and remove Create function from URLFetcher impl Created 9 years, 2 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
Index: chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc
===================================================================
--- chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc (revision 107268)
+++ chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc (working copy)
@@ -32,22 +32,22 @@
MockFetcher::MockFetcher(bool success,
const GURL& url,
const std::string& results,
- URLFetcher::RequestType request_type,
+ content::URLFetcher::RequestType request_type,
content::URLFetcherDelegate* d)
- : URLFetcher(url, request_type, d),
- url_(url),
- results_(results) {
+ : TestURLFetcher(0, url, request_type, d) {
+ set_url(url);
net::URLRequestStatus::Status code;
if (success) {
- response_code_ = RC_REQUEST_OK;
+ set_response_code(RC_REQUEST_OK);
code = net::URLRequestStatus::SUCCESS;
} else {
- response_code_ = RC_FORBIDDEN;
+ set_response_code(RC_FORBIDDEN);
code = net::URLRequestStatus::FAILED;
}
- status_ = net::URLRequestStatus(code, 0);
+ set_status(net::URLRequestStatus(code, 0));
+ SetResponseString(results);
}
MockFetcher::MockFetcher(const GURL& url,
@@ -55,14 +55,14 @@
int response_code,
const net::ResponseCookies& cookies,
const std::string& results,
- URLFetcher::RequestType request_type,
+ content::URLFetcher::RequestType request_type,
content::URLFetcherDelegate* d)
- : URLFetcher(url, request_type, d),
- url_(url),
- status_(status),
- response_code_(response_code),
- cookies_(cookies),
- results_(results) {
+ : TestURLFetcher(0, url, request_type, d) {
+ set_url(url);
+ set_status(status);
+ set_response_code(response_code);
+ set_cookies(cookies);
+ SetResponseString(results);
}
MockFetcher::~MockFetcher() {}
@@ -71,28 +71,6 @@
delegate()->OnURLFetchComplete(this);
}
-const GURL& MockFetcher::GetUrl() const {
- return url_;
-}
-
-const net::URLRequestStatus& MockFetcher::GetStatus() const {
- return status_;
-}
-
-int MockFetcher::GetResponseCode() const {
- return response_code_;
-}
-
-const net::ResponseCookies& MockFetcher::GetCookies() const {
- return cookies_;
-}
-
-bool MockFetcher::GetResponseAsString(std::string* out_response_string) const {
- *out_response_string = results_;
- return true;
-}
-
-
class GaiaAuthFetcherTest : public testing::Test {
public:
GaiaAuthFetcherTest()

Powered by Google App Engine
This is Rietveld 408576698