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

Side by Side Diff: ios/web/public/test/response_providers/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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_STRING_RESPONSE_PROVIDER_H_
6 #define IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_STRING_RESPONSE_PROVIDER_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #import "ios/web/public/test/response_providers/data_response_provider.h"
12
13 namespace web {
14
15 // A response provider that returns a string for all requests. Used for testing
16 // purposes.
17 class StringResponseProvider : public web::DataResponseProvider {
18 public:
19 explicit StringResponseProvider(const std::string& response_body);
20
21 // web::DataResponseProvider methods.
22 bool CanHandleRequest(const Request& request) override;
23 void GetResponseHeadersAndBody(
24 const Request& request,
25 scoped_refptr<net::HttpResponseHeaders>* headers,
26 std::string* response_body) override;
27
28 private:
29 // The string that is returned in the response body.
30 std::string response_body_;
31 DISALLOW_COPY_AND_ASSIGN(StringResponseProvider);
32 };
33
34 } // namespace web
35
36 #endif // IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_STRING_RESPONSE_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698