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

Unified Diff: chrome/browser/chromeos/drive/test_servers/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: Fixed response generation. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/drive/test_servers/http_response_unittest.cc
diff --git a/chrome/browser/chromeos/drive/test_servers/http_response_unittest.cc b/chrome/browser/chromeos/drive/test_servers/http_response_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..041b0c0e91bb466a74697662993d51b4825c19e5
--- /dev/null
+++ b/chrome/browser/chromeos/drive/test_servers/http_response_unittest.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2012 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.
+
+#include "chrome/browser/chromeos/drive/test_servers/http_response.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace drive {
+namespace test_servers {
+
+TEST(HttpResponseTest, GenerateResponse) {
+ HttpResponse response;
+ response.code = SUCCESS;
+ response.content = "Sample content - Hello world!";
+ response.content_type = "text/plain";
+ response.custom_headers["Simple-Header"] = "Simple value.";
+ std::string response_string = response.ToResponseString();
+
+ std::string request_response_string =
satorux1 2012/11/13 05:13:18 const std::string kExpectedRequestResponseString
mtomasz 2012/11/13 12:23:07 Done.
+ "HTTP/1.1 200 OK\r\n"
+ "Content-Length: 29\r\n"
+ "Content-Type: text/plain\r\n"
+ "Simple-Header: Simple value.\r\n\r\n"
+ "Sample content - Hello world!";
+
+ EXPECT_EQ(request_response_string,
+ response_string);
+}
+
+} // namespace test_servers
+} // namespace drive

Powered by Google App Engine
This is Rietveld 408576698