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

Side by Side Diff: ios/web/public/test/http_server/string_response_provider.h

Issue 2898733003: Split up ios/web:test_support. (Closed)
Patch Set: don't break downstream clients Created 3 years, 6 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_STRING_RESPONSE_PROVIDER_H_ 5 #ifndef IOS_WEB_PUBLIC_TEST_HTTP_SERVER_STRING_RESPONSE_PROVIDER_H_
6 #define IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_STRING_RESPONSE_PROVIDER_H_ 6 #define IOS_WEB_PUBLIC_TEST_HTTP_SERVER_STRING_RESPONSE_PROVIDER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #import "ios/web/public/test/response_providers/data_response_provider.h" 11 #import "ios/web/public/test/http_server/data_response_provider.h"
12 12
13 namespace web { 13 namespace web {
14 14
15 // A response provider that returns a string for all requests. Used for testing 15 // A response provider that returns a string for all requests. Used for testing
16 // purposes. 16 // purposes.
17 class StringResponseProvider : public web::DataResponseProvider { 17 class StringResponseProvider : public web::DataResponseProvider {
18 public: 18 public:
19 explicit StringResponseProvider(const std::string& response_body); 19 explicit StringResponseProvider(const std::string& response_body);
20 20
21 // web::DataResponseProvider methods. 21 // web::DataResponseProvider methods.
22 bool CanHandleRequest(const Request& request) override; 22 bool CanHandleRequest(const Request& request) override;
23 void GetResponseHeadersAndBody( 23 void GetResponseHeadersAndBody(
24 const Request& request, 24 const Request& request,
25 scoped_refptr<net::HttpResponseHeaders>* headers, 25 scoped_refptr<net::HttpResponseHeaders>* headers,
26 std::string* response_body) override; 26 std::string* response_body) override;
27 27
28 private: 28 private:
29 // The string that is returned in the response body. 29 // The string that is returned in the response body.
30 std::string response_body_; 30 std::string response_body_;
31 DISALLOW_COPY_AND_ASSIGN(StringResponseProvider); 31 DISALLOW_COPY_AND_ASSIGN(StringResponseProvider);
32 }; 32 };
33 33
34 } // namespace web 34 } // namespace web
35 35
36 #endif // IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_STRING_RESPONSE_PROVIDER_H_ 36 #endif // IOS_WEB_PUBLIC_TEST_HTTP_SERVER_STRING_RESPONSE_PROVIDER_H_
OLDNEW
« no previous file with comments | « ios/web/public/test/http_server/response_provider.mm ('k') | ios/web/public/test/http_server/string_response_provider.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698