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 #include "content/test/test_url_fetcher_factory.h" | 5 #include "content/test/test_url_fetcher_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 TestURLFetcher::~TestURLFetcher() { | 33 TestURLFetcher::~TestURLFetcher() { |
34 } | 34 } |
35 | 35 |
36 void TestURLFetcher::AppendChunkToUpload(const std::string& data, | 36 void TestURLFetcher::AppendChunkToUpload(const std::string& data, |
37 bool is_last_chunk) { | 37 bool is_last_chunk) { |
38 DCHECK(!did_receive_last_chunk_); | 38 DCHECK(!did_receive_last_chunk_); |
39 did_receive_last_chunk_ = is_last_chunk; | 39 did_receive_last_chunk_ = is_last_chunk; |
40 chunks_.push_back(data); | 40 chunks_.push_back(data); |
41 } | 41 } |
42 | 42 |
| 43 const GURL& TestURLFetcher::original_url() const { |
| 44 return original_url_; |
| 45 } |
| 46 |
43 void TestURLFetcher::set_status(const net::URLRequestStatus& status) { | 47 void TestURLFetcher::set_status(const net::URLRequestStatus& status) { |
44 fake_status_ = status; | 48 fake_status_ = status; |
45 } | 49 } |
46 | 50 |
47 void TestURLFetcher::SetResponseString(const std::string& response) { | 51 void TestURLFetcher::SetResponseString(const std::string& response) { |
48 SetResponseDestinationForTesting(STRING); | 52 SetResponseDestinationForTesting(STRING); |
49 fake_response_string_ = response; | 53 fake_response_string_ = response; |
50 } | 54 } |
51 | 55 |
52 void TestURLFetcher::SetResponseFilePath(const FilePath& path) { | 56 void TestURLFetcher::SetResponseFilePath(const FilePath& path) { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 208 |
205 URLFetcherFactory::~URLFetcherFactory() {} | 209 URLFetcherFactory::~URLFetcherFactory() {} |
206 | 210 |
207 URLFetcher* URLFetcherFactory::CreateURLFetcher( | 211 URLFetcher* URLFetcherFactory::CreateURLFetcher( |
208 int id, | 212 int id, |
209 const GURL& url, | 213 const GURL& url, |
210 URLFetcher::RequestType request_type, | 214 URLFetcher::RequestType request_type, |
211 URLFetcher::Delegate* d) { | 215 URLFetcher::Delegate* d) { |
212 return new URLFetcher(url, request_type, d); | 216 return new URLFetcher(url, request_type, d); |
213 } | 217 } |
OLD | NEW |