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 CHROME_COMMON_NET_TEST_URL_FETCHER_FACTORY_H_ | 5 #ifndef CONTENT_COMMON_TEST_URL_FETCHER_FACTORY_H_ |
6 #define CHROME_COMMON_NET_TEST_URL_FETCHER_FACTORY_H_ | 6 #define CONTENT_COMMON_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> |
11 #include <string> | 11 #include <string> |
12 #include <utility> | 12 #include <utility> |
13 | 13 |
14 #include "chrome/common/net/url_fetcher.h" | 14 #include "content/common/url_fetcher.h" |
15 #include "net/url_request/url_request_status.h" | 15 #include "net/url_request/url_request_status.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 | 17 |
18 // TestURLFetcher and TestURLFetcherFactory are used for testing consumers of | 18 // TestURLFetcher and TestURLFetcherFactory are used for testing consumers of |
19 // URLFetcher. TestURLFetcherFactory is a URLFetcher::Factory that creates | 19 // URLFetcher. TestURLFetcherFactory is a URLFetcher::Factory that creates |
20 // TestURLFetchers. TestURLFetcher::Start is overriden to do nothing. It is | 20 // TestURLFetchers. TestURLFetcher::Start is overriden to do nothing. It is |
21 // expected that you'll grab the delegate from the TestURLFetcher and invoke | 21 // expected that you'll grab the delegate from the TestURLFetcher and invoke |
22 // the callback method when appropriate. In this way it's easy to mock a | 22 // the callback method when appropriate. In this way it's easy to mock a |
23 // URLFetcher. | 23 // URLFetcher. |
24 // Typical usage: | 24 // Typical usage: |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 virtual ~URLFetcherFactory(); | 217 virtual ~URLFetcherFactory(); |
218 | 218 |
219 // This method will create a real URLFetcher. | 219 // This method will create a real URLFetcher. |
220 virtual URLFetcher* CreateURLFetcher(int id, | 220 virtual URLFetcher* CreateURLFetcher(int id, |
221 const GURL& url, | 221 const GURL& url, |
222 URLFetcher::RequestType request_type, | 222 URLFetcher::RequestType request_type, |
223 URLFetcher::Delegate* d); | 223 URLFetcher::Delegate* d); |
224 | 224 |
225 }; | 225 }; |
226 | 226 |
227 #endif // CHROME_COMMON_NET_TEST_URL_FETCHER_FACTORY_H_ | 227 #endif // CONTENT_COMMON_TEST_URL_FETCHER_FACTORY_H_ |
OLD | NEW |