OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #include "chrome/browser/chromeos/drive/test_servers/http_response.h" | |
6 | |
7 #include "testing/gtest/include/gtest/gtest.h" | |
8 | |
9 namespace drive { | |
10 namespace test_servers { | |
11 | |
12 TEST(HttpResponseTest, GenerateResponse) { | |
13 HttpResponse response; | |
14 response.code = SUCCESS; | |
15 response.content = "Sample content - Hello world!"; | |
16 response.content_type = "text/plain"; | |
17 response.custom_headers["Simple-Header"] = "Simple value."; | |
18 std::string response_string = response.ToResponseString(); | |
19 | |
20 std::string request_response_string = | |
satorux1
2012/11/13 05:13:18
const std::string kExpectedRequestResponseString
mtomasz
2012/11/13 12:23:07
Done.
| |
21 "HTTP/1.1 200 OK\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!"; | |
26 | |
27 EXPECT_EQ(request_response_string, | |
28 response_string); | |
29 } | |
30 | |
31 } // namespace test_servers | |
32 } // namespace drive | |
OLD | NEW |