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

Issue 48713008: [sync] Allow FakeURLFetcher to return arbitrary HTTP response codes (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 arbitrary HTTP response codes As of today, FakeURLFetcher takes a boolean "success" parameter, and returns one of two HTTP response codes: 200 for success and 500 for failure. In order to write sync tests for auth errors, we need to be able to fake arbitrary HTTP response codes. This patch modifies FakeURLFetcher to return arbitrary HTTP response codes and fixes all existing call sites. Tests that return arbitrary error codes will be added in a separate CL. R=achuith@chromium.org, ajwong@chromium.org, akalin@chromium.org, bengr@chromium.org, nyquist@chromium.org, sergeyu@chromium.org, vitalybuka@chromium.org TBR=battre, mattm, sky, stevenjb, tim BUG=313905 TEST=All existing tests pass trybots and waterfall Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=232724

Patch Set 1 : #

Patch Set 2 : Rebase #

Total comments: 14

Patch Set 3 : Address feedback #

Patch Set 4 : Add comment #

Patch Set 5 : Rebase #

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

Messages

Total messages: 16 (0 generated)
Raghu Simha
Folks, please review. The meat of this CL is contained in net/url_request/test_url_fetcher_factory.{h|cc}. The remaining changes ...
7 years, 1 month ago (2013-11-01 00:06:51 UTC) #1
Sergey Ulanov
remoting - lgtm
7 years, 1 month ago (2013-11-01 00:12:19 UTC) #2
nyquist
components/dom_distiller/ lgtm
7 years, 1 month ago (2013-11-01 16:22:12 UTC) #3
Raghu Simha
Pinging other reviewers.
7 years, 1 month ago (2013-11-01 20:13:04 UTC) #4
bengr
On 2013/11/01 20:13:04, Raghu Simha wrote: > Pinging other reviewers. components/precache/ lgtm
7 years, 1 month ago (2013-11-01 20:16:40 UTC) #5
awong
service: lgtm
7 years, 1 month ago (2013-11-01 20:17:52 UTC) #6
Raghu Simha
Adding more reviewers for directories under chrome/browser. Once the meat of this CL is reviewed, ...
7 years, 1 month ago (2013-11-01 20:49:58 UTC) #7
achuithb
lgtm for c/b/cros https://codereview.chromium.org/48713008/diff/610001/chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc File chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc (right): https://codereview.chromium.org/48713008/diff/610001/chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc#newcode240 chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc:240: bool success) { Any reason not ...
7 years, 1 month ago (2013-11-01 20:57:03 UTC) #8
mattm
https://codereview.chromium.org/48713008/diff/610001/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc File chrome/browser/safe_browsing/client_side_detection_service_unittest.cc (right): https://codereview.chromium.org/48713008/diff/610001/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc#newcode265 chrome/browser/safe_browsing/client_side_detection_service_unittest.cc:265: SetModelFetchResponse("blamodel", false /* failure */); The tests would probably ...
7 years, 1 month ago (2013-11-01 20:57:13 UTC) #9
Vitaly Buka (NO REVIEWS)
lgtm with nits chrome/service/cloud_print/ chrome/browser/local_discovery/cloud_print_printer_list_unittest.cc https://codereview.chromium.org/48713008/diff/610001/chrome/service/cloud_print/printer_job_handler_unittest.cc File chrome/service/cloud_print/printer_job_handler_unittest.cc (right): https://codereview.chromium.org/48713008/diff/610001/chrome/service/cloud_print/printer_job_handler_unittest.cc#newcode288 chrome/service/cloud_print/printer_job_handler_unittest.cc:288: d, According http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Function_Calls new ...
7 years, 1 month ago (2013-11-01 21:01:00 UTC) #10
mmenke
https://codereview.chromium.org/48713008/diff/610001/net/url_request/test_url_fetcher_factory.cc File net/url_request/test_url_fetcher_factory.cc (right): https://codereview.chromium.org/48713008/diff/610001/net/url_request/test_url_fetcher_factory.cc#newcode291 net/url_request/test_url_fetcher_factory.cc:291: URLRequestStatus::FAILED, I don't believe this is correct. I think ...
7 years, 1 month ago (2013-11-01 21:05:00 UTC) #11
Raghu Simha
Thanks for the reviews, everyone. Feedback addressed. mattm / mmenke: PTAL. https://codereview.chromium.org/48713008/diff/610001/chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc File chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc (right): ...
7 years, 1 month ago (2013-11-01 21:55:14 UTC) #12
akalin
lgtm https://codereview.chromium.org/48713008/diff/610001/net/url_request/test_url_fetcher_factory.cc File net/url_request/test_url_fetcher_factory.cc (right): https://codereview.chromium.org/48713008/diff/610001/net/url_request/test_url_fetcher_factory.cc#newcode291 net/url_request/test_url_fetcher_factory.cc:291: URLRequestStatus::FAILED, On 2013/11/01 21:55:16, Raghu Simha wrote: > ...
7 years, 1 month ago (2013-11-01 22:36:58 UTC) #13
mmenke
https://codereview.chromium.org/48713008/diff/610001/net/url_request/test_url_fetcher_factory.cc File net/url_request/test_url_fetcher_factory.cc (right): https://codereview.chromium.org/48713008/diff/610001/net/url_request/test_url_fetcher_factory.cc#newcode291 net/url_request/test_url_fetcher_factory.cc:291: URLRequestStatus::FAILED, On 2013/11/01 22:36:59, akalin wrote: > On 2013/11/01 ...
7 years, 1 month ago (2013-11-01 23:10:54 UTC) #14
Raghu Simha
Thanks for the review, everyone. I'm going to land this CL as is, and will ...
7 years, 1 month ago (2013-11-04 15:55:01 UTC) #15
Raghu Simha
7 years, 1 month ago (2013-11-04 17:34:24 UTC) #16
Message was sent while issue was closed.
Committed patchset #5 manually as r232724 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698