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

Issue 60923002: [sync] Allow FakeURLFetcher to return an arbitrary URLRequestStatus (Closed)

Created:
7 years, 1 month ago by Raghu Simha
Modified:
7 years, 1 month ago
CC:
chromium-reviews, skanuj+watch_chromium.org, weitaosu+watch_chromium.org, nkostylev+watch_chromium.org, dhollowa+watch_chromium.org, dougw+watch_chromium.org, stevenjb+watch_chromium.org, tim+watch_chromium.org, dcaiafa+watch_chromium.org, cbentzel+watch_chromium.org, melevin+watch_chromium.org, dominich, amit, wez+watch_chromium.org, sanjeevr, haitaol+watch_chromium.org, jfweitz+watch_chromium.org, rmsousa+watch_chromium.org, oshima+watch_chromium.org, sergeyu+watch_chromium.org, Jered, jamiewalch+watch_chromium.org, hclam+watch_chromium.org, donnd+watch_chromium.org, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, David Black, samarth+watch_chromium.org, kmadhusu+watch_chromium.org, alexeypa+watch_chromium.org, rsimha+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

[sync] Allow FakeURLFetcher to return an arbitrary URLRequestStatus In r232724, FakeURLFetcher went from being able to return only HTTP/200 or HTTP/500, to being able to return any arbitrary HttpResponseCode. However, the URLRequestStatus returned was hard coded to FAILURE for HTTP/5xx and SUCCESS for all other codes. This patch further modifies FakeURLFetcher to be able to return arbitrary URLRequestStatus values in addition to an HttpResponseCode. We no longer hard code the URLRequestStatus based on the HttpResponseCode being returned. It also updates all call sites that currently use FakeURLFetcher. R=achuith@chromium.org, ajwong@chromium.org, akalin@chromium.org, mattm@chromium.org, mmenke@chromium.org, nyquist@chromium.org, sky@chromium.org, tim@chromium.org, vitalybuka@chromium.org TBR=bengr, sergeyu BUG=313905 TEST=All existing tests pass trybots and waterfall Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=233304

Patch Set 1 : #

Total comments: 2

Patch Set 2 : Address feedback #

Total comments: 4

Patch Set 3 : More feedback #

Patch Set 4 : Rebase #

Total comments: 4

Patch Set 5 : Set correct net::Error, update example. #

Total comments: 6

Patch Set 6 : Fix nits #

Patch Set 7 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+359 lines, -207 lines) Patch
M chrome/browser/chromeos/login/eula_browsertest.cc View 1 4 chunks +8 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc View 1 12 chunks +29 lines, -14 lines 0 comments Download
M chrome/browser/chromeos/policy/device_local_account_browsertest.cc View 1 3 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/local_discovery/cloud_print_printer_list_unittest.cc View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/net/spdyproxy/data_reduction_proxy_settings_unittest.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/notifications/sync_notifier/notification_bitmap_fetcher_browsertest.cc View 4 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/profile_resetter/profile_resetter_unittest.cc View 1 5 chunks +11 lines, -8 lines 0 comments Download
M chrome/browser/safe_browsing/client_side_detection_service_unittest.cc View 1 2 3 20 chunks +62 lines, -38 lines 0 comments Download
M chrome/browser/safe_browsing/download_protection_service_unittest.cc View 12 chunks +13 lines, -13 lines 0 comments Download
M chrome/browser/signin/signin_browsertest.cc View 2 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/sync/test/integration/sync_test.cc View 2 chunks +14 lines, -7 lines 0 comments Download
M chrome/browser/ui/search/instant_extended_interactive_uitest.cc View 3 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc View 1 4 chunks +21 lines, -11 lines 0 comments Download
M chrome/service/cloud_print/printer_job_handler_unittest.cc View 1 2 3 4 9 chunks +51 lines, -26 lines 0 comments Download
M components/dom_distiller/core/distiller_url_fetcher_unittest.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M components/precache/core/precache_fetcher_unittest.cc View 1 2 8 chunks +30 lines, -28 lines 0 comments Download
M net/url_request/test_url_fetcher_factory.h View 1 2 3 4 5 chunks +43 lines, -19 lines 0 comments Download
M net/url_request/test_url_fetcher_factory.cc View 1 2 3 4 5 5 chunks +32 lines, -14 lines 0 comments Download
M remoting/host/token_validator_factory_impl_unittest.cc View 5 chunks +12 lines, -7 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Raghu Simha
Matt / Fred / Tim, please review. This CL fixes the concerns raised in https://codereview.chromium.org/48713008. ...
7 years, 1 month ago (2013-11-05 21:43:27 UTC) #1
akalin
https://codereview.chromium.org/60923002/diff/540001/net/url_request/test_url_fetcher_factory.cc File net/url_request/test_url_fetcher_factory.cc (right): https://codereview.chromium.org/60923002/diff/540001/net/url_request/test_url_fetcher_factory.cc#newcode367 net/url_request/test_url_fetcher_factory.cc:367: response_data, URLRequestStatus(status, response_code)); is the 'error' field in URLRequestStatus ...
7 years, 1 month ago (2013-11-05 22:03:09 UTC) #2
Raghu Simha
https://codereview.chromium.org/60923002/diff/540001/net/url_request/test_url_fetcher_factory.cc File net/url_request/test_url_fetcher_factory.cc (right): https://codereview.chromium.org/60923002/diff/540001/net/url_request/test_url_fetcher_factory.cc#newcode367 net/url_request/test_url_fetcher_factory.cc:367: response_data, URLRequestStatus(status, response_code)); On 2013/11/05 22:03:09, akalin wrote: > ...
7 years, 1 month ago (2013-11-05 22:09:06 UTC) #3
Raghu Simha
Fred, PTAL.
7 years, 1 month ago (2013-11-05 23:00:12 UTC) #4
Raghu Simha
Adding more reviewers for OWNERS approval: ajwong@: chrome/service nyquist@: components/dom_distiller bengr@: components/precache sergeyu@: remoting achuith@: ...
7 years, 1 month ago (2013-11-05 23:00:43 UTC) #5
Vitaly Buka (NO REVIEWS)
lgtm chrome/browser/local_discovery chrome/service/cloud_print/
7 years, 1 month ago (2013-11-05 23:10:14 UTC) #6
sky
c/b/ui LGTM
7 years, 1 month ago (2013-11-05 23:46:50 UTC) #7
achuithb
On 2013/11/05 23:46:50, sky wrote: > c/b/ui LGTM c/b/cros lgtm
7 years, 1 month ago (2013-11-05 23:51:08 UTC) #8
akalin
almost there https://codereview.chromium.org/60923002/diff/900001/components/precache/core/precache_fetcher_unittest.cc File components/precache/core/precache_fetcher_unittest.cc (right): https://codereview.chromium.org/60923002/diff/900001/components/precache/core/precache_fetcher_unittest.cc#newcode39 components/precache/core/precache_fetcher_unittest.cc:39: if (net::HttpStatusCode(request_status.error()) == net::HTTP_OK) { is this ...
7 years, 1 month ago (2013-11-06 00:11:02 UTC) #9
mattm
safe_browsing lgtm
7 years, 1 month ago (2013-11-06 00:17:03 UTC) #10
nyquist
components/dom_distiller/ lgtm
7 years, 1 month ago (2013-11-06 06:50:53 UTC) #11
tim (not reviewing)
Only reviewed sync/, which LGTM
7 years, 1 month ago (2013-11-06 15:25:42 UTC) #12
Raghu Simha
Thanks for the review, everyone. Fred: Feedback addressed. PTAL. https://codereview.chromium.org/60923002/diff/900001/components/precache/core/precache_fetcher_unittest.cc File components/precache/core/precache_fetcher_unittest.cc (right): https://codereview.chromium.org/60923002/diff/900001/components/precache/core/precache_fetcher_unittest.cc#newcode39 components/precache/core/precache_fetcher_unittest.cc:39: ...
7 years, 1 month ago (2013-11-06 15:27:59 UTC) #13
mmenke
https://codereview.chromium.org/60923002/diff/1110001/net/url_request/test_url_fetcher_factory.cc File net/url_request/test_url_fetcher_factory.cc (right): https://codereview.chromium.org/60923002/diff/1110001/net/url_request/test_url_fetcher_factory.cc#newcode290 net/url_request/test_url_fetcher_factory.cc:290: set_status(URLRequestStatus(status, 0)); I think the second parameter should be ...
7 years, 1 month ago (2013-11-06 15:40:11 UTC) #14
Raghu Simha
Matt, PTAL. https://codereview.chromium.org/60923002/diff/1110001/net/url_request/test_url_fetcher_factory.cc File net/url_request/test_url_fetcher_factory.cc (right): https://codereview.chromium.org/60923002/diff/1110001/net/url_request/test_url_fetcher_factory.cc#newcode290 net/url_request/test_url_fetcher_factory.cc:290: set_status(URLRequestStatus(status, 0)); On 2013/11/06 15:40:12, mmenke wrote: ...
7 years, 1 month ago (2013-11-06 16:58:58 UTC) #15
mmenke
LGTM, just a couple tiny suggestions. https://codereview.chromium.org/60923002/diff/1310001/net/url_request/test_url_fetcher_factory.cc File net/url_request/test_url_fetcher_factory.cc (right): https://codereview.chromium.org/60923002/diff/1310001/net/url_request/test_url_fetcher_factory.cc#newcode295 net/url_request/test_url_fetcher_factory.cc:295: error = net::OK; ...
7 years, 1 month ago (2013-11-06 17:07:21 UTC) #16
Raghu Simha
Nits fixed. Thanks for the review. https://codereview.chromium.org/60923002/diff/1310001/net/url_request/test_url_fetcher_factory.cc File net/url_request/test_url_fetcher_factory.cc (right): https://codereview.chromium.org/60923002/diff/1310001/net/url_request/test_url_fetcher_factory.cc#newcode295 net/url_request/test_url_fetcher_factory.cc:295: error = net::OK; ...
7 years, 1 month ago (2013-11-06 17:31:40 UTC) #17
Raghu Simha
I'll hold off on landing this for a while to give Fred a chance to ...
7 years, 1 month ago (2013-11-06 18:03:10 UTC) #18
awong
service LGTM
7 years, 1 month ago (2013-11-06 18:05:18 UTC) #19
akalin
lgtm
7 years, 1 month ago (2013-11-06 18:10:29 UTC) #20
Raghu Simha
7 years, 1 month ago (2013-11-06 18:37:19 UTC) #21
Message was sent while issue was closed.
Committed patchset #7 manually as r233304 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698