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

Unified Diff: net/test/embedded_test_server/http_response.h

Issue 16268017: GTTF: convert some tests in chrome to use EmbeddedTestServer patch nr 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 side-by-side diff with in-line comments
Download patch
Index: net/test/embedded_test_server/http_response.h
diff --git a/net/test/embedded_test_server/http_response.h b/net/test/embedded_test_server/http_response.h
index 141c8cb027ef3186eb960f705807461ee2201d88..422a52553eaae7b12831316a517825a99e1aab63 100644
--- a/net/test/embedded_test_server/http_response.h
+++ b/net/test/embedded_test_server/http_response.h
@@ -7,24 +7,15 @@
#include <map>
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "net/http/http_status_code.h"
namespace net {
namespace test_server {
-enum ResponseCode {
- SUCCESS = 200,
- CREATED = 201,
- NO_CONTENT = 204,
- MOVED = 301,
- RESUME_INCOMPLETE = 308,
- NOT_FOUND = 404,
- PRECONDITION = 412,
- ACCESS_DENIED = 500,
-};
-
// Interface for HTTP response implementations.
class HttpResponse{
public:
@@ -44,8 +35,8 @@ class BasicHttpResponse : public HttpResponse {
virtual ~BasicHttpResponse();
// The response code.
- ResponseCode code() const { return code_; }
- void set_code(ResponseCode code) { code_ = code; }
+ HttpStatusCode code() const { return code_; }
+ void set_code(HttpStatusCode code) { code_ = code; }
// The content of the response.
const std::string& content() const { return content_; }
@@ -57,24 +48,19 @@ class BasicHttpResponse : public HttpResponse {
content_type_ = content_type;
}
- // The custom headers to be sent to the client.
- const std::map<std::string, std::string>& custom_headers() const {
- return custom_headers_;
- }
-
// Adds a custom header.
void AddCustomHeader(const std::string& key, const std::string& value) {
- custom_headers_[key] = value;
+ custom_headers_.push_back(std::make_pair(key, value));
}
// Generates and returns a http response string.
virtual std::string ToResponseString() const OVERRIDE;
private:
- ResponseCode code_;
+ HttpStatusCode code_;
std::string content_;
std::string content_type_;
- std::map<std::string, std::string> custom_headers_;
+ std::vector<std::pair<std::string, std::string> > custom_headers_;
DISALLOW_COPY_AND_ASSIGN(BasicHttpResponse);
};
« no previous file with comments | « net/test/embedded_test_server/embedded_test_server_unittest.cc ('k') | net/test/embedded_test_server/http_response.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698