Delete unused downloads page asset.
[chromium-blink-merge.git] / net / test / embedded_test_server / http_response_unittest.cc
blob83b767f5fa8416ab3c02e0b473f5bd5f477b018e
1 // Copyright (c) 2012 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.
5 #include "net/test/embedded_test_server/http_response.h"
7 #include "testing/gtest/include/gtest/gtest.h"
9 namespace net {
10 namespace test_server {
12 TEST(HttpResponseTest, GenerateResponse) {
13 BasicHttpResponse response;
14 response.set_code(HTTP_OK);
15 response.set_content("Sample content - Hello world!");
16 response.set_content_type("text/plain");
17 response.AddCustomHeader("Simple-Header", "Simple value.");
19 std::string kExpectedResponseString =
20 "HTTP/1.1 200 OK\r\n"
21 "Connection: close\r\n"
22 "Content-Length: 29\r\n"
23 "Content-Type: text/plain\r\n"
24 "Simple-Header: Simple value.\r\n\r\n"
25 "Sample content - Hello world!";
27 EXPECT_EQ(kExpectedResponseString, response.ToResponseString());
30 } // namespace test_server
31 } // namespace net