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

Issue 8395038: Make test URLFetcher implementations not derive from the URLFetcher implementation, since we want... (Closed)

Created:
9 years, 2 months ago by jam
Modified:
9 years, 1 month ago
Reviewers:
wtc
CC:
chromium-reviews, cbentzel+watch_chromium.org, dpranke-watch+content_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr., willchan no longer on Chromium
Visibility:
Public.

Description

Make test URLFetcher implementations not derive from the URLFetcher implementation, since we want to hide that from chrome completely. SetBackoffDelayForTesting moves from content::UrlFetcher to TestURLFetcher, now that the test objects derive from it. BUG=98716 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=107468

Patch Set 1 : '' #

Patch Set 2 : also do FakeURLFetcher #

Patch Set 3 : also do GaiaAuthFetcherTest #

Patch Set 4 : also do GaiaOAuthClientTest #

Patch Set 5 : also do policy unittest #

Patch Set 6 : also do chromeos #

Patch Set 7 : move factory to its own file and remove Create function from URLFetcher impl #

Total comments: 19
Unified diffs Side-by-side diffs Delta from patch set Stats (+397 lines, -476 lines) Patch
M chrome/browser/autofill/autofill_download_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/mock_url_fetchers.h View 1 2 3 4 5 6 4 chunks +13 lines, -55 lines 0 comments Download
M chrome/browser/chromeos/login/mock_url_fetchers.cc View 1 2 3 4 5 6 8 chunks +42 lines, -109 lines 0 comments Download
M chrome/browser/policy/testing_policy_url_fetcher_factory.h View 1 2 3 4 5 6 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/policy/testing_policy_url_fetcher_factory.cc View 1 2 3 4 5 6 5 chunks +10 lines, -20 lines 0 comments Download
M chrome/common/net/gaia/gaia_auth_fetcher_unittest.h View 1 2 3 4 5 6 3 chunks +9 lines, -23 lines 0 comments Download
M chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc View 1 2 3 4 5 6 3 chunks +14 lines, -36 lines 0 comments Download
M chrome/common/net/gaia/gaia_oauth_client_unittest.cc View 1 2 3 4 5 6 2 chunks +16 lines, -36 lines 0 comments Download
M chrome/service/cloud_print/cloud_print_url_fetcher.h View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/service/cloud_print/cloud_print_url_fetcher.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M content/browser/speech/speech_recognition_request_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/common/net/url_fetcher.h View 1 2 3 4 5 6 5 chunks +6 lines, -31 lines 0 comments Download
M content/common/net/url_fetcher.cc View 1 2 3 4 5 6 7 chunks +14 lines, -25 lines 3 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/url_fetcher.h View 1 2 3 4 5 6 3 chunks +4 lines, -6 lines 6 comments Download
A content/public/common/url_fetcher_factory.h View 1 2 3 4 5 6 1 chunk +29 lines, -0 lines 0 comments Download
M content/test/test_url_fetcher_factory.h View 1 2 3 4 5 6 9 chunks +85 lines, -49 lines 6 comments Download
M content/test/test_url_fetcher_factory.cc View 1 2 3 4 5 6 9 chunks +145 lines, -78 lines 4 comments Download

Messages

Total messages: 7 (0 generated)
jam
9 years, 1 month ago (2011-10-26 21:16:30 UTC) #1
jam
CCing Will: this is what we talked about
9 years, 1 month ago (2011-10-26 21:23:03 UTC) #2
willchan no longer on Chromium
Sounds great. I defer the review to wtc. On Wed, Oct 26, 2011 at 2:23 ...
9 years, 1 month ago (2011-10-26 21:24:42 UTC) #3
wtc
Patch Set 7 LGTM. I did a cursory review, so I'm counting on you to ...
9 years, 1 month ago (2011-10-26 23:34:45 UTC) #4
jam
http://codereview.chromium.org/8395038/diff/9023/content/public/common/url_fetcher.h File content/public/common/url_fetcher.h (left): http://codereview.chromium.org/8395038/diff/9023/content/public/common/url_fetcher.h#oldcode162 content/public/common/url_fetcher.h:162: virtual void SetBackoffDelayForTesting(base::TimeDelta backoff_delay) = 0; On 2011/10/26 23:34:46, ...
9 years, 1 month ago (2011-10-26 23:39:06 UTC) #5
wtc
Review comments on Patch Set 7. I made another pass through this CL. My main ...
9 years, 1 month ago (2011-10-27 21:29:16 UTC) #6
jam
9 years, 1 month ago (2011-10-27 22:34:41 UTC) #7
thanks for the thorough passover, fixes in
http://codereview.chromium.org/8416020/

http://codereview.chromium.org/8395038/diff/9023/content/common/net/url_fetch...
File content/common/net/url_fetcher.cc (right):

http://codereview.chromium.org/8395038/diff/9023/content/common/net/url_fetch...
content/common/net/url_fetcher.cc:467: static content::URLFetcherFactory*
g_factory = NULL;
On 2011/10/27 21:29:16, wtc wrote:
> 
> Just wondering: why did you change this static member to a
> global variable?

because now I need to use it from the static content::URLFetcher method

http://codereview.chromium.org/8395038/diff/9023/content/public/common/url_fe...
File content/public/common/url_fetcher.h (right):

http://codereview.chromium.org/8395038/diff/9023/content/public/common/url_fe...
content/public/common/url_fetcher.h:194: virtual const GURL& GetUrl() const = 0;
On 2011/10/27 21:29:16, wtc wrote:
> 
> Nit: these two methods should be named GetOriginalURL
> and GetURL, in keeping with the way "URL" is spelled in
> URLFetcher.

good point. done.

http://codereview.chromium.org/8395038/diff/9023/content/test/test_url_fetche...
File content/test/test_url_fetcher_factory.cc (right):

http://codereview.chromium.org/8395038/diff/9023/content/test/test_url_fetche...
content/test/test_url_fetcher_factory.cc:31: content::URLFetcherDelegate* d)
On 2011/10/27 21:29:16, wtc wrote:
> 
> The |request_type| argument is not used.  I am not sure if
> we should remove the argument though.

when doing this originally i wasn't sure if it's needed or not. now that we know
that we don't, removed.

http://codereview.chromium.org/8395038/diff/9023/content/test/test_url_fetche...
content/test/test_url_fetcher_factory.cc:238: success ?
net::URLRequestStatus::SUCCESS :net::URLRequestStatus::FAILED,
On 2011/10/27 21:29:16, wtc wrote:
> 
> Add a space before net::URLRequestStatus::FAILED.  You may
> need to fold the line.

Done.

http://codereview.chromium.org/8395038/diff/9023/content/test/test_url_fetche...
File content/test/test_url_fetcher_factory.h (right):

http://codereview.chromium.org/8395038/diff/9023/content/test/test_url_fetche...
content/test/test_url_fetcher_factory.h:32: // URLFetcher. TestURLFetcherFactory
is a URLFetcher::Factory that creates
On 2011/10/27 21:29:16, wtc wrote:
> 
> There are still references to URLFetcher::Factory in the
> comments in this file.  You may want to do a global search
> for that.

Done.

http://codereview.chromium.org/8395038/diff/9023/content/test/test_url_fetche...
content/test/test_url_fetcher_factory.h:53: // might want to use the
FakeUrlFetcher and FakeUrlFetcherFactory classes
On 2011/10/27 21:29:16, wtc wrote:
> 
> Typo: FakeUrlFetcherFactory => FakeURLFetcherFactory
> 
> FakeUrlFetcher may also be a typo.  I found a FakeURLFetcher
> class defined in content/test/test_url_fetcher_factory.cc.

Done.

http://codereview.chromium.org/8395038/diff/9023/content/test/test_url_fetche...
content/test/test_url_fetcher_factory.h:272: class URLFetcherFactory : public
content::URLFetcherFactory {
On 2011/10/27 21:29:16, wtc wrote:
> 
> Although the content namespace disambiguates the two
> URLFetcherFactory classes, this seems like a bad idea.
> Can we avoid using the same name?

sure, good point. i've renamed it to URLFetcherImplFactory to make what it does
obvious 
> 
> One way to solve this problem is to turn content::URLFetcherFactory
> back into a nested type content::URLFetcher::Factory.

the new convention, afaik, is to avoid nested classes, that's why i split it
off.

Powered by Google App Engine
This is Rietveld 408576698