#ifndef NET_PROXY_MOCK_PROXY_SCRIPT_FETCHER_H_
#define NET_PROXY_MOCK_PROXY_SCRIPT_FETCHER_H_
#include "base/compiler_specific.h"
#include "net/proxy/proxy_script_fetcher.h"
#include "url/gurl.h"
#include <string>
namespace net {
class URLRequestContext;
class MockProxyScriptFetcher : public ProxyScriptFetcher {
public:
MockProxyScriptFetcher();
virtual ~MockProxyScriptFetcher();
virtual int Fetch(const GURL& url,
base::string16* text,
const CompletionCallback& callback) OVERRIDE;
virtual void Cancel() OVERRIDE;
virtual URLRequestContext* GetRequestContext() const OVERRIDE;
void NotifyFetchCompletion(int result, const std::string& ascii_text);
const GURL& pending_request_url() const;
bool has_pending_request() const;
void WaitUntilFetch();
private:
GURL pending_request_url_;
CompletionCallback pending_request_callback_;
base::string16* pending_request_text_;
bool waiting_for_fetch_;
};
}
#endif