| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CONTENT_TEST_TEST_URL_FETCHER_FACTORY_H_ | 5 #ifndef CONTENT_TEST_TEST_URL_FETCHER_FACTORY_H_ |
| 6 #define CONTENT_TEST_TEST_URL_FETCHER_FACTORY_H_ | 6 #define CONTENT_TEST_TEST_URL_FETCHER_FACTORY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 virtual const GURL& url() const OVERRIDE; | 89 virtual const GURL& url() const OVERRIDE; |
| 90 | 90 |
| 91 void set_status(const net::URLRequestStatus& status); | 91 void set_status(const net::URLRequestStatus& status); |
| 92 virtual const net::URLRequestStatus& status() const OVERRIDE; | 92 virtual const net::URLRequestStatus& status() const OVERRIDE; |
| 93 | 93 |
| 94 void set_response_code(int response_code) { | 94 void set_response_code(int response_code) { |
| 95 fake_response_code_ = response_code; | 95 fake_response_code_ = response_code; |
| 96 } | 96 } |
| 97 virtual int response_code() const OVERRIDE; | 97 virtual int response_code() const OVERRIDE; |
| 98 | 98 |
| 99 void set_was_fetched_via_proxy(bool flag); |
| 100 |
| 101 void set_response_headers(scoped_refptr<net::HttpResponseHeaders> headers); |
| 102 |
| 99 // Set string data. | 103 // Set string data. |
| 100 void SetResponseString(const std::string& response); | 104 void SetResponseString(const std::string& response); |
| 101 | 105 |
| 102 // Set File data. | 106 // Set File data. |
| 103 void SetResponseFilePath(const FilePath& path); | 107 void SetResponseFilePath(const FilePath& path); |
| 104 | 108 |
| 105 // Override response access functions to return fake data. | 109 // Override response access functions to return fake data. |
| 106 virtual const std::string& GetResponseStringRef() const OVERRIDE; | 110 virtual const std::string& GetResponseStringRef() const OVERRIDE; |
| 107 virtual bool GetResponseAsString(std::string* out_response_string) const | 111 virtual bool GetResponseAsString(std::string* out_response_string) const |
| 108 OVERRIDE; | 112 OVERRIDE; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 236 |
| 233 // This method will create a real URLFetcher. | 237 // This method will create a real URLFetcher. |
| 234 virtual URLFetcher* CreateURLFetcher(int id, | 238 virtual URLFetcher* CreateURLFetcher(int id, |
| 235 const GURL& url, | 239 const GURL& url, |
| 236 URLFetcher::RequestType request_type, | 240 URLFetcher::RequestType request_type, |
| 237 URLFetcher::Delegate* d) OVERRIDE; | 241 URLFetcher::Delegate* d) OVERRIDE; |
| 238 | 242 |
| 239 }; | 243 }; |
| 240 | 244 |
| 241 #endif // CONTENT_TEST_TEST_URL_FETCHER_FACTORY_H_ | 245 #endif // CONTENT_TEST_TEST_URL_FETCHER_FACTORY_H_ |
| OLD | NEW |