| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/url_request/test_url_fetcher_factory.h" | 5 #include "net/url_request/test_url_fetcher_factory.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 } | 250 } |
| 251 | 251 |
| 252 const URLRequestStatus& TestURLFetcher::GetStatus() const { | 252 const URLRequestStatus& TestURLFetcher::GetStatus() const { |
| 253 return fake_status_; | 253 return fake_status_; |
| 254 } | 254 } |
| 255 | 255 |
| 256 int TestURLFetcher::GetResponseCode() const { | 256 int TestURLFetcher::GetResponseCode() const { |
| 257 return fake_response_code_; | 257 return fake_response_code_; |
| 258 } | 258 } |
| 259 | 259 |
| 260 const ResponseCookies& TestURLFetcher::GetCookies() const { | |
| 261 return fake_cookies_; | |
| 262 } | |
| 263 | |
| 264 void TestURLFetcher::ReceivedContentWasMalformed() { | 260 void TestURLFetcher::ReceivedContentWasMalformed() { |
| 265 } | 261 } |
| 266 | 262 |
| 267 bool TestURLFetcher::GetResponseAsString( | 263 bool TestURLFetcher::GetResponseAsString( |
| 268 std::string* out_response_string) const { | 264 std::string* out_response_string) const { |
| 269 if (fake_response_destination_ != STRING) | 265 if (fake_response_destination_ != STRING) |
| 270 return false; | 266 return false; |
| 271 | 267 |
| 272 *out_response_string = fake_response_string_; | 268 *out_response_string = fake_response_string_; |
| 273 return true; | 269 return true; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 | 481 |
| 486 std::unique_ptr<URLFetcher> URLFetcherImplFactory::CreateURLFetcher( | 482 std::unique_ptr<URLFetcher> URLFetcherImplFactory::CreateURLFetcher( |
| 487 int id, | 483 int id, |
| 488 const GURL& url, | 484 const GURL& url, |
| 489 URLFetcher::RequestType request_type, | 485 URLFetcher::RequestType request_type, |
| 490 URLFetcherDelegate* d) { | 486 URLFetcherDelegate* d) { |
| 491 return std::unique_ptr<URLFetcher>(new URLFetcherImpl(url, request_type, d)); | 487 return std::unique_ptr<URLFetcher>(new URLFetcherImpl(url, request_type, d)); |
| 492 } | 488 } |
| 493 | 489 |
| 494 } // namespace net | 490 } // namespace net |
| OLD | NEW |