| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 #include "stub_url_fetcher.h" |
| 5 |
| 6 #include "net/base/host_port_pair.h" |
| 7 |
| 8 namespace net { |
| 9 |
| 10 // stash away the body and retval we want to use |
| 11 StubURLFetcher::StubURLFetcher(std::string fakeBody, bool retval) { |
| 12 fakeBody_ = fakeBody; |
| 13 retval_ = retval; |
| 14 } |
| 15 |
| 16 StubURLFetcher::~StubURLFetcher() {} |
| 17 |
| 18 bool StubURLFetcher::GetResponseAsString(std::string* outParam) const { |
| 19 *outParam = fakeBody_; |
| 20 return retval_; |
| 21 } |
| 22 |
| 23 // unneeded virtual functions - do just enough to compile |
| 24 int StubURLFetcher::GetLoadFlags() const { return 0; } |
| 25 int StubURLFetcher::GetMaxRetries() const { return 0; } |
| 26 base::TimeDelta StubURLFetcher::GetBackoffDelay() const { |
| 27 return base::TimeDelta(); |
| 28 } |
| 29 HttpResponseHeaders* StubURLFetcher::GetResponseHeaders() const { |
| 30 return NULL; |
| 31 } |
| 32 HostPortPair StubURLFetcher::GetSocketAddress() const { |
| 33 return HostPortPair(); |
| 34 } |
| 35 bool StubURLFetcher::WasFetchedViaProxy() const { |
| 36 return false; |
| 37 } |
| 38 const GURL& StubURLFetcher::GetOriginalURL() const { return gurl_; } |
| 39 const GURL& StubURLFetcher::GetURL() const { return gurl_; } |
| 40 const URLRequestStatus& StubURLFetcher::GetStatus() const { |
| 41 return requestStatus_; |
| 42 } |
| 43 int StubURLFetcher::GetResponseCode() const { return 0; } |
| 44 const ResponseCookies& StubURLFetcher::GetCookies() const { |
| 45 return responseCookies_; |
| 46 } |
| 47 bool StubURLFetcher::FileErrorOccurred( |
| 48 base::PlatformFileError* out_error_code) const { return false; } |
| 49 bool StubURLFetcher::GetResponseAsFilePath(bool take_ownership, |
| 50 FilePath* out_response_path) const { |
| 51 return false; |
| 52 } |
| 53 |
| 54 } // namespace net |
| OLD | NEW |