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

Unified Diff: ios/web/public/test/response_providers/response_provider.h

Issue 2898733003: Split up ios/web:test_support. (Closed)
Patch Set: don't break downstream clients Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ios/web/public/test/response_providers/response_provider.h
diff --git a/ios/web/public/test/response_providers/response_provider.h b/ios/web/public/test/response_providers/response_provider.h
deleted file mode 100644
index 37b7ad7ed79ac99bd390f6aa32d063098f49bd36..0000000000000000000000000000000000000000
--- a/ios/web/public/test/response_providers/response_provider.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_RESPONSE_PROVIDER_H_
-#define IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_RESPONSE_PROVIDER_H_
-
-#include <map>
-#include <string>
-
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "net/http/http_request_headers.h"
-#include "net/http/http_response_headers.h"
-#include "net/http/http_status_code.h"
-#include "url/gurl.h"
-
-@class GCDWebServerResponse;
-
-namespace web {
-
-// An abstract class for a provider that services a request and returns a
-// GCDWebServerResponse.
-// Note: The ResponseProviders can be called from any arbitrary GCD thread.
-class ResponseProvider {
- public:
- // A data structure that encapsulated all the fields of a request.
- struct Request {
- Request(const GURL& url,
- const std::string& method,
- const std::string& body,
- const net::HttpRequestHeaders& headers);
- Request(const Request& other);
- virtual ~Request();
-
- // The URL for the request.
- GURL url;
- // The HTTP method for the request such as "GET" or "POST".
- std::string method;
- // The body of the request.
- std::string body;
- // The HTTP headers for the request.
- net::HttpRequestHeaders headers;
- };
-
- // Returns true if the request is handled by the provider.
- virtual bool CanHandleRequest(const Request& request) = 0;
-
- // Returns the GCDWebServerResponse as a reply to the request. Will only be
- // called if the provider can handle the request.
- virtual GCDWebServerResponse* GetGCDWebServerResponse(
- const Request& request) = 0;
-
- // Gets default response headers with a text/html content type and a 200
- // response code.
- static scoped_refptr<net::HttpResponseHeaders> GetDefaultResponseHeaders();
- // Gets a map of response headers with a text/html content type, a 200
- // response code and Set-Cookie in headers.
- static std::map<GURL, scoped_refptr<net::HttpResponseHeaders>>
- GetDefaultResponseHeaders(
- const std::map<GURL, std::pair<std::string, std::string>>& responses);
- // Gets configurable response headers with a provided content type and a
- // 200 response code.
- static scoped_refptr<net::HttpResponseHeaders> GetResponseHeaders(
- const std::string& content_type);
- // Gets configurable response headers with a provided content type and
- // response code.
- static scoped_refptr<net::HttpResponseHeaders> GetResponseHeaders(
- const std::string& content_type,
- net::HttpStatusCode response_code);
- // Gets configurable response based on |http_status| headers for redirecting
- // to |destination|.
- static scoped_refptr<net::HttpResponseHeaders> GetRedirectResponseHeaders(
- const std::string& destination,
- const net::HttpStatusCode& http_status);
-
- ResponseProvider();
- virtual ~ResponseProvider() {};
- private:
- DISALLOW_COPY_AND_ASSIGN(ResponseProvider);
-};
-
-} // namspace web
-
-#endif // IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_RESPONSE_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698