summaryrefslogtreecommitdiffstats
path: root/components/dom_distiller
diff options
context:
space:
mode:
authorrsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-04 17:34:15 +0000
committerrsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-04 17:34:15 +0000
commit61a6ba3f707e431f607ae71280c752854f1081d8 (patch)
tree345cef8f9235a96e84e612572d19e542807485d0 /components/dom_distiller
parent4f03a4f75217e698c5b71323424d7a4b178e079e (diff)
downloadchromium_src-61a6ba3f707e431f607ae71280c752854f1081d8.zip
chromium_src-61a6ba3f707e431f607ae71280c752854f1081d8.tar.gz
chromium_src-61a6ba3f707e431f607ae71280c752854f1081d8.tar.bz2
[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 Review URL: https://codereview.chromium.org/48713008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232724 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/dom_distiller')
-rw-r--r--components/dom_distiller/core/distiller_url_fetcher_unittest.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/dom_distiller/core/distiller_url_fetcher_unittest.cc b/components/dom_distiller/core/distiller_url_fetcher_unittest.cc
index 58e58c2..8dddd2f 100644
--- a/components/dom_distiller/core/distiller_url_fetcher_unittest.cc
+++ b/components/dom_distiller/core/distiller_url_fetcher_unittest.cc
@@ -6,6 +6,7 @@
#include "base/bind_helpers.h"
#include "base/message_loop/message_loop.h"
#include "components/dom_distiller/core/distiller_url_fetcher.h"
+#include "net/http/http_status_code.h"
#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
@@ -31,10 +32,12 @@ public:
factory_.reset(new net::FakeURLFetcherFactory(NULL));
factory_->SetFakeResponse(
GURL(kTestPageA),
- std::string(kTestPageAResponse, sizeof(kTestPageAResponse)), true);
+ std::string(kTestPageAResponse, sizeof(kTestPageAResponse)),
+ net::HTTP_OK);
factory_->SetFakeResponse(
GURL(kTestPageB),
- std::string(kTestPageBResponse, sizeof(kTestPageBResponse)), false);
+ std::string(kTestPageBResponse, sizeof(kTestPageBResponse)),
+ net::HTTP_INTERNAL_SERVER_ERROR);
}
void Fetch(const std::string& url,