Chromium Code Reviews| Index: content/test/net/url_request_prepackaged_interceptor.h |
| diff --git a/content/test/net/url_request_prepackaged_interceptor.h b/content/test/net/url_request_prepackaged_interceptor.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..be19296f916ee0492ec5efd27c062bec1d7e7a26 |
| --- /dev/null |
| +++ b/content/test/net/url_request_prepackaged_interceptor.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_ |
| +#define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/basictypes.h" |
| + |
| +class FilePath; |
| + |
| +namespace content { |
| + |
| +// This url request interceptor lets us respond to localhost http request urls |
|
erikwright (departed)
2012/12/07 20:12:05
url -> URL, http -> HTTP, urls -> URLs
The prefer
pauljensen
2012/12/09 23:14:12
I didn't change this (it's from autoupdate_interce
|
| +// with the contents of files on disk for use in tests. |
| +class URLRequestPrepackagedInterceptor { |
| + public: |
| + URLRequestPrepackagedInterceptor(); |
| + virtual ~URLRequestPrepackagedInterceptor(); |
| + |
| + // When requests for |url| arrive, respond with the contents of |path|. The |
| + // hostname of |url| must be "localhost" to avoid DNS lookups, and the scheme |
| + // must be "http". |
| + void SetResponse(const std::string& url, |
| + const FilePath& path); |
| + void SetQuerylessResponse(const std::string& url, |
|
erikwright (departed)
2012/12/07 20:12:05
Add comment. Consider Renaming to SetResponseIgnor
pauljensen
2012/12/09 23:14:12
Done.
|
| + const FilePath& path); |
| + |
| + // Returns how many requests have been issued that have a stored reply. |
| + int GetHitCount(); |
| + |
| + private: |
| + class Delegate; |
| + |
| + Delegate* delegate_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(URLRequestPrepackagedInterceptor); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_INTERCEPTOR_H_ |