summaryrefslogtreecommitdiffstats
path: root/content/test
diff options
context:
space:
mode:
authorloislo@chromium.org <loislo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-05 13:43:29 +0000
committerloislo@chromium.org <loislo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-05 13:43:29 +0000
commitb77235445f23ab581ad0664f010629493fae5bb0 (patch)
tree18e0f3932edef5182a421c3028a92896416ce90a /content/test
parente6c0b43787c81b1774bc906402a46dfbc91f7d35 (diff)
downloadchromium_src-b77235445f23ab581ad0664f010629493fae5bb0.zip
chromium_src-b77235445f23ab581ad0664f010629493fae5bb0.tar.gz
chromium_src-b77235445f23ab581ad0664f010629493fae5bb0.tar.bz2
r99621 breaks sync tests.
BUG=none TEST=none TBR=jstritar@chromium.org Review URL: http://codereview.chromium.org/7834022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test')
-rw-r--r--content/test/test_url_fetcher_factory.cc36
1 files changed, 6 insertions, 30 deletions
diff --git a/content/test/test_url_fetcher_factory.cc b/content/test/test_url_fetcher_factory.cc
index b1d6b5e..d95fbf2 100644
--- a/content/test/test_url_fetcher_factory.cc
+++ b/content/test/test_url_fetcher_factory.cc
@@ -125,43 +125,17 @@ class FakeURLFetcher : public URLFetcher {
url_(url),
response_data_(response_data),
success_(success),
- status_(success ? net::URLRequestStatus::SUCCESS :
- net::URLRequestStatus::FAILED, 0),
ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
}
// Start the request. This will call the given delegate asynchronously
// with the pre-baked response as parameter.
- virtual void Start() OVERRIDE {
+ virtual void Start() {
MessageLoop::current()->PostTask(
FROM_HERE,
method_factory_.NewRunnableMethod(&FakeURLFetcher::RunDelegate));
}
- // These methods are overriden so we can use the version of
- // OnURLFetchComplete that only has a single URLFetcher argument.
- virtual const net::ResponseCookies& cookies() const OVERRIDE {
- return cookies_;
- }
-
- virtual const std::string& GetResponseStringRef() const OVERRIDE {
- return response_data_;
- }
-
- virtual bool GetResponseAsString(
- std::string* out_response_string) const OVERRIDE {
- *out_response_string = response_data_;
- return true;
- }
-
- virtual int response_code() const OVERRIDE {
- return success_ ? 200 : 500;
- }
-
- virtual const net::URLRequestStatus& status() const OVERRIDE {
- return status_;
- }
-
private:
virtual ~FakeURLFetcher() {
}
@@ -169,7 +143,11 @@ class FakeURLFetcher : public URLFetcher {
// This is the method which actually calls the delegate that is passed in the
// constructor.
void RunDelegate() {
- delegate()->OnURLFetchComplete(this);
+ net::URLRequestStatus status;
+ status.set_status(success_ ? net::URLRequestStatus::SUCCESS :
+ net::URLRequestStatus::FAILED);
+ delegate()->OnURLFetchComplete(this, url_, status, success_ ? 200 : 500,
+ net::ResponseCookies(), response_data_);
}
// Pre-baked response data and flag which indicates whether the request should
@@ -177,8 +155,6 @@ class FakeURLFetcher : public URLFetcher {
GURL url_;
std::string response_data_;
bool success_;
- net::URLRequestStatus status_;
- net::ResponseCookies cookies_;
// Method factory used to run the delegate.
ScopedRunnableMethodFactory<FakeURLFetcher> method_factory_;