OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_ERROR_PAGE_RESPONSE_PROVIDER_H_ | |
6 #define IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_ERROR_PAGE_RESPONSE_PROVIDER_H_ | |
7 | |
8 #include <map> | |
9 #include <string> | |
10 | |
11 #include "base/macros.h" | |
Eugene But (OOO till 7-30)
2016/08/19 21:29:02
Is this include necessary?
baxley
2016/08/19 22:25:44
Done.
| |
12 #include "ios/web/public/test/response_providers/html_response_provider.h" | |
13 | |
Eugene But (OOO till 7-30)
2016/08/19 21:29:02
Include gurl.h?
baxley
2016/08/19 22:25:44
Done.
| |
14 // A HtmlResponseProvider that supports the following additional URLs: | |
15 // - RedirectToDNSFailureUrl - the response is a redirect to |DNSFailureUrl|. | |
16 // - DNSFailureUrl - triggers a DNS error. | |
17 class ErrorPageResponseProvider : public HtmlResponseProvider { | |
18 public: | |
19 ErrorPageResponseProvider() : HtmlResponseProvider() {} | |
20 explicit ErrorPageResponseProvider( | |
21 const std::map<GURL, std::string>& responses) | |
22 : HtmlResponseProvider(responses) {} | |
23 // Returns a URL that causes a DNS failure. | |
24 static GURL DNSFailureUrl(); | |
Eugene But (OOO till 7-30)
2016/08/19 21:29:02
GetDnsFailureUrl ?
baxley
2016/08/19 22:25:44
Done.
| |
25 // Returns a URL that redirects to a bad URL. | |
26 static GURL RedirectToDNSFailureUrl(); | |
Eugene But (OOO till 7-30)
2016/08/19 21:29:02
GetRedirectToDnsFailureUrl ?
baxley
2016/08/19 22:25:44
Done.
| |
27 | |
28 // HtmlResponseProvider implementation. | |
29 bool CanHandleRequest(const Request& request) override; | |
30 void GetResponseHeadersAndBody( | |
31 const Request& request, | |
32 scoped_refptr<net::HttpResponseHeaders>* headers, | |
33 std::string* response_body) override; | |
34 }; | |
35 | |
36 #endif // IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_ERROR_PAGE_RESPONSE_PROVIDER_H _ | |
OLD | NEW |