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

Side by Side Diff: chrome/browser/google_apis/test_server/http_response_unittest.cc

Issue 11088073: HTTP server for testing Google Drive. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed most comments. Created 8 years, 1 month 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 (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/google_apis/test_server/http_response.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace drive {
10 namespace test_server {
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 kExpectedResponseString =
21 "HTTP/1.1 200 OK\r\n"
22 "Connection: closed\r\n"
23 "Content-Length: 29\r\n"
24 "Content-Type: text/plain\r\n"
25 "Simple-Header: Simple value.\r\n\r\n"
26 "Sample content - Hello world!";
27
28 EXPECT_EQ(kExpectedResponseString,
29 response_string);
30 }
31
32 } // namespace test_server
33 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698