Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: ios/web/public/test/response_providers/html_response_provider.h

Issue 1890333002: Web shell test to go back and forward. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/include/import Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_HTML_RESPONSE_PROVIDER_H_
6 #define IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_HTML_RESPONSE_PROVIDER_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/memory/ref_counted.h"
12 #include "ios/web/public/test/response_providers/data_response_provider.h"
13 #include "ios/web/public/test/response_providers/html_response_provider_impl.h"
14 #include "ios/web/public/test/response_providers/response_provider.h"
15 #include "url/gurl.h"
16
17 namespace net {
18 class HttpResponseHeaders;
19 }
20
21 // A web::DataResponseProvider that maps URLs to requests.
22 class HtmlResponseProvider : public web::DataResponseProvider {
23 public:
24 // Constructs an HtmlResponseProvider that does not respond to any request.
25 HtmlResponseProvider();
26 // Constructs an HtmlResponseProvider that generates a simple string response
27 // to a URL based on the mapping present in |responses|.
28 explicit HtmlResponseProvider(const std::map<GURL, std::string>& responses);
29 // Constructs an HtmlResponseProvider that generates a response to a URL based
30 // on the mapping present in |responses|.
31 explicit HtmlResponseProvider(
32 const std::map<GURL, HtmlResponseProviderImpl::Response>& responses);
33
34 ~HtmlResponseProvider() override;
35
36 // web::ResponseProvider implementation.
37 bool CanHandleRequest(const Request& request) override;
38 // web::DataResponseProvider implementation.
39 void GetResponseHeadersAndBody(
40 const Request& request,
41 scoped_refptr<net::HttpResponseHeaders>* headers,
42 std::string* response_body) override;
43
44 private:
45 std::unique_ptr<HtmlResponseProviderImpl> response_provider_impl_;
46 };
47
48 #endif // IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_HTML_RESPONSE_PROVIDER_H_
OLDNEW
« no previous file with comments | « ios/web/public/test/http_server_util.mm ('k') | ios/web/public/test/response_providers/html_response_provider.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698